From 5d3380bfe7eff2baca23a0b5dd4f06a597bd3ae7 Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Sun, 24 Mar 2024 06:16:41 +0900 Subject: [PATCH] Attempt at fixing publish config --- android/MapLibreUI/build.gradle | 21 ++++++++++++++------- android/build.gradle | 24 ++++++++++++------------ android/compose-ui/build.gradle | 20 ++++++++++++++++++++ android/core/build.gradle | 24 +++++++++++++++++++++--- 4 files changed, 67 insertions(+), 22 deletions(-) diff --git a/android/MapLibreUI/build.gradle b/android/MapLibreUI/build.gradle index 4cc01700..95249f17 100644 --- a/android/MapLibreUI/build.gradle +++ b/android/MapLibreUI/build.gradle @@ -34,6 +34,12 @@ android { composeOptions { kotlinCompilerExtensionVersion '1.3.2' } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { @@ -65,14 +71,15 @@ dependencies { debugImplementation 'androidx.compose.ui:ui-test-manifest' } -afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - from components.release +publishing { + publications { + "${project.name}-release"(MavenPublication) { + groupId = 'com.stadiamaps' + artifactId = 'ferrostar-maplibreui' + version = project.version - groupId = 'com.stadiamaps' - artifactId = 'ferrostar-maplibreui' + afterEvaluate { + from components.release } } } diff --git a/android/build.gradle b/android/build.gradle index dee379d2..8fc7b549 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,19 +8,19 @@ plugins { id 'maven-publish' } -subprojects { - version = "0.0.1" - - publishing { - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/stadiamaps/ferrostar") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } +publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/stadiamaps/ferrostar") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") } } } } + +allprojects { + version = "0.0.1" +} diff --git a/android/compose-ui/build.gradle b/android/compose-ui/build.gradle index fea8d6de..2507f1a3 100644 --- a/android/compose-ui/build.gradle +++ b/android/compose-ui/build.gradle @@ -34,6 +34,12 @@ android { composeOptions { kotlinCompilerExtensionVersion '1.3.2' } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { @@ -57,4 +63,18 @@ dependencies { debugImplementation 'androidx.compose.ui:ui-tooling' debugImplementation 'androidx.compose.ui:ui-test-manifest' +} + +publishing { + publications { + "${project.name}-release"(MavenPublication) { + groupId = 'com.stadiamaps' + artifactId = 'ferrostar-composeui' + version = project.version + + afterEvaluate { + from components.release + } + } + } } \ No newline at end of file diff --git a/android/core/build.gradle b/android/core/build.gradle index 1a81fd6c..10b210c5 100644 --- a/android/core/build.gradle +++ b/android/core/build.gradle @@ -5,8 +5,6 @@ plugins { id 'com.ncorti.ktfmt.gradle' } -// TODO: Publishing? - android { namespace 'com.stadiamaps.ferrostar.core' compileSdk 34 @@ -33,6 +31,12 @@ android { kotlinOptions { jvmTarget = '1.8' } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { @@ -91,4 +95,18 @@ android.libraryVariants.all { variant -> // idea.module.generatedSourceDirs += file("${buildDir}/generated/source/uniffi/${variant.name}/java/uniffi") sourceSet.java.srcDir 'src/main/java' -} \ No newline at end of file +} + +publishing { + publications { + "${project.name}-release"(MavenPublication) { + groupId = 'com.stadiamaps' + artifactId = 'ferrostar-core' + version = project.version + + afterEvaluate { + from components.release + } + } + } +}