Skip to content

Commit

Permalink
fix: Maven publish for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Aug 20, 2024
1 parent f86eccf commit b70e757
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {

Expand All @@ -37,12 +38,14 @@ class PublishPlugin : Plugin<Project> {
target.version = Versions.mavenVersionName

target.afterEvaluate {
val mavenName = extension.mavenName ?: target.name.lowercase()
val mavenName = extension.mavenName ?: target.name

target.extensions.configure<org.gradle.api.publish.PublishingExtension> {
publications {
create<MavenPublication>("android") {
from(components.findByName("release"))
artifact(tasks.getByName("bundleReleaseAar"))
artifact(artifact(tasks["sourcesJar"]))
groupId = "com.github.infomaniak.multiplatform_swisstransfer"
artifactId = mavenName
version = Versions.mavenVersionName
Expand Down

0 comments on commit b70e757

Please sign in to comment.