Make Protobuf Gradle Plugin AGP 9 compatible#797
Make Protobuf Gradle Plugin AGP 9 compatible#797omarismail94 wants to merge 2 commits intogoogle:masterfrom
Conversation
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Show resolved
Hide resolved
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Outdated
Show resolved
Hide resolved
src/main/groovy/com/google/protobuf/gradle/ProtobufAndroidSupport.groovy
Outdated
Show resolved
Hide resolved
|
Hello, wondering if this is merge ready, or we need something to be done? This is the last blocker for us to move to AGP9 fully. Thanks! |
|
@michnovka Im just waiting for someone from the owning team to review the change. The regular reviewer is out of office this week, but will try to find someone else. If I don't, then expect it to be reviewed next week |
ejona86
left a comment
There was a problem hiding this comment.
I've looked over the first commit, and yes some of the versions will need to change (like discussed over email), but it looks pretty good and I think could go in relatively quickly. I still need to look over the test project changes; it seems there's more than codenarc fixes (I understand some parts of what is going on; just didn't have time to look through all of them)
I think we'll want to split out that first commit into a separate PR, and I'll be the main reviewer for it, and that'll make the AGP changes then easier to review.
src/main/groovy/com/google/protobuf/gradle/ProtobufExtension.groovy
Outdated
Show resolved
Hide resolved
fc2cce7 to
9050be5
Compare
16cfe95 to
69a6190
Compare
- Migrate `ProtobufPlugin` to use the `AndroidComponentsExtension` (Variant API) instead of the deprecated `BaseVariant` API. - Replace `registerJavaGeneratingTask` with `variant.sources.java.addGeneratedSourceDirectory` for source registration. - Remove `ProjectExt` and legacy variant iteration logic. - Remove deprecated `AndroidSourceSet` extension in Kotlin.
c34616e to
eebeeda
Compare
|
@omarismail94 Hi, could you please merge this? Tests pass and this is the stopper for us to upgrade AGP |
Establish AGP 7.4 as the minimum supported version and adhere to the new Variant APIs. This ensures forward compatibility with AGP 9.0 while optimizing for the majority of the active ecosystem.
To achieve forward compatibility with AGP 9, the plugin must eliminate all reliance on the "Old Variant API" (BaseVariant, AppExtension, registerJavaGeneratingTask).
ProtobufPluginto use theAndroidComponentsExtension(Variant API) instead of the deprecatedBaseVariantAPI.registerJavaGeneratingTaskwithvariant.sources.java.addGeneratedSourceDirectoryfor source registration.ProjectExtand legacy variant iteration logic.AndroidSourceSetextension in Kotlin.FIXES: Issue #787 , #793
TESTED:
android.newDslto true and the build passed. See here