Skip to content

Commit 8eee5d1

Browse files
runningcodeclaude
andauthored
build: Replace deprecated AGP BaseExtension in JdkTargetConvention (#6406)
BaseExtension is deprecated in AGP 9 and removed in AGP 10, and it is not the registered android extension once android.newDsl=true. The DSL LibraryExtension exposes the same compileOptions and aarMetadata blocks and works with both DSL modes. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2b4127d commit 8eee5d1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎build-logic/src/main/kotlin/io/sentry/gradle/JdkTargetConvention.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package io.sentry.gradle
22

33
import com.android.build.api.artifact.SingleArtifact
4+
import com.android.build.api.dsl.LibraryExtension
45
import com.android.build.api.variant.LibraryAndroidComponentsExtension
5-
import com.android.build.gradle.BaseExtension
66
import org.gradle.api.JavaVersion
77
import org.gradle.api.Plugin
88
import org.gradle.api.Project
@@ -87,7 +87,7 @@ class JdkTargetConvention : Plugin<Project> {
8787
}
8888

8989
project.plugins.withId("com.android.library") {
90-
val android = project.extensions.getByType(BaseExtension::class.java)
90+
val android = project.extensions.getByType(LibraryExtension::class.java)
9191
android.compileOptions {
9292
sourceCompatibility = PUBLISHED_JAVA_VERSION
9393
targetCompatibility = PUBLISHED_JAVA_VERSION

0 commit comments

Comments
 (0)