Add support for AGP 9#10
Conversation
This adds a convenience compat class that supports backwards compatibility as well as support for LibraryExtension, which will he required with AGP9. Upgrading to AGP 9 will also require extension developers to replace BaseExtension in the `Project.android` declaration with LibraryExtension, and also replace `compileSdkVersion` with `compileSdk` outside of `defaultConfig`, as well as move `targetSdk` to a new lint block, and remove `apply(plugin = "kotlin-android")` since AGP 9 has built-in Kotlin, that is no longer supported. This should have no affecf for those that don't upgrade to AGP 9, or those you don't decide to use LibraryExtension in AGP 8 which is also supported.
|
Note: this also depends on #8 since AGP 9 requires Gradle 9 |
|
Also kinda depends on #9 as it was built on top of that one. So no guarantee it works without that one. |
|
@fire-light42 should default minSdk be changes to 23 to be in line with the app by the way? I am not sure if it should or not here. |
|
I would say remaining on minSdk 21 is good as long as it does not hinder us in any obvious way (dependencies or workarounds). The last people still using old CloudStream versions on old TVs might as well get working plugin updates (ignoring breaking code changes). |
|
Good point yeah. We can keep.21 for now but eventually we will probably have to change to 23 but we can delay as long as possible here also. |
|
When compiling our extensions with this gradle and: fun Project.android(configuration: LibraryExtension.() -> Unit) = extensions.getByName<LibraryExtension>("android")Am I missing something? |
|
Remove |
|
Example: Luna712/Luna712-CloudStream-Extensions#13 (although that PR doesnt build properly due to latest changes not being on jitpack but the code changes should work) |
|
With AGP 9 I am required to use Gradle 9.3.1 and I get this error: |
Make sure import is |
That works! |
|
Thank you very much for reviewing these PRs @fire-light42! |
|
Thank you for the contributions! |
This adds a convenience compat class that supports backwards compatibility as well as support for LibraryExtension, which will he required with AGP9.
Upgrading to AGP 9 will also require extension developers to replace BaseExtension in the
Project.androiddeclaration with LibraryExtension, and also replacecompileSdkVersionwithcompileSdkoutside ofdefaultConfig, as well as movetargetSdkto a new lint block, and removeapply(plugin = "kotlin-android")since AGP 9 has built-in Kotlin, that is no longer supported.This should have no affecf for those that don't upgrade to AGP 9, or those you don't decide to use LibraryExtension in AGP 8 which is also supported.