From b70e75739bf6c0c1543087d9cb784f712d9d331f Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Tue, 20 Aug 2024 15:36:22 +0200 Subject: [PATCH 1/2] fix: Maven publish for Android --- .../kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt b/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt index 10bf0870..9ce53b6e 100644 --- a/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt +++ b/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt @@ -24,6 +24,7 @@ import org.gradle.api.Project import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.get class PublishPlugin : Plugin { @@ -37,12 +38,14 @@ class PublishPlugin : Plugin { target.version = Versions.mavenVersionName target.afterEvaluate { - val mavenName = extension.mavenName ?: target.name.lowercase() + val mavenName = extension.mavenName ?: target.name target.extensions.configure { publications { create("android") { from(components.findByName("release")) + artifact(tasks.getByName("bundleReleaseAar")) + artifact(artifact(tasks["sourcesJar"])) groupId = "com.github.infomaniak.multiplatform_swisstransfer" artifactId = mavenName version = Versions.mavenVersionName From 77f517ead3ec019d938d0b99f4fe10a6c49afc44 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Thu, 22 Aug 2024 16:35:21 +0200 Subject: [PATCH 2/2] Add maven pom info --- .../gradle/plugins/PublishPlugin.kt | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt b/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt index 9ce53b6e..bd53c80e 100644 --- a/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt +++ b/buildTools/gradle/src/main/kotlin/com/infomaniak/gradle/plugins/PublishPlugin.kt @@ -24,7 +24,7 @@ import org.gradle.api.Project import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.withType class PublishPlugin : Plugin { @@ -42,13 +42,37 @@ class PublishPlugin : Plugin { target.extensions.configure { publications { - create("android") { - from(components.findByName("release")) - artifact(tasks.getByName("bundleReleaseAar")) - artifact(artifact(tasks["sourcesJar"])) - groupId = "com.github.infomaniak.multiplatform_swisstransfer" - artifactId = mavenName - version = Versions.mavenVersionName + withType { + pom { + name.set(mavenName) + description.set("Multiplatform SwissTransfer - $mavenName") + licenses { + license { + name.set("GPL-3.0") + url.set("https://www.gnu.org/licenses/gpl-3.0.fr.html") + } + } + url.set("https://github.com/Infomaniak/multiplatform-SwissTransfer") + issueManagement { + system.set("Github") + url.set("https://github.com/Infomaniak/multiplatform-SwissTransfer/issues") + } + scm { + connection.set("https://github.com/Infomaniak/multiplatform-SwissTransfer.git") + url.set("https://github.com/Infomaniak/multiplatform-SwissTransfer") + } + organization { + name.set("Infomaniak Network SA") + url.set("https://www.infomaniak.com/") + } + developers { + developer { + id.set("infomaniak") + name.set("Infomaniak Development Team") + url.set("https://www.infomaniak.com/") + } + } + } } } }