From 5a04b315d5717efd64c4d3dfb332ac002f9e8321 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 31 Oct 2025 17:19:19 -0300 Subject: [PATCH] Upgrade maven publishing plugin --- build.gradle | 6 --- gradle.properties | 5 ++- gradle/libs.versions.toml | 2 +- gradle/verification-metadata.xml | 70 ++++++++++++++++++++++++++++++++ libs/core/build.gradle.kts | 26 +++++++++--- libs/core/gradle.properties | 7 ++++ libs/database/build.gradle.kts | 2 +- libs/database/gradle.properties | 2 +- libs/download/build.gradle.kts | 2 +- libs/download/gradle.properties | 2 +- libs/index/build.gradle.kts | 2 +- libs/index/gradle.properties | 2 +- 12 files changed, 108 insertions(+), 20 deletions(-) create mode 100644 libs/core/gradle.properties diff --git a/build.gradle b/build.gradle index f2e9904ad..8a9f49847 100644 --- a/build.gradle +++ b/build.gradle @@ -21,12 +21,6 @@ allprojects { mavenCentral() maven { url 'https://maven.google.com/' } } - // use new Sonatype server for mavenCentral publishing - plugins.withId("com.vanniktech.maven.publish") { - mavenPublish { - sonatypeHost = "S01" - } - } } subprojects { apply plugin: "org.jlleitschuh.gradle.ktlint" diff --git a/gradle.properties b/gradle.properties index ce02a7cda..e72a4767e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,9 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 # Gradle Maven Publish Info below (https://github.com/vanniktech/gradle-maven-publish-plugin) # These are common for all libraries in gradle submodules. # Specifics for each library are defined in the submodule's gradle.properties file. +mavenCentralPublishing=true +mavenCentralAutomaticPublishing=true +signAllPublications=true GROUP=org.fdroid @@ -22,5 +25,3 @@ POM_SCM_DEV_CONNECTION=scm:git:ssh://git@gitlab.com:fdroid/fdroidclient.git POM_DEVELOPER_ID=grote POM_DEVELOPER_NAME=Torsten Grote POM_DEVELOPER_URL=https://github.com/grote/ - -SONATYPE_AUTOMATIC_RELEASE=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f3075365b..fe1495c65 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ kotlin = "2.2.0" androidGradlePlugin = "8.11.1" # 8.12.0 pulls in aapt2 which has issue on buildserver androidKspPlugin = "2.2.0-2.0.2" # first version needs to match kotlin version dokka = "2.0.0" -mavenPublish = "0.18.0" +mavenPublish = "0.34.0" jlleitschuhKtlint = "13.1.0" kotlinxSerializationJson = "1.9.0" # 1.4.1 because https://github.com/Kotlin/kotlinx.serialization/issues/2231 diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index bf3d468fb..ab9b0450d 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -10167,6 +10167,11 @@ + + + + + @@ -10308,6 +10313,11 @@ + + + + + @@ -10353,6 +10363,11 @@ + + + + + @@ -10378,11 +10393,21 @@ + + + + + + + + + + @@ -10460,12 +10485,22 @@ + + + + + + + + + + @@ -15128,6 +15163,11 @@ + + + + + @@ -15148,6 +15188,11 @@ + + + + + @@ -15294,6 +15339,11 @@ + + + + + @@ -15364,6 +15414,11 @@ + + + + + @@ -15384,6 +15439,11 @@ + + + + + @@ -15404,6 +15464,11 @@ + + + + + @@ -18121,6 +18186,11 @@ + + + + + diff --git a/libs/core/build.gradle.kts b/libs/core/build.gradle.kts index 92f1918c9..055616067 100644 --- a/libs/core/build.gradle.kts +++ b/libs/core/build.gradle.kts @@ -4,10 +4,6 @@ plugins { alias(libs.plugins.jetbrains.dokka) alias(libs.plugins.vanniktech.maven.publish) } -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} kotlin { androidTarget { compilerOptions { @@ -45,6 +41,15 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments["disableAnalytics"] = "true" } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -55,12 +60,23 @@ signing { useGpgCmd() } +mavenPublishing { + @Suppress("ktlint:standard:chain-method-continuation") + configure( + com.vanniktech.maven.publish.KotlinMultiplatform( + javadocJar = com.vanniktech.maven.publish.JavadocJar.Dokka("dokkaHtml"), + sourcesJar = true, + androidVariantsToPublish = listOf("release"), + ), + ) +} + tasks.withType().configureEach { pluginsMapConfiguration.set( mapOf( "org.jetbrains.dokka.base.DokkaBase" to """{ "customAssets": ["${file("${rootProject.rootDir}/logo-icon.svg")}"], - "footerMessage": "© 2010-2025 F-Droid Limited and Contributors", + "footerMessage": "© 2010-2025 F-Droid Limited and Contributors" }""", ), ) diff --git a/libs/core/gradle.properties b/libs/core/gradle.properties new file mode 100644 index 000000000..5f2ad1d2e --- /dev/null +++ b/libs/core/gradle.properties @@ -0,0 +1,7 @@ +POM_ARTIFACT_ID=core +VERSION_NAME=0.0.1 + +POM_NAME=F-Droid core library +POM_DESCRIPTION=A Kotlin multi-platform library to provide core classes. +POM_INCEPTION_YEAR=2025 +POM_URL=https://gitlab.com/fdroid/fdroidclient/-/tree/master/libs/core diff --git a/libs/database/build.gradle.kts b/libs/database/build.gradle.kts index 3d94c7e56..a1b122d4b 100644 --- a/libs/database/build.gradle.kts +++ b/libs/database/build.gradle.kts @@ -128,7 +128,7 @@ tasks.withType().configureEach { mapOf( "org.jetbrains.dokka.base.DokkaBase" to """{ "customAssets": ["${file("${rootProject.rootDir}/logo-icon.svg")}"], - "footerMessage": "© 2010-2025 F-Droid Limited and Contributors", + "footerMessage": "© 2010-2025 F-Droid Limited and Contributors" }""", ), ) diff --git a/libs/database/gradle.properties b/libs/database/gradle.properties index 1863bb57e..bec8bc1a4 100644 --- a/libs/database/gradle.properties +++ b/libs/database/gradle.properties @@ -1,5 +1,5 @@ POM_ARTIFACT_ID=database -VERSION_NAME=0.1.0 +VERSION_NAME=0.2.0 POM_NAME=F-Droid database library POM_DESCRIPTION=An Android library to store F-Droid related info in Room such as repositories, apps and their versions. diff --git a/libs/download/build.gradle.kts b/libs/download/build.gradle.kts index 199983420..8d1e0c0b2 100644 --- a/libs/download/build.gradle.kts +++ b/libs/download/build.gradle.kts @@ -121,7 +121,7 @@ tasks.withType().configureEach { mapOf( "org.jetbrains.dokka.base.DokkaBase" to """{ "customAssets": ["${file("${rootProject.rootDir}/logo-icon.svg")}"], - "footerMessage": "© 2010-2025 F-Droid Limited and Contributors", + "footerMessage": "© 2010-2025 F-Droid Limited and Contributors" }""", ), ) diff --git a/libs/download/gradle.properties b/libs/download/gradle.properties index 9784f28a8..5827ff7fd 100644 --- a/libs/download/gradle.properties +++ b/libs/download/gradle.properties @@ -1,5 +1,5 @@ POM_ARTIFACT_ID=download -VERSION_NAME=0.1.1 +VERSION_NAME=0.2.0 POM_NAME=F-Droid download library POM_DESCRIPTION=A Kotlin multi-platform library to download F-Droid related files via HTTP. diff --git a/libs/index/build.gradle.kts b/libs/index/build.gradle.kts index e7917a4f0..875ebefc7 100644 --- a/libs/index/build.gradle.kts +++ b/libs/index/build.gradle.kts @@ -99,7 +99,7 @@ tasks.withType().configureEach { mapOf( "org.jetbrains.dokka.base.DokkaBase" to """{ "customAssets": ["${file("${rootProject.rootDir}/logo-icon.svg")}"], - "footerMessage": "© 2010-2025 F-Droid Limited and Contributors", + "footerMessage": "© 2010-2025 F-Droid Limited and Contributors" }""", ), ) diff --git a/libs/index/gradle.properties b/libs/index/gradle.properties index 704e98b76..96bdb7818 100644 --- a/libs/index/gradle.properties +++ b/libs/index/gradle.properties @@ -1,5 +1,5 @@ POM_ARTIFACT_ID=index -VERSION_NAME=0.1.1 +VERSION_NAME=0.2.0 POM_NAME=F-Droid index library POM_DESCRIPTION=A Kotlin multi-platform library to parse version 1 and 2 of the F-Droid index format.