mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Use $dartSdkVersion when creating "dummy" pubspec for create_api_docs (#172327)
Closes https://github.com/flutter/flutter/issues/70239. /cc @ievdokdm
This commit is contained in:
parent
8667c183af
commit
7b99061e06
@ -284,7 +284,7 @@ class Configurator {
|
||||
'homepage: https://flutter.dev',
|
||||
'version: 0.0.0',
|
||||
'environment:',
|
||||
" sdk: '>=3.2.0-0 <4.0.0'",
|
||||
" sdk: '^${FlutterInformation.instance.getDartSdkVersion()}'",
|
||||
'dependencies:',
|
||||
for (final String package in findPackageNames(filesystem)) ' $package:\n sdk: flutter',
|
||||
' $kPlatformIntegrationPackageName: 0.0.1',
|
||||
@ -1194,6 +1194,9 @@ class FlutterInformation {
|
||||
/// Gets the name of the current branch in the Flutter framework in the repo.
|
||||
String getBranchName() => getFlutterInformation()['branchName']! as String;
|
||||
|
||||
/// Gets the current Dart SDK version.
|
||||
Version getDartSdkVersion() => getFlutterInformation()['dartSdkVersion']! as Version;
|
||||
|
||||
Map<String, Object>? _cachedFlutterInformation;
|
||||
|
||||
/// Gets a Map of various kinds of information about the Flutter repo.
|
||||
|
||||
@ -338,15 +338,13 @@ void main() {
|
||||
test('.generateConfiguration generates pubspec.yaml', () async {
|
||||
configurator.generateConfiguration();
|
||||
expect(packageRoot.childFile('pubspec.yaml').existsSync(), isTrue);
|
||||
expect(packageRoot.childFile('pubspec.yaml').readAsStringSync(), contains('flutter_gpu:'));
|
||||
expect(
|
||||
packageRoot.childFile('pubspec.yaml').readAsStringSync(),
|
||||
contains('dependency_overrides:'),
|
||||
);
|
||||
expect(
|
||||
packageRoot.childFile('pubspec.yaml').readAsStringSync(),
|
||||
contains('platform_integration:'),
|
||||
);
|
||||
|
||||
final String pubspecContents = packageRoot.childFile('pubspec.yaml').readAsStringSync();
|
||||
|
||||
expect(pubspecContents, contains('flutter_gpu:'));
|
||||
expect(pubspecContents, contains("sdk: '^2.14.0-360.0.dev'"));
|
||||
expect(pubspecContents, contains('dependency_overrides:'));
|
||||
expect(pubspecContents, contains('platform_integration:'));
|
||||
});
|
||||
|
||||
test('.generateConfiguration generates fake lib', () async {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user