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
12ebb66d
Commit
12ebb66d
authored
Mar 15, 2017
by
Todd Volkert
Committed by
GitHub
Mar 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow FlutterVersion to be overridden in the context (#8801)
parent
6f9bfbda
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
upgrade.dart
packages/flutter_tools/lib/src/commands/upgrade.dart
+3
-3
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+3
-2
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+1
-1
version.dart
packages/flutter_tools/lib/src/version.dart
+4
-7
No files found.
packages/flutter_tools/lib/src/commands/upgrade.dart
View file @
12ebb66d
...
@@ -32,8 +32,8 @@ class UpgradeCommand extends FlutterCommand {
...
@@ -32,8 +32,8 @@ class UpgradeCommand extends FlutterCommand {
throwToolExit
(
'Unable to upgrade Flutter: no upstream repository configured.'
);
throwToolExit
(
'Unable to upgrade Flutter: no upstream repository configured.'
);
}
}
final
FlutterVersion
version
=
new
FlutterVersion
(
Cache
.
flutterRoot
)
;
final
FlutterVersion
flutterVersion
=
FlutterVersion
.
instance
;
if
(
v
ersion
.
channel
==
'alpha'
)
{
if
(
flutterV
ersion
.
channel
==
'alpha'
)
{
// The alpha branch is deprecated. Rather than trying to pull the alpha
// The alpha branch is deprecated. Rather than trying to pull the alpha
// branch, we should switch upstream to master.
// branch, we should switch upstream to master.
printStatus
(
'Switching to from alpha to master...'
);
printStatus
(
'Switching to from alpha to master...'
);
...
@@ -66,7 +66,7 @@ class UpgradeCommand extends FlutterCommand {
...
@@ -66,7 +66,7 @@ class UpgradeCommand extends FlutterCommand {
);
);
printStatus
(
''
);
printStatus
(
''
);
printStatus
(
FlutterVersion
.
getVersion
(
Cache
.
flutterRoot
)
.
toString
());
printStatus
(
flutterVersion
.
toString
());
final
String
projRoot
=
findProjectRoot
();
final
String
projRoot
=
findProjectRoot
();
if
(
projRoot
!=
null
)
{
if
(
projRoot
!=
null
)
{
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
12ebb66d
...
@@ -15,6 +15,7 @@ import 'base/file_system.dart';
...
@@ -15,6 +15,7 @@ import 'base/file_system.dart';
import
'base/io.dart'
;
import
'base/io.dart'
;
import
'base/platform.dart'
;
import
'base/platform.dart'
;
import
'base/process_manager.dart'
;
import
'base/process_manager.dart'
;
import
'cache.dart'
;
import
'device.dart'
;
import
'device.dart'
;
import
'globals.dart'
;
import
'globals.dart'
;
import
'ios/ios_workflow.dart'
;
import
'ios/ios_workflow.dart'
;
...
@@ -228,9 +229,9 @@ class _FlutterValidator extends DoctorValidator {
...
@@ -228,9 +229,9 @@ class _FlutterValidator extends DoctorValidator {
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
final
ValidationType
valid
=
ValidationType
.
installed
;
final
ValidationType
valid
=
ValidationType
.
installed
;
final
FlutterVersion
version
=
FlutterVersion
.
getVersion
()
;
final
FlutterVersion
version
=
FlutterVersion
.
instance
;
messages
.
add
(
new
ValidationMessage
(
'Flutter at
${
version
.flutterRoot}
'
));
messages
.
add
(
new
ValidationMessage
(
'Flutter at
${
Cache
.flutterRoot}
'
));
messages
.
add
(
new
ValidationMessage
(
messages
.
add
(
new
ValidationMessage
(
'Framework revision
${version.frameworkRevisionShort}
'
'Framework revision
${version.frameworkRevisionShort}
'
'(
${version.frameworkAge}
),
${version.frameworkDate}
'
'(
${version.frameworkAge}
),
${version.frameworkDate}
'
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
12ebb66d
...
@@ -254,7 +254,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
...
@@ -254,7 +254,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
if
(
globalResults
[
'version'
])
{
if
(
globalResults
[
'version'
])
{
flutterUsage
.
sendCommand
(
'version'
);
flutterUsage
.
sendCommand
(
'version'
);
printStatus
(
FlutterVersion
.
getVersion
(
Cache
.
flutterRoot
)
.
toString
());
printStatus
(
FlutterVersion
.
instance
.
toString
());
return
;
return
;
}
}
...
...
packages/flutter_tools/lib/src/version.dart
View file @
12ebb66d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'base/context.dart'
;
import
'base/io.dart'
;
import
'base/io.dart'
;
import
'base/process.dart'
;
import
'base/process.dart'
;
import
'base/process_manager.dart'
;
import
'base/process_manager.dart'
;
...
@@ -16,7 +17,7 @@ final Set<String> kKnownBranchNames = new Set<String>.from(<String>[
...
@@ -16,7 +17,7 @@ final Set<String> kKnownBranchNames = new Set<String>.from(<String>[
]);
]);
class
FlutterVersion
{
class
FlutterVersion
{
FlutterVersion
(
this
.
flutterRoot
)
{
FlutterVersion
.
_
(
)
{
_channel
=
_runGit
(
'git rev-parse --abbrev-ref --symbolic @{u}'
);
_channel
=
_runGit
(
'git rev-parse --abbrev-ref --symbolic @{u}'
);
final
int
slash
=
_channel
.
indexOf
(
'/'
);
final
int
slash
=
_channel
.
indexOf
(
'/'
);
...
@@ -32,8 +33,6 @@ class FlutterVersion {
...
@@ -32,8 +33,6 @@ class FlutterVersion {
_frameworkAge
=
_runGit
(
'git log -n 1 --pretty=format:%ar'
);
_frameworkAge
=
_runGit
(
'git log -n 1 --pretty=format:%ar'
);
}
}
final
String
flutterRoot
;
String
_repositoryUrl
;
String
_repositoryUrl
;
String
get
repositoryUrl
=>
_repositoryUrl
;
String
get
repositoryUrl
=>
_repositoryUrl
;
...
@@ -55,7 +54,7 @@ class FlutterVersion {
...
@@ -55,7 +54,7 @@ class FlutterVersion {
String
get
engineRevision
=>
Cache
.
engineRevision
;
String
get
engineRevision
=>
Cache
.
engineRevision
;
String
get
engineRevisionShort
=>
_shortGitRevision
(
engineRevision
);
String
get
engineRevisionShort
=>
_shortGitRevision
(
engineRevision
);
String
_runGit
(
String
command
)
=>
runSync
(
command
.
split
(
' '
),
workingDirectory:
flutterRoot
);
String
_runGit
(
String
command
)
=>
runSync
(
command
.
split
(
' '
),
workingDirectory:
Cache
.
flutterRoot
);
@override
@override
String
toString
()
{
String
toString
()
{
...
@@ -77,9 +76,7 @@ class FlutterVersion {
...
@@ -77,9 +76,7 @@ class FlutterVersion {
return
_runSync
(<
String
>[
'git'
,
'log'
,
'-n'
,
'1'
,
'--pretty=format:%ad'
,
'--date=format:%Y-%m-%d %H:%M:%S'
],
Cache
.
flutterRoot
);
return
_runSync
(<
String
>[
'git'
,
'log'
,
'-n'
,
'1'
,
'--pretty=format:%ad'
,
'--date=format:%Y-%m-%d %H:%M:%S'
],
Cache
.
flutterRoot
);
}
}
static
FlutterVersion
getVersion
([
String
flutterRoot
])
{
static
FlutterVersion
get
instance
=>
context
.
putIfAbsent
(
FlutterVersion
,
()
=>
new
FlutterVersion
.
_
());
return
new
FlutterVersion
(
flutterRoot
!=
null
?
flutterRoot
:
Cache
.
flutterRoot
);
}
/// Return a short string for the version (`alpha/a76bc8e22b`).
/// Return a short string for the version (`alpha/a76bc8e22b`).
static
String
getVersionString
({
bool
whitelistBranchName:
false
})
{
static
String
getVersionString
({
bool
whitelistBranchName:
false
})
{
...
...
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