Skip to content

Commit

Permalink
#88 Added multiplatform targets (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoppier authored Sep 22, 2024
1 parent 986c99c commit 429aaa3
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
**/*.hprof

#Kotlin
.kotlin
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref
gradle-plugin-publish = { id = "com.gradle.plugin-publish", version = "1.3.0" }
sonarqube = { id = "org.sonarqube", version = "5.1.0.4882" }
jreleaser = { id = "org.jreleaser", version = "1.14.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
dokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
android-library = { id = "com.android.library", version = "8.5.2" }
45 changes: 41 additions & 4 deletions mappie-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,60 @@
@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")
}

kotlin {
explicitApi()
withSourcesJar(publish = false)
applyDefaultHierarchyTemplate()

jvm {
withSourcesJar(publish = true)
}

androidNativeX64()
androidNativeArm64()

iosArm64()
iosSimulatorArm64()
iosX64()

tvosX64()
tvosSimulatorArm64()
tvosArm64()

js {
browser()
nodejs()
}

wasmJs {
browser()
nodejs()
}

mingwX64()

withSourcesJar()
macosX64()
macosArm64()

jvm()
linuxX64()
linuxArm64()
}

val dokkaHtml by tasks.dokkaHtml
tasks.register<Jar>("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 {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
google()
}
}

Expand Down

0 comments on commit 429aaa3

Please sign in to comment.