Upgrade to AGP 9 and enable build and configuration cache#37
Open
Luna712 wants to merge 1 commit intorecloudstream:masterfrom
Open
Upgrade to AGP 9 and enable build and configuration cache#37Luna712 wants to merge 1 commit intorecloudstream:masterfrom
Luna712 wants to merge 1 commit intorecloudstream:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gradle / AGP 9 Migration Notes
I am using this to also document this migration for extension developers, so I am explaining other things that may be needed for them as well. Other than the other potential issues described here, everything else in this should be very similar for most, if not all, other plugin repositories.
Also, you will need to remove
requiresResources = truefrom any subproject's (individual extension's)build.gradle.ktsif they do not actually have any resources, or the build will now fail.GitHub Actions (Configuration Cache)
For configuration cache support in GitHub actions, requires adding a new secret in GitHub settings:
GRADLE_ENCRYPTION_KEYThe value to set it to can be generated with:
Upgrade Gradle (Required for AGP 9)
For simplicity you can upgrade gradle (which is required for AGP 9) using:
But first replace
gradle-wrapper.propertieswith this manually for one time consistency:Java Version Warnings
If you get many warnings such as:
Replace:
with:
Make sure to add import also:
And add this at the end of
gradle.properties:Kotlin Annotation Warnings
If you receive warnings in subprojects such as:
Add this right after
buildscript, aboveallprojectsin rootbuild.gradle.kts:subprojects { tasks.withType<KotlinCompile>().configureEach { compilerOptions { freeCompilerArgs.add("-Xannotation-default-target=param-property") } } }Make sure to add import also: