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
b8899159
Unverified
Commit
b8899159
authored
Sep 14, 2021
by
Michael Thomsen
Committed by
GitHub
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change min Dart SDK constraint to track actual version (#88743)
parent
3b7adb98
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
cache.dart
packages/flutter_tools/lib/src/cache.dart
+16
-0
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+3
-1
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+10
-0
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
b8899159
...
...
@@ -371,6 +371,22 @@ class Cache {
}
String
?
_dartSdkVersion
;
/// The current version of Dart used to build Flutter and run the tool.
String
get
dartSdkBuild
{
if
(
_dartSdkBuild
==
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
];
_dartSdkBuild
=
justVersion
.
replaceFirstMapped
(
RegExp
(
r'(\d+\.\d+\.\d+)(.+)'
),
(
Match
match
)
{
final
String
noFlutter
=
match
[
2
]!.
replaceAll
(
'.flutter-'
,
' '
);
return
'
${match[1]}$noFlutter
'
;
});
}
return
_dartSdkBuild
!;
}
String
?
_dartSdkBuild
;
/// The current version of the Flutter engine the flutter tool will download.
String
get
engineRevision
{
_engineRevision
??=
getVersionFor
(
'engine'
);
...
...
packages/flutter_tools/lib/src/commands/create.dart
View file @
b8899159
...
...
@@ -230,6 +230,8 @@ class CreateCommand extends CreateBase {
);
}
final
String
dartSdk
=
globals
.
cache
.
dartSdkBuild
;
final
Map
<
String
,
Object
>
templateContext
=
createTemplateContext
(
organization:
organization
,
projectName:
projectName
,
...
...
@@ -246,7 +248,7 @@ class CreateCommand extends CreateBase {
windows:
featureFlags
.
isWindowsEnabled
&&
platforms
.
contains
(
'windows'
),
windowsUwp:
featureFlags
.
isWindowsUwpEnabled
&&
platforms
.
contains
(
'winuwp'
),
// Enable null safety everywhere.
dartSdkVersionBounds:
'">=
2.12.0
<3.0.0"'
,
dartSdkVersionBounds:
'">=
$dartSdk
<3.0.0"'
,
implementationTests:
boolArg
(
'implementation-tests'
),
);
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
b8899159
...
...
@@ -16,6 +16,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/flutter_cache.dart'
;
import
'package:flutter_tools/src/globals_null_migrated.dart'
as
globals
;
import
'package:meta/meta.dart'
;
import
'package:test/fake.dart'
;
...
...
@@ -864,6 +865,15 @@ void main() {
expect
(
pub
.
calledGet
,
1
);
});
// Check that the build number matches the format documented here:
// https://dart.dev/get-dart#release-channels
testUsingContext
(
'Check current Dart SDK build number'
,
()
async
{
final
String
currentDartSdkVersion
=
globals
.
cache
.
dartSdkBuild
;
final
RegExp
dartSdkVersionFormat
=
RegExp
(
r'\d+\.\d+\.\d+(?:-\S+)?'
);
expect
(
dartSdkVersionFormat
.
allMatches
(
currentDartSdkVersion
).
length
,
1
,);
});
group
(
'AndroidMavenArtifacts'
,
()
{
MemoryFileSystem
memoryFileSystem
;
Cache
cache
;
...
...
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