Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
bd564a02
Commit
bd564a02
authored
May 06, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid sending analytics on ci systems (#3765)
* avoid sending analytics on ci systems * review comments
parent
153e1bb9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
15 deletions
+37
-15
executable.dart
packages/flutter_tools/lib/executable.dart
+1
-1
utils.dart
packages/flutter_tools/lib/src/base/utils.dart
+7
-0
upgrade.dart
packages/flutter_tools/lib/src/commands/upgrade.dart
+1
-1
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+1
-1
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+1
-1
usage.dart
packages/flutter_tools/lib/src/usage.dart
+20
-3
version.dart
packages/flutter_tools/lib/src/version.dart
+4
-4
setup.sh
travis/setup.sh
+2
-4
No files found.
packages/flutter_tools/lib/executable.dart
View file @
bd564a02
...
...
@@ -102,7 +102,7 @@ Future<Null> main(List<String> args) async {
flutterUsage
.
sendException
(
error
,
chain
);
if
(
Platform
.
environment
.
containsKey
(
'FLUTTER_DEV'
))
{
if
(
Platform
.
environment
.
containsKey
(
'FLUTTER_DEV'
)
||
isRunningOnBot
)
{
// If we're working on the tools themselves, just print the stack trace.
stderr
.
writeln
(
'
$error
'
);
stderr
.
writeln
(
chain
.
terse
.
toString
());
...
...
packages/flutter_tools/lib/src/base/utils.dart
View file @
bd564a02
...
...
@@ -8,6 +8,13 @@ import 'dart:io';
import
'package:crypto/crypto.dart'
;
import
'package:path/path.dart'
as
path
;
bool
get
isRunningOnBot
{
// https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
return
Platform
.
environment
[
'TRAVIS'
]
==
'true'
||
Platform
.
environment
[
'CONTINUOUS_INTEGRATION'
]
==
'true'
;
}
String
hex
(
List
<
int
>
bytes
)
{
StringBuffer
result
=
new
StringBuffer
();
for
(
int
part
in
bytes
)
...
...
packages/flutter_tools/lib/src/commands/upgrade.dart
View file @
bd564a02
...
...
@@ -10,7 +10,7 @@ import '../base/process.dart';
import
'../dart/pub.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../
runner/
version.dart'
;
import
'../version.dart'
;
class
UpgradeCommand
extends
FlutterCommand
{
@override
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
bd564a02
...
...
@@ -12,7 +12,7 @@ import 'base/context.dart';
import
'base/os.dart'
;
import
'globals.dart'
;
import
'ios/ios_workflow.dart'
;
import
'
runner/
version.dart'
;
import
'version.dart'
;
const
Map
<
String
,
String
>
_osNames
=
const
<
String
,
String
>{
'macos'
:
'Mac OS'
,
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
bd564a02
...
...
@@ -18,7 +18,7 @@ import '../build_configuration.dart';
import
'../globals.dart'
;
import
'../package_map.dart'
;
import
'../toolchain.dart'
;
import
'version.dart'
;
import
'
../
version.dart'
;
const
String
kFlutterRootEnvironmentVariableName
=
'FLUTTER_ROOT'
;
// should point to //flutter/ (root of flutter/flutter repo)
const
String
kFlutterEngineEnvironmentVariableName
=
'FLUTTER_ENGINE'
;
// should point to //engine/src/ (root of flutter/engine repo)
...
...
packages/flutter_tools/lib/src/usage.dart
View file @
bd564a02
...
...
@@ -8,8 +8,9 @@ import 'package:usage/src/usage_impl_io.dart';
import
'package:usage/usage.dart'
;
import
'base/context.dart'
;
import
'base/utils.dart'
;
import
'globals.dart'
;
import
'
runner/
version.dart'
;
import
'version.dart'
;
// TODO(devoncarew): We'll need to do some work on the user agent in order to
// correctly track usage by operating system (dart-lang/usage/issues/70).
...
...
@@ -22,7 +23,19 @@ class Usage {
Usage
()
{
String
version
=
FlutterVersion
.
getVersionString
(
whitelistBranchName:
true
);
_analytics
=
new
AnalyticsIO
(
_kFlutterUA
,
'flutter'
,
version
);
_analytics
.
analyticsOpt
=
AnalyticsOpt
.
optOut
;
bool
runningOnCI
=
false
;
// Many CI systems don't do a full git checkout.
if
(
version
.
startsWith
(
'unknown/'
))
runningOnCI
=
true
;
// Check for common CI systems.
if
(
isRunningOnBot
)
runningOnCI
=
true
;
// If we think we're running on a CI system, default to not sending analytics.
_analytics
.
analyticsOpt
=
runningOnCI
?
AnalyticsOpt
.
optIn
:
AnalyticsOpt
.
optOut
;
}
/// Returns [Usage] active in the current app context.
...
...
@@ -82,10 +95,14 @@ class Usage {
final
String
versionString
=
FlutterVersion
.
getVersionString
(
whitelistBranchName:
true
);
String
welcomeString
=
'Welcome to Flutter! - Flutter version
$versionString
- https://flutter.io'
;
welcomeString
=
welcomeString
.
padLeft
((
welcomeString
.
length
+
100
)
~/
2
);
welcomeString
=
welcomeString
.
padRight
(
100
);
printStatus
(
''
);
printStatus
(
'''
╔════════════════════════════════════════════════════════════════════════════════════════════════════╗
║
Welcome to Flutter! - Flutter version
$versionString
- https://flutter.io
║
║
$welcomeString
║
║ ║
║ The Flutter tool anonymously reports feature usage statistics and basic crash reports to Google in ║
║ order to help Google contribute improvements to Flutter over time. See Google'
s
privacy
policy:
║
...
...
packages/flutter_tools/lib/src/
runner/
version.dart
→
packages/flutter_tools/lib/src/version.dart
View file @
bd564a02
...
...
@@ -4,8 +4,8 @@
import
'dart:io'
;
import
'
../
artifacts.dart'
;
import
'
../
base/process.dart'
;
import
'artifacts.dart'
;
import
'base/process.dart'
;
final
Set
<
String
>
kKnownBranchNames
=
new
Set
<
String
>.
from
(<
String
>[
'master'
,
...
...
@@ -64,7 +64,7 @@ class FlutterVersion {
return
new
FlutterVersion
(
flutterRoot
!=
null
?
flutterRoot
:
ArtifactStore
.
flutterRoot
);
}
/// Return a short string for the version (`a
76bc8e22b/alpha
`).
/// Return a short string for the version (`a
lpha/a76bc8e22b
`).
static
String
getVersionString
({
bool
whitelistBranchName:
false
})
{
final
String
cwd
=
ArtifactStore
.
flutterRoot
;
...
...
@@ -80,7 +80,7 @@ class FlutterVersion {
branch
=
'dev'
;
}
return
'
$
commit
/
$branch
'
;
return
'
$
branch
/
$commit
'
;
}
}
...
...
travis/setup.sh
View file @
bd564a02
#!/bin/bash
set
-ex
# Download dependencies flutter
./bin/flutter
--version
# Disable analytics on the bots (to avoid skewing analytics data).
# disable analytics on the bots and download Flutter dependencies
./bin/flutter config
--no-analytics
# run pub get in all the repo packages
./bin/flutter update-packages
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment