| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
| 8 import 'package:usage/src/usage_impl.dart'; | 8 import 'package:usage/src/usage_impl.dart'; |
| 9 import 'package:usage/src/usage_impl_io.dart'; | 9 import 'package:usage/src/usage_impl_io.dart'; |
| 10 import 'package:usage/src/usage_impl_io.dart' as usage_io show getDartVersion; | 10 import 'package:usage/src/usage_impl_io.dart' as usage_io show getDartVersion; |
| 11 import 'package:usage/usage.dart'; | 11 import 'package:usage/usage.dart'; |
| 12 import 'package:usage/usage_io.dart'; | 12 import 'package:usage/usage_io.dart'; |
| 13 | 13 |
| 14 export 'package:usage/usage.dart' show Analytics; | 14 export 'package:usage/usage.dart' show Analytics; |
| 15 | 15 |
| 16 // TODO(devoncarew): Hard-coded to off for now. Remove when we're ready to ship. | 16 // TODO(devoncarew): Hard-coded to off for now. Remove when we're ready to ship. |
| 17 final bool _HARD_CODE_OFF = true; | 17 final bool _HARD_CODE_OFF = true; |
| 18 | 18 |
| 19 // TODO(devoncarew): Don't show the UI until we're ready to ship. |
| 20 final bool SHOW_ANALYTICS_UI = false; |
| 21 |
| 19 final String _dartDirectoryName = '.dart'; | 22 final String _dartDirectoryName = '.dart'; |
| 20 final String _settingsFileName = 'analytics.json'; | 23 final String _settingsFileName = 'analytics.json'; |
| 21 | 24 |
| 22 /// Dart SDK tools with analytics should display this notice. | 25 /// Dart SDK tools with analytics should display this notice. |
| 23 /// | 26 /// |
| 24 /// In addition, they should support displaying the analytics' status, and have | 27 /// In addition, they should support displaying the analytics' status, and have |
| 25 /// a flag to toggle analytics. This may look something like: | 28 /// a flag to toggle analytics. This may look something like: |
| 26 /// | 29 /// |
| 27 /// `Analytics are currently enabled (and can be disabled with --no-analytics).` | 30 /// `Analytics are currently enabled (and can be disabled with --no-analytics).` |
| 28 final String analyticsNotice = | 31 final String analyticsNotice = |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // - CHROME_HEADLESS and BUILDBOT_BUILDERNAME are properties on Chrome infra | 117 // - CHROME_HEADLESS and BUILDBOT_BUILDERNAME are properties on Chrome infra |
| 115 // bots. | 118 // bots. |
| 116 return Platform.environment['TRAVIS'] == 'true' || | 119 return Platform.environment['TRAVIS'] == 'true' || |
| 117 Platform.environment['BOT'] == 'true' || | 120 Platform.environment['BOT'] == 'true' || |
| 118 Platform.environment['CONTINUOUS_INTEGRATION'] == 'true' || | 121 Platform.environment['CONTINUOUS_INTEGRATION'] == 'true' || |
| 119 Platform.environment['CHROME_HEADLESS'] == '1' || | 122 Platform.environment['CHROME_HEADLESS'] == '1' || |
| 120 Platform.environment.containsKey('BUILDBOT_BUILDERNAME') || | 123 Platform.environment.containsKey('BUILDBOT_BUILDERNAME') || |
| 121 Platform.environment.containsKey('APPVEYOR') || | 124 Platform.environment.containsKey('APPVEYOR') || |
| 122 Platform.environment.containsKey('CI'); | 125 Platform.environment.containsKey('CI'); |
| 123 } | 126 } |
| OLD | NEW |