Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,17 @@ android {
}

mavenPublishing {
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
// The Central Portal is the only host the plugin publishes to now, so the
// SonatypeHost argument this used to take no longer exists.
publishToMavenCentral()
signAllPublications()

// AGP 9 no longer exposes a publishable component implicitly; the plugin
// declares the variant itself when told which one to publish. Called on the
// extension explicitly because a bare configure() in a Groovy build script
// resolves to Project.configure instead.
delegate.configure(new com.vanniktech.maven.publish.AndroidSingleVariantLibrary('release', true, true))

coordinates("com.bugsplat", "bugsplat-android", "1.4.0")

pom {
Expand Down Expand Up @@ -123,15 +131,17 @@ dependencies {
androidTestImplementation libs.androidx.espresso.core
}

afterEvaluate {
android.libraryVariants.all { variant ->
def bundleTask = tasks.named("bundle${variant.name.capitalize()}Aar")
bundleTask.configure {
def aarOutputDir = file("${buildDir}/outputs/aar")
def originalAarName = "app-${variant.name}.aar"
def newAarName = "bugsplat-android-${variant.name}.aar"
def originalFile = file("$aarOutputDir/$originalAarName")
def newFile = file("$aarOutputDir/$newAarName")
// AGP 9 removed android.libraryVariants; onVariants is the replacement, and it
// runs early enough that the afterEvaluate wrapper is no longer needed.
androidComponents {
onVariants(selector().all()) { variant ->
def variantName = variant.name
// AGP 9 only creates a bundle task for variants it can package, so match
// rather than name it directly.
tasks.matching { it.name == "bundle${variantName.capitalize()}Aar" }.configureEach {
def aarOutputDir = layout.buildDirectory.dir("outputs/aar").get().asFile
def originalFile = new File(aarOutputDir, "app-${variantName}.aar")
def newFile = new File(aarOutputDir, "bugsplat-android-${variantName}.aar")

doLast {
if (originalFile.exists()) {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "8.6.1"
agp = "9.4.0"
kotlin = "1.9.0"
coreKtx = "1.15.0"
junit = "4.13.2"
Expand All @@ -9,7 +9,7 @@ mockwebserver = "4.12.0"
appcompat = "1.7.0"
material = "1.10.0"
constraintlayout = "2.2.0"
mavenPublish = "0.30.0"
mavenPublish = "0.37.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 5 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#Thu Mar 06 18:44:32 EST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading