From 9f0d358a9657f6d4ebac26ba490af106fde410a9 Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Fri, 30 Aug 2024 11:59:29 +0200 Subject: [PATCH 1/3] Added js and native targets --- gradle.properties | 2 +- mappie-api/build.gradle.kts | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 484c64fb..b742408f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.7.0 \ No newline at end of file +version=0.8.0-SNAPSHOT \ No newline at end of file diff --git a/mappie-api/build.gradle.kts b/mappie-api/build.gradle.kts index c564783b..388c5e18 100644 --- a/mappie-api/build.gradle.kts +++ b/mappie-api/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.dokka) @@ -6,18 +8,28 @@ plugins { kotlin { explicitApi() + withSourcesJar(publish = false) + applyDefaultHierarchyTemplate() + + jvm { + withSourcesJar(publish = true) + } - withSourcesJar() + js { + browser() + binaries.library() + } - jvm() + mingwX64 { binaries { sharedLib { baseName = "libnative" } } } } +val dokkaHtml by tasks.dokkaHtml tasks.register("javadocJar") { group = "build" description = "Assemble a javadoc jar containing the Dokka pages of the 'main' feature." archiveClassifier = "javadoc" - from(layout.buildDirectory.dir("dokka/javadoc")) - dependsOn("dokkaJavadoc") + from(dokkaHtml.outputDirectory) + dependsOn(dokkaHtml) } publishing { From 0d3b1b9830693dee30b696cf90c92d157f49bff6 Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Thu, 5 Sep 2024 11:06:52 +0200 Subject: [PATCH 2/3] Added more targets --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + gradle/libs.versions.toml | 3 ++- mappie-api/build.gradle.kts | 25 +++++++++++++++++++++++-- settings.gradle.kts | 1 + 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7a2e5731 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: workflow_dispatch + +jobs: + release: + name: Release + permissions: + pull-requests: read + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: 'gradle' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Staging + run: ./gradlew publish + + - name: Publish to Maven Central + run: ./gradlew jreleaserFullRelease + + - name: Publish to Gradle Plugin Portal + run: ./gradlew publishPlugins \ No newline at end of file diff --git a/.gitignore b/.gitignore index a3929101..e0dfa607 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ +**/*.hprof #Kotlin .kotlin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7da2fdf1..1dd0ef0f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,4 +16,5 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref gradle-plugin-publish = { id = "com.gradle.plugin-publish", version = "1.2.1" } sonarqube = { id = "org.sonarqube", version = "5.1.0.4882" } jreleaser = { id = "org.jreleaser", version = "1.13.1" } -dokka = { id = "org.jetbrains.dokka", version = "1.9.20" } \ No newline at end of file +dokka = { id = "org.jetbrains.dokka", version = "1.9.20" } +android-library = { id = "com.android.library", version = "8.5.2" } \ No newline at end of file diff --git a/mappie-api/build.gradle.kts b/mappie-api/build.gradle.kts index 388c5e18..16440146 100644 --- a/mappie-api/build.gradle.kts +++ b/mappie-api/build.gradle.kts @@ -1,8 +1,11 @@ +@file:OptIn(ExperimentalWasmDsl::class) + import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.dokka) + alias(libs.plugins.android.library) apply false id("maven-publish") } @@ -15,12 +18,30 @@ kotlin { withSourcesJar(publish = true) } + androidNativeX64() + androidNativeArm64() + + iosArm64() + iosSimulatorArm64() + iosX64() + js { browser() - binaries.library() + nodejs() + } + + wasmJs { + browser() + nodejs() } - mingwX64 { binaries { sharedLib { baseName = "libnative" } } } + mingwX64() + + macosX64() + macosArm64() + + linuxX64() + linuxArm64() } val dokkaHtml by tasks.dokkaHtml diff --git a/settings.gradle.kts b/settings.gradle.kts index 72cef799..5b80a019 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,6 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() + google() } } From ec9889f0af1b1379be4044b37d3f26e649ba0410 Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Thu, 5 Sep 2024 11:10:34 +0200 Subject: [PATCH 3/3] Added tvos targets --- mappie-api/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mappie-api/build.gradle.kts b/mappie-api/build.gradle.kts index 16440146..457f160c 100644 --- a/mappie-api/build.gradle.kts +++ b/mappie-api/build.gradle.kts @@ -25,6 +25,10 @@ kotlin { iosSimulatorArm64() iosX64() + tvosX64() + tvosSimulatorArm64() + tvosArm64() + js { browser() nodejs()