Added warning against migration to built-in kotlin - #13634
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds warning callouts to the Kotlin migration documentation to clarify that the migration is only relevant for projects already using the Kotlin Gradle Plugin (KGP). The reviewer suggested rephrasing these warnings across all three files to specify that the migration itself is what only applies to KGP-using projects, rather than the entire guide, which resolves contradictions and ensures accuracy.
|
Staged preview of the updated docs.flutter.dev site (updated for commit b3605d7): https://flutter-docs-prod--docs-pr13634-migration-warning-1du7aw2r.web.app |
|
Staged preview of the updated flutter.dev site (updated for commit b3605d7): https://flutter-dev-230821--www-pr13634-migration-warning-ug8ucv7l.web.app |
|
Can the warning also mention what it means to "apply KGP"? Something like "If your project doesn't currently apply KGP (ie your gradle file doesn't have a line like |
| :::warning | ||
| This guide only applies to apps that already use the | ||
| Kotlin Gradle Plugin (KGP). | ||
| If your project doesn't currently apply KGP, |
There was a problem hiding this comment.
How will they know if their project applies KGP?
There was a problem hiding this comment.
Devs can check if their project applies KGP by looking at their build.gradle(.kts) file. Instructions on how to identify and locate KGP already exist in the doc for app devs and plugin authors. I can just add something like that in the warning at the top of the doc for app devs and plugin authors.
| This guide only applies to apps that already use the | ||
| Kotlin Gradle Plugin (KGP). |
There was a problem hiding this comment.
What about the requirement to add android.newDsl=false mentioned in the next section? Do apps that don't use KGP or add-to-app apps need to add that either way?
There was a problem hiding this comment.
android.newDsl=false is completely separate from KGP/migrating to built-in kotlin. Whether or not an app is applying KGP, android.newDsl=false must be set to succesfully build an app using AGP 9. So there are technically two parts to successfully building on AGP 9:
- migrate to built-in kotlin (if applicable)
android.newDslisfalse(this only has to be manually set for add-to-app scenarios)
This guide is specifically for those migrating to built-in kotlin. I do think the above^ is important to communicate. Any guidance for how to communicate it? (as a part of this guide? another doc?).
There was a problem hiding this comment.
Thanks for the clarification. I would consider creating an additional short and focused migration doc, potentially limited to the add-to-app scenario?
There was a problem hiding this comment.
Sounds good. I'll do that in a different change.
…lt-in-kotlin/for-plugin-authors.md Co-authored-by: Parker Lougheed <parlough@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for migrating to built-in Kotlin for Flutter apps and plugins. It adds warnings that the migration only applies to projects already using the Kotlin Gradle Plugin (KGP), clarifies that AGP 9+ is required, and corrects some Gradle file paths for plugin projects. The review feedback suggests improving clarity by rephrasing 'KGP application code' to 'how KGP is applied' in both the app developer and plugin author guides to avoid confusion with Android applications.
| To view the KGP application code, | ||
| see [Update the Gradle file](#update-the-gradle-file). |
There was a problem hiding this comment.
The phrase 'KGP application code' can be confusing because 'application' is often interpreted as an Android application (app) rather than the act of applying a plugin. Consider rephrasing this to 'how KGP is applied' or 'examples of how KGP is applied' to improve clarity.
| To view the KGP application code, | |
| see [Update the Gradle file](#update-the-gradle-file). | |
| To see how KGP is applied, | |
| see [Update the Gradle file](#update-the-gradle-file). |
| To view the KGP application code, | ||
| see [Update the Gradle file](#update-the-gradle-file). |
There was a problem hiding this comment.
The phrase 'KGP application code' is confusing here, especially for plugin authors, as 'application' typically refers to an Android application rather than the act of applying a plugin. Rephrasing this to 'how KGP is applied' or 'examples of how KGP is applied' would be much clearer.
| To view the KGP application code, | |
| see [Update the Gradle file](#update-the-gradle-file). | |
| To see how KGP is applied, | |
| see [Update the Gradle file](#update-the-gradle-file). |
Added warning against migrating to built-in kotlin if project does not currently use KGP. Also added apps should be on AGP 9+ when validating migration.
Presubmit checklist
of 80 characters or fewer.