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
b0ebc716
Commit
b0ebc716
authored
Apr 27, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up git commits (#3578)
parent
67bf268d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
config.dart
packages/flutter_tools/lib/src/commands/config.dart
+1
-1
version.dart
packages/flutter_tools/lib/src/runner/version.dart
+24
-6
usage.dart
packages/flutter_tools/lib/src/usage.dart
+3
-2
No files found.
packages/flutter_tools/lib/src/commands/config.dart
View file @
b0ebc716
...
...
@@ -23,7 +23,7 @@ class ConfigCommand extends FlutterCommand {
final
String
description
=
'Configure Flutter settings.
\n\n
'
'The Flutter tool anonymously reports feature usage statistics and basic crash reports to help improve
\n
'
'Flutter tools over time. See Google
\'
s privacy policy:
www.google.com/intl/en/policies/privacy
'
;
'Flutter tools over time. See Google
\'
s privacy policy:
https://www.google.com/intl/en/policies/privacy/
'
;
@override
final
List
<
String
>
aliases
=
<
String
>[
'configure'
];
...
...
packages/flutter_tools/lib/src/runner/version.dart
View file @
b0ebc716
...
...
@@ -7,6 +7,13 @@ import 'dart:io';
import
'../artifacts.dart'
;
import
'../base/process.dart'
;
final
Set
<
String
>
kKnownBranchNames
=
new
Set
<
String
>.
from
(<
String
>[
'master'
,
'alpha'
,
'hackathon'
,
'beta'
]);
class
FlutterVersion
{
FlutterVersion
(
this
.
flutterRoot
)
{
_channel
=
_runGit
(
'git rev-parse --abbrev-ref --symbolic @{u}'
);
...
...
@@ -35,13 +42,13 @@ class FlutterVersion {
String
_frameworkRevision
;
String
get
frameworkRevision
=>
_frameworkRevision
;
String
get
frameworkRevisionShort
=>
_
runGit
(
'git rev-parse --short
$frameworkRevision
'
);
String
get
frameworkRevisionShort
=>
_
shortGitRevision
(
frameworkRevision
);
String
_frameworkAge
;
String
get
frameworkAge
=>
_frameworkAge
;
String
get
engineRevision
=>
ArtifactStore
.
engineRevision
;
String
get
engineRevisionShort
=>
_
runGit
(
'git rev-parse --short
$engineRevision
'
);
String
get
engineRevisionShort
=>
_
shortGitRevision
(
engineRevision
);
String
_runGit
(
String
command
)
=>
runSync
(
command
.
split
(
' '
),
workingDirectory:
flutterRoot
);
...
...
@@ -57,14 +64,21 @@ class FlutterVersion {
return
new
FlutterVersion
(
flutterRoot
!=
null
?
flutterRoot
:
ArtifactStore
.
flutterRoot
);
}
static
String
getVersionString
()
{
/// Return a short string for the version (`a76bc8e22b/alpha`).
static
String
getVersionString
({
bool
whitelistBranchName:
false
})
{
final
String
cwd
=
ArtifactStore
.
flutterRoot
;
String
commit
=
_runSync
(
'git'
,
<
String
>[
'rev-parse'
,
'HEAD'
],
cwd
);
if
(
commit
.
length
>
8
)
commit
=
commit
.
substring
(
0
,
8
);
String
commit
=
_shortGitRevision
(
_runSync
(
'git'
,
<
String
>[
'rev-parse'
,
'HEAD'
],
cwd
));
commit
=
commit
.
isEmpty
?
'unknown'
:
commit
;
String
branch
=
_runSync
(
'git'
,
<
String
>[
'rev-parse'
,
'--abbrev-ref'
,
'HEAD'
],
cwd
);
branch
=
branch
==
'HEAD'
?
'master'
:
branch
;
if
(
whitelistBranchName
||
branch
.
isEmpty
)
{
// Only return the branch names we know about; arbitrary branch names might contain PII.
if
(!
kKnownBranchNames
.
contains
(
branch
))
branch
=
'dev'
;
}
return
'
$commit
/
$branch
'
;
}
...
...
@@ -74,3 +88,7 @@ String _runSync(String executable, List<String> arguments, String cwd) {
ProcessResult
results
=
Process
.
runSync
(
executable
,
arguments
,
workingDirectory:
cwd
);
return
results
.
exitCode
==
0
?
results
.
stdout
.
trim
()
:
''
;
}
String
_shortGitRevision
(
String
revision
)
{
return
revision
.
length
>
10
?
revision
.
substring
(
0
,
10
)
:
revision
;
}
packages/flutter_tools/lib/src/usage.dart
View file @
b0ebc716
...
...
@@ -19,7 +19,8 @@ const String _kFlutterUA = 'UA-67589403-5';
class
Usage
{
Usage
()
{
_analytics
=
new
AnalyticsIO
(
_kFlutterUA
,
'flutter'
,
FlutterVersion
.
getVersionString
());
String
version
=
FlutterVersion
.
getVersionString
(
whitelistBranchName:
true
);
_analytics
=
new
AnalyticsIO
(
_kFlutterUA
,
'flutter'
,
version
);
_analytics
.
analyticsOpt
=
AnalyticsOpt
.
optOut
;
}
...
...
@@ -51,7 +52,7 @@ class Usage {
if
(
isFirstRun
)
return
new
_MockUsageTimer
();
else
return
new
UsageTimer
.
_
(
event
,
_analytics
.
startTimer
(
event
));
return
new
UsageTimer
.
_
(
event
,
_analytics
.
startTimer
(
event
,
category:
'flutter'
));
}
void
sendException
(
dynamic
exception
,
StackTrace
trace
)
{
...
...
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