Added a dependency list to pin packages to a certain version.

This is in case of a breakage induced by a newer version of a package. This allows the build to be kept green while we adapt.

Change-Id: Ic15e7512a0b84d10f5244617b68c7a26bc8e0801
diff --git a/dart_dependencies.yaml b/dart_dependencies.yaml
new file mode 100644
index 0000000..5122496
--- /dev/null
+++ b/dart_dependencies.yaml
@@ -0,0 +1,12 @@
+# Copyright 2017 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is used to temporarily pin certain packages to a particular version
+# in case of a breakage.
+
+name: emergency_deps
+dependencies:
+  # 3.1.0 uses Platform.localeName which crashes if the LANG environment
+  # variable is not set, which is the case on bots.
+  usage: 3.0.1
diff --git a/pub/usage/.gitignore b/pub/usage/.gitignore
index a9df6e6..e3225ef 100644
--- a/pub/usage/.gitignore
+++ b/pub/usage/.gitignore
@@ -2,5 +2,4 @@
 .idea/
 .pub/
 build/
-doc/api/
 pubspec.lock
diff --git a/pub/usage/.travis.yml b/pub/usage/.travis.yml
index 96ba4fc..9e27d1f 100644
--- a/pub/usage/.travis.yml
+++ b/pub/usage/.travis.yml
@@ -1,4 +1,3 @@
 language: dart
-dart: dev
 sudo: false
 script: ./tool/travis.sh
diff --git a/pub/usage/BUILD.gn b/pub/usage/BUILD.gn
index 2e4d91a..67f88f7 100644
--- a/pub/usage/BUILD.gn
+++ b/pub/usage/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for usage-3.1.0
+# This file is generated by importer.py for usage-3.0.1
 
 import("//build/dart/dart_package.gni")
 
diff --git a/pub/usage/changelog.md b/pub/usage/changelog.md
index 3abc692..7558a01 100644
--- a/pub/usage/changelog.md
+++ b/pub/usage/changelog.md
@@ -1,10 +1,5 @@
 # Changelog
 
-## 3.1.0
-- switch the technique we use to determine the locale to the new dart:io
-  `Platform.localeName` field
-- change our minimum SDK version to `1.24.0`
-
 ## 3.0.1
 - expose the `Analytics.clientId` field
 
diff --git a/pub/usage/lib/src/usage_impl_io.dart b/pub/usage/lib/src/usage_impl_io.dart
index 57ac8ec..ff1b153 100644
--- a/pub/usage/lib/src/usage_impl_io.dart
+++ b/pub/usage/lib/src/usage_impl_io.dart
@@ -136,7 +136,7 @@
 /// Return the string for the platform's locale; return's `null` if the locale
 /// can't be determined.
 String getPlatformLocale() {
-  String locale = Platform.localeName;
+  String locale = Platform.environment['LANG'];
   if (locale == null) return null;
 
   if (locale != null) {
diff --git a/pub/usage/pubspec.yaml b/pub/usage/pubspec.yaml
index b0cc22a..67cc71c 100644
--- a/pub/usage/pubspec.yaml
+++ b/pub/usage/pubspec.yaml
@@ -3,13 +3,13 @@
 # BSD-style license that can be found in the LICENSE file.
 
 name: usage
-version: 3.1.0
+version: 3.0.1
 description: A Google Analytics wrapper for both command-line, web, and Flutter apps.
 homepage: https://github.com/dart-lang/usage
 author: Dart Team <misc@dartlang.org>
 
 environment:
-  sdk: '>=1.24.0-dev.0.0 <2.0.0'
+  sdk: '>=1.19.0 <2.0.0'
 
 dependencies:
   path: ^1.4.0
diff --git a/pub/usage/readme.md b/pub/usage/readme.md
index b348773..458c581 100644
--- a/pub/usage/readme.md
+++ b/pub/usage/readme.md
@@ -1,6 +1,7 @@
 # usage
 
-`usage` is a wrapper around Google Analytics for command-line, web, and Flutter apps.
+`usage` is a wrapper around Google Analytics for both command-line, web, and
+Flutter apps.
 
 [![pub package](https://img.shields.io/pub/v/usage.svg)](https://pub.dartlang.org/packages/usage)
 [![Build Status](https://travis-ci.org/dart-lang/usage.svg)](https://travis-ci.org/dart-lang/usage)