Skip to content

Commit 0bd69d2

Browse files
authored
Fix generating both settings.gradle and settings.gradle.kts for plugins (flutter#181592)
Fixes flutter#181565 Fixes flutter#142685 this was a side effect from flutter#173993 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 439321b commit 0bd69d2

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

packages/flutter_tools/templates/plugin_shared/android.tmpl/settings.gradle.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/flutter_tools/templates/template_manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@
319319
"templates/plugin_shared/.metadata.tmpl",
320320
"templates/plugin_shared/analysis_options.yaml.tmpl",
321321
"templates/plugin_shared/android.tmpl/.gitignore",
322-
"templates/plugin_shared/android.tmpl/settings.gradle.tmpl",
323322
"templates/plugin_shared/android.tmpl/src/main/AndroidManifest.xml.tmpl",
324323
"templates/plugin_shared/CHANGELOG.md.tmpl",
325324
"templates/plugin_shared/LICENSE.tmpl",

packages/flutter_tools/test/commands.shard/permeable/create_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,28 @@ void main() {
29122912
overrides: {FeatureFlags: () => TestFeatureFlags(), Logger: () => logger},
29132913
);
29142914

2915+
testUsingContext(
2916+
'plugin includes only setting.gradle.kts',
2917+
() async {
2918+
// Regression test for https://github.com/flutter/flutter/issues/181565.
2919+
final command = CreateCommand();
2920+
final CommandRunner<void> runner = createTestCommandRunner(command);
2921+
2922+
await runner.run(<String>[
2923+
'create',
2924+
'--no-pub',
2925+
'--template=plugin',
2926+
'--org=com.example',
2927+
'--platforms=android',
2928+
projectDir.path,
2929+
]);
2930+
2931+
expect(projectDir.childDirectory('android').childFile('settings.gradle.kts'), exists);
2932+
expect(projectDir.childDirectory('android').childFile('settings.gradle'), isNot(exists));
2933+
},
2934+
overrides: {FeatureFlags: () => TestFeatureFlags(), Logger: () => logger},
2935+
);
2936+
29152937
testUsingContext(
29162938
'plugin includes native Swift unit tests',
29172939
() async {

0 commit comments

Comments
 (0)