Skip to content

Commit 761cb82

Browse files
authored
update the IntelliJ metadata templates (flutter#14867)
* update the IntelliJ metedata templates * fix test expectation
1 parent c3bbcb6 commit 761cb82

File tree

10 files changed

+51
-75
lines changed

10 files changed

+51
-75
lines changed

packages/flutter_tools/templates/create/.idea/libraries/Dart_SDK.xml.tmpl

Lines changed: 12 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flutter_tools/templates/create/.idea/libraries/Flutter_for_Android.xml.tmpl

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flutter_tools/templates/create/android.iml.tmpl

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/flutter_tools/templates/create/projectName.iml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module type="WEB_MODULE" version="4">
2+
<module type="JAVA_MODULE" version="4">
33
<component name="NewModuleRootManager" inherit-compiler-output="true">
44
<exclude-output />
55
<content url="file://$MODULE_DIR$">

packages/flutter_tools/templates/package/.idea/libraries/Dart_SDK.xml.tmpl

Lines changed: 12 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flutter_tools/templates/package/projectName.iml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module type="WEB_MODULE" version="4">
2+
<module type="JAVA_MODULE" version="4">
33
<component name="NewModuleRootManager" inherit-compiler-output="true">
44
<exclude-output />
55
<content url="file://$MODULE_DIR$">

packages/flutter_tools/templates/plugin/.idea/libraries/Dart_SDK.xml.tmpl

Lines changed: 12 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flutter_tools/templates/plugin/.idea/libraries/Flutter_for_Android.xml.tmpl

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/flutter_tools/templates/plugin/projectName.iml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module type="WEB_MODULE" version="4">
2+
<module type="JAVA_MODULE" version="4">
33
<component name="NewModuleRootManager" inherit-compiler-output="true">
44
<exclude-output />
55
<content url="file://$MODULE_DIR$">

packages/flutter_tools/test/commands/create_test.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void main() {
197197
}
198198

199199
expectExists('lib/main.dart');
200+
200201
for (FileSystemEntity file in projectDir.listSync(recursive: true)) {
201202
if (file is File && file.path.endsWith('.dart')) {
202203
final String original = file.readAsStringSync();
@@ -235,11 +236,16 @@ void main() {
235236
expect(version, contains('version:'));
236237
expect(version, contains('revision: 12345678'));
237238
expect(version, contains('channel: omega'));
238-
},
239-
overrides: <Type, Generator>{
239+
240+
// IntelliJ metadata
241+
final String intelliJSdkMetadataPath = fs.path.join('.idea', 'libraries', 'Dart_SDK.xml');
242+
expectExists(intelliJSdkMetadataPath);
243+
final String sdkMetaContents = fs.file(fs.path.join(projectDir.path, intelliJSdkMetadataPath)).readAsStringSync();
244+
expect(sdkMetaContents, contains('<root url="file:/'));
245+
expect(sdkMetaContents, contains('/bin/cache/dart-sdk/lib/core"'));
246+
}, overrides: <Type, Generator>{
240247
FlutterVersion: () => mockFlutterVersion,
241-
},
242-
timeout: allowForCreateFlutterProject);
248+
}, timeout: allowForCreateFlutterProject);
243249

244250
// Verify that we can regenerate over an existing project.
245251
testUsingContext('can re-gen over existing project', () async {

0 commit comments

Comments
 (0)