-
Notifications
You must be signed in to change notification settings - Fork 217
Modify AGP 9 upgrade skill #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||
| --- | ||||||||||||||
| name: agp-9-upgrade | ||||||||||||||
| description: Upgrades, or migrates, an Android project to use Android Gradle Plugin | ||||||||||||||
| (AGP) version 9 | ||||||||||||||
| (AGP) version 9. Do not use this skill for migrating Kotlin Multiplatform (KMP) projects. | ||||||||||||||
| license: Complete terms in LICENSE.txt | ||||||||||||||
| metadata: | ||||||||||||||
| author: Google LLC | ||||||||||||||
|
|
@@ -23,41 +23,54 @@ breaking, in AGP 9 compared to AGP 8. | |||||||||||||
|
|
||||||||||||||
| If the user requests to update or migrate to AGP 9, first check the AGP version | ||||||||||||||
| used in the project. If it is lower than 9, stop and ask the user to run the AGP | ||||||||||||||
| Upgrade Assistant in Android Studio, and confirm when done. | ||||||||||||||
| Upgrade Assistant in Android Studio to update to the latest stable version of | ||||||||||||||
| AGP, and confirm when done. The user may also request that this requirement be | ||||||||||||||
| skipped; if this is the case, you should update the version of AGP to the latest | ||||||||||||||
| stable version as part of the AGP 9 migration. See the | ||||||||||||||
| [AGP 9 migration guide](references/android/build/releases/agp-9-0-0-release-notes.md) | ||||||||||||||
| for how to do this. | ||||||||||||||
|
|
||||||||||||||
| Each version of AGP has its own set of compatibilities with other tools, such as | ||||||||||||||
| Gradle, JDK, and Kotlin. The release notes for each of these versions will | ||||||||||||||
| include a **Compatibility** table indicating the minimum versions for these | ||||||||||||||
| tools. | ||||||||||||||
|
|
||||||||||||||
| Do not use this skill for KMP projects, as they are unsupported. | ||||||||||||||
|
|
||||||||||||||
| ## Steps | ||||||||||||||
|
|
||||||||||||||
| If AGP is already at 9 or higher, then do the following: | ||||||||||||||
|
|
||||||||||||||
| ### Step 1: Migrate to built-in Kotlin. | ||||||||||||||
| ### Step 1: Update dependencies | ||||||||||||||
|
|
||||||||||||||
| If KSP (`com.google.devtools.ksp`) is used in the project, ensure it is on | ||||||||||||||
| version 2.3.6 or higher. | ||||||||||||||
|
|
||||||||||||||
| If Hilt is used in the project, ensure it is on version 2.59.2 or higher. | ||||||||||||||
|
|
||||||||||||||
| ### Step 2: Migrate to built-in Kotlin. | ||||||||||||||
|
|
||||||||||||||
| See [the guide](references/android/build/migrate-to-built-in-kotlin.md) for detailed information. | ||||||||||||||
|
|
||||||||||||||
| ### Step 2. Migrate to the new AGP DSL. | ||||||||||||||
| ### Step 3. Migrate to the new AGP DSL. | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
|
|
||||||||||||||
| See [the guide](references/android/build/releases/agp-9-0-0-release-notes.md) for detailed information. | ||||||||||||||
|
|
||||||||||||||
| See also [gradle-recipes](references/recipes.md) for examples on how to migrate old code to code | ||||||||||||||
| that is compatible with AGP 9 and the new DSL. | ||||||||||||||
|
|
||||||||||||||
| ### Step 3. Migrate kapt to KSP or legacy-kapt | ||||||||||||||
|
|
||||||||||||||
| If KSP (`com.google.devtools.ksp`) is used in the project, ensure it is on | ||||||||||||||
| version 2.3.6 or higher. | ||||||||||||||
| ### Step 4. Migrate kapt to KSP or legacy-kapt | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
|
|
||||||||||||||
| See [KSP, kapt, and legacy-kapt](references/ksp-kapt.md) for detailed information. | ||||||||||||||
| If KSP (`com.google.devtools.ksp`) or kapt (`org.jetbrains.kotlin.kapt`) are | ||||||||||||||
| used in the project, [KSP, kapt, and legacy-kapt](references/ksp-kapt.md) | ||||||||||||||
| for detailed migration steps. | ||||||||||||||
|
Comment on lines
+64
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence is grammatically incomplete and uses 'are' with a singular 'or' construction. It should include a verb like 'see' and use 'is' for grammatical correctness.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix |
||||||||||||||
|
|
||||||||||||||
| ### Step 4. BuildConfig | ||||||||||||||
| ### Step 5. BuildConfig | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
|
|
||||||||||||||
| If any Android module contains custom BuildConfig fields, see [BuildConfig](references/buildconfig.md) | ||||||||||||||
| for detailed information. | ||||||||||||||
|
|
||||||||||||||
| ### Step 5. Update gradle.properties | ||||||||||||||
| ### Step 6. Update gradle.properties | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
|
|
||||||||||||||
| After the migration, check gradle.properties. Remove the following flags: | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with Step 1, consider removing the trailing period from the header.