Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting more native targets #25

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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