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
dc2cc637
Unverified
Commit
dc2cc637
authored
Oct 26, 2018
by
Greg Spencer
Committed by
GitHub
Oct 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the version string for customer consumption. (#23578)
Fixes #21825
parent
22382624
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
cache.dart
packages/flutter_tools/lib/src/cache.dart
+12
-1
version.dart
packages/flutter_tools/lib/src/version.dart
+5
-5
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
dc2cc637
...
...
@@ -112,7 +112,18 @@ class Cache {
String
_dartSdkVersion
;
String
get
dartSdkVersion
=>
_dartSdkVersion
??=
platform
.
version
;
String
get
dartSdkVersion
{
if
(
_dartSdkVersion
==
null
)
{
// Make the version string more customer-friendly.
// Changes '2.1.0-dev.8.0.flutter-4312ae32' to '2.1.0 (build 2.1.0-dev.8.0 4312ae32)'
final
String
justVersion
=
platform
.
version
.
split
(
' '
)[
0
];
_dartSdkVersion
=
justVersion
.
replaceFirstMapped
(
RegExp
(
r'(\d+\.\d+\.\d+)(.+)'
),
(
Match
match
)
{
final
String
noFlutter
=
match
[
2
].
replaceAll
(
'.flutter-'
,
' '
);
return
'
${match[1]}
(build
${match[1]}$noFlutter
)'
;
});
}
return
_dartSdkVersion
;
}
String
_engineRevision
;
...
...
packages/flutter_tools/lib/src/version.dart
View file @
dc2cc637
...
...
@@ -82,7 +82,7 @@ class FlutterVersion {
String
get
frameworkDate
=>
frameworkCommitDate
;
String
get
dartSdkVersion
=>
Cache
.
instance
.
dartSdkVersion
.
split
(
' '
)[
0
]
;
String
get
dartSdkVersion
=>
Cache
.
instance
.
dartSdkVersion
;
String
get
engineRevision
=>
Cache
.
instance
.
engineRevision
;
String
get
engineRevisionShort
=>
_shortGitRevision
(
engineRevision
);
...
...
@@ -99,10 +99,10 @@ class FlutterVersion {
final
String
engineText
=
'Engine • revision
$engineRevisionShort
'
;
final
String
toolsText
=
'Tools • Dart
$dartSdkVersion
'
;
// Flutter 1.
3.922-pre.2
• channel master • https://github.com/flutter/flutter.git
// Framework • revision
2259c59be8 • 19 minutes ago • 2016-08-15 22:51:4
0
// Engine • revision
fe509b0d96
// Tools • Dart
1.19.0-dev.5.0
// Flutter 1.
10.2-pre.69
• channel master • https://github.com/flutter/flutter.git
// Framework • revision
340c158f32 (84 minutes ago) • 2018-10-26 11:27:22 -040
0
// Engine • revision
9c46333e14
// Tools • Dart
2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)
return
'
$flutterText
\n
$frameworkText
\n
$engineText
\n
$toolsText
'
;
}
...
...
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