Skip to content

Commit 1d9ce85

Browse files
authored
Update Maven Publish Plugin (#902)
* Update Maven Publish Plugin This updates the Maven Publish Plugin which should unblock enabling the configuration cache and also help with updating to Gradle 8.x in this repo. The changelog for all the versions is here: https://github.com/vanniktech/gradle-maven-publish-plugin/blob/main/CHANGELOG.md#version-0180-2021-09-13 Note, we cannot update to a higher version until the build itself is build with Gradle 8.x or higher. The api to configure signing was changed in 0.20.0 this is why the gradle property was adjusted. * Use 0.21.0 * Apply plugin in weird place * Apply plugin normally, filter out `.tar` distribution
1 parent 5aef0b4 commit 1d9ce85

File tree

6 files changed

+8
-22
lines changed

6 files changed

+8
-22
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Verify artifact contents
5050
shell: bash
5151
run: |
52-
zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker")
52+
zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker" | grep -v ".tar")
5353
filename=${zipfile/\.zip/}
5454
unzip plugin-build/build/distributions/$filename.zip -d /tmp
5555
find /tmp/$filename | grep "pom-default.xml"

gradle/libs.versions.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ dokka = { id = "org.jetbrains.dokka", version = "1.8.10" }
2121
spotless = { id = "com.diffplug.spotless", version = "7.0.0" }
2222
groovyGradlePlugin = { id = "dev.gradleplugins.groovy-gradle-plugin", version = "1.2" }
2323
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
24-
# do not upgrade `mavenPublish` to 0.18.0, it does not generate the pom-default.xml and module.json under
25-
# build/publications/maven
26-
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.17.0" }
24+
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.27.0" }
2725
androidApplication = { id = "com.android.application", version.ref = "agp" }
2826
androidLibrary = { id = "com.android.library", version.ref = "agp" }
2927
buildConfig = { id = "com.github.gmazzo.buildconfig", version = "4.2.0" }

plugin-build/build.gradle.kts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import com.vanniktech.maven.publish.MavenPublishPluginExtension
32
import io.sentry.android.gradle.internal.ASMifyTask
43
import io.sentry.android.gradle.internal.BootstrapAndroidSdk
54
import java.io.FileInputStream
@@ -14,7 +13,7 @@ plugins {
1413
id("distribution")
1514
alias(libs.plugins.dokka)
1615
id("java-gradle-plugin")
17-
alias(libs.plugins.mavenPublish) apply false
16+
alias(libs.plugins.mavenPublish)
1817
alias(libs.plugins.spotless)
1918
// we need this plugin in order to include .aar dependencies into a pure java project, which the
2019
// gradle plugin is
@@ -226,7 +225,7 @@ distributions {
226225
main {
227226
contents {
228227
from("build${sep}libs")
229-
from("build${sep}publications${sep}maven")
228+
from("build${sep}publications${sep}pluginMaven")
230229
}
231230
}
232231
create("sentryPluginMarker") {
@@ -240,14 +239,6 @@ distributions {
240239
}
241240
}
242241

243-
apply { plugin("com.vanniktech.maven.publish") }
244-
245-
val publish = extensions.getByType(MavenPublishPluginExtension::class.java)
246-
247-
// signing is done when uploading files to MC
248-
// via gpg:sign-and-deploy-file (release.kts)
249-
publish.releaseSigningEnabled = false
250-
251242
tasks.named("distZip") {
252243
dependsOn("publishToMavenLocal")
253244
onlyIf { inputs.sourceFiles.isEmpty.not().also { require(it) { "No distribution to zip." } } }

plugin-build/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ POM_LICENCE_URL=https://github.com/getsentry/sentry-android-gradle-plugin/blob/m
2525
POM_DEVELOPER_ID=getsentry
2626
POM_DEVELOPER_NAME=Sentry Team and Contributors
2727
POM_DEVELOPER_URL=https://github.com/getsentry/
28+
29+
RELEASE_SIGNING_ENABLED=false

sentry-kotlin-compiler-plugin/build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ distributions {
3434
}
3535
}
3636

37-
val publish =
38-
extensions.getByType(com.vanniktech.maven.publish.MavenPublishPluginExtension::class.java)
39-
40-
// signing is done when uploading files to MC
41-
// via gpg:sign-and-deploy-file (release.kts)
42-
publish.releaseSigningEnabled = false
43-
4437
tasks.named("distZip") {
4538
dependsOn("publishToMavenLocal")
4639
onlyIf { inputs.sourceFiles.isEmpty.not().also { require(it) { "No distribution to zip." } } }

sentry-kotlin-compiler-plugin/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ POM_LICENCE_URL=https://github.com/getsentry/sentry-android-gradle-plugin/blob/m
1616
POM_DEVELOPER_ID=getsentry
1717
POM_DEVELOPER_NAME=Sentry Team and Contributors
1818
POM_DEVELOPER_URL=https://github.com/getsentry/
19+
20+
RELEASE_SIGNING_ENABLED=false

0 commit comments

Comments
 (0)