Skip to content

Commit

Permalink
Merge pull request #25 from nathanfallet/feature/more-native-targets
Browse files Browse the repository at this point in the history
Supporting more native targets
  • Loading branch information
nathanfallet authored Nov 11, 2023
2 parents 23f02a3 + 62fd391 commit 798aec0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
distribution: temurin
java-version: 19
- name: Install dependencies and run tests
run: ./gradlew test koverXmlReport
run: ./gradlew jvmTest koverXmlReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
43 changes: 28 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
plugins {
kotlin("multiplatform") version "1.9.10"
kotlin("multiplatform") version "1.9.20"
id("convention.publication")
id("org.jetbrains.kotlinx.kover") version "0.7.4"
id("com.google.devtools.ksp") version "1.9.10-1.0.13"
id("com.google.devtools.ksp") version "1.9.20-1.0.13"
id("dev.petuska.npm.publish") version "3.4.1"
}

group = "me.nathanfallet.makth"
version = "1.2.2"
version = "1.2.3"

repositories {
mavenCentral()
}

kotlin {
// Tiers are in accordance with <https://kotlinlang.org/docs/native-target-support.html>
// Tier 1
macosX64()
macosArm64()
iosSimulatorArm64()
iosX64()

// Tier 2
linuxX64()
linuxArm64()
watchosSimulatorArm64()
watchosX64()
watchosArm32()
watchosArm64()
tvosSimulatorArm64()
tvosX64()
tvosArm64()
iosArm64()

// Tier 3
mingwX64()
watchosDeviceArm64()

// jvm & js
jvm {
jvmToolchain(19)
withJava()
Expand All @@ -29,19 +53,8 @@ kotlin {
browser()
//generateTypeScriptDefinitions() // Not supported for now because of collections etc...
}
val hostOs = System.getProperty("os.name")
val isArm64 = System.getProperty("os.arch") == "aarch64"
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" && isArm64 -> macosArm64("native")
hostOs == "Mac OS X" && !isArm64 -> macosX64("native")
hostOs == "Linux" && isArm64 -> linuxArm64("native")
hostOs == "Linux" && !isArm64 -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}


applyDefaultHierarchyTemplate()
sourceSets {
all {
languageSettings.apply {
Expand Down
4 changes: 2 additions & 2 deletions docs/getstarted/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add the following to your `pom.xml` file;
<dependency>
<groupId>me.nathanfallet.makth</groupId>
<artifactId>makth-jvm</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</dependency>
```

Expand All @@ -22,7 +22,7 @@ repositories {
}
dependencies {
implementation 'me.nathanfallet.makth:makth:1.2.2'
implementation 'me.nathanfallet.makth:makth:1.2.3'
}
```

Expand Down

0 comments on commit 798aec0

Please sign in to comment.