Skip to content

Commit 26f9a6f

Browse files
authored
Add native targets (#23)
* update .gitignore with gradle template * update to kotlin 1.6.21, bignum 0.3.4 and gradle 7.4.2 * use new memory model * add native targets requires pr: komputing/KHex#14 * kotlin 1.8.21 update dependencies * remove depreciated native targets, add linuxArm64 * fix depreciated warnings * gradle 8.1.1
1 parent 67d0038 commit 26f9a6f

File tree

9 files changed

+1246
-211
lines changed

9 files changed

+1246
-211
lines changed

.gitignore

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
build
22
out
33
.idea
4-
local.properties
4+
local.properties
5+
6+
### Gradle template
7+
.gradle
8+
**/build/
9+
!src/**/build/
10+
11+
# Ignore Gradle GUI config
12+
gradle-app.setting
13+
14+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
15+
!gradle/wrapper/gradle-wrapper.jar
16+
17+
# Cache of project
18+
.gradletasknamecache
19+
20+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
21+
# gradle/wrapper/gradle-wrapper.properties
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object Versions {
2-
const val khex = "1.1.2"
3-
const val bignum = "0.3.1"
2+
const val khex = "1.1.5"
3+
const val bignum = "0.3.8"
44
}

buildSrc/src/main/kotlin/mpp-module.gradle.kts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,25 @@ plugins {
88
id("maven-publish")
99
}
1010

11+
val darwinTargets = arrayOf(
12+
"macosX64", "macosArm64",
13+
"iosArm64", "iosX64", "iosSimulatorArm64",
14+
"tvosArm64", "tvosX64", "tvosSimulatorArm64",
15+
"watchosArm32", "watchosArm64", "watchosX64", "watchosSimulatorArm64",
16+
)
17+
val linuxTargets = arrayOf("linuxX64", "linuxArm64")
18+
val mingwTargets = arrayOf("mingwX64")
19+
val nativeTargets = linuxTargets + darwinTargets + mingwTargets
20+
1121
kotlin {
1222
explicitApi()
1323
targets {
1424
jvm {
1525
compilations.all {
16-
kotlinOptions.jvmTarget = "1.8"
26+
kotlinOptions.jvmTarget = "11"
1727
}
1828
}
19-
js(BOTH) {
29+
js(IR) {
2030
compilations {
2131
this.forEach { compilation ->
2232
compilation.compileKotlinTask.kotlinOptions.apply {
@@ -37,6 +47,9 @@ kotlin {
3747
}
3848
}
3949
}
50+
for (target in nativeTargets) {
51+
targets.add(presets.getByName(target).createTarget(target))
52+
}
4053
}
4154
sourceSets {
4255
commonTest {
@@ -83,7 +96,7 @@ tasks {
8396
* **/
8497
tasks.named("dependencyUpdates", DependencyUpdatesTask::class).configure {
8598
fun isNonStable(version: String): Boolean {
86-
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
99+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
87100
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
88101
val isStable = stableKeyword || regex.matches(version)
89102
return isStable.not()
@@ -96,7 +109,7 @@ tasks.named("dependencyUpdates", DependencyUpdatesTask::class).configure {
96109
}
97110

98111
System.getenv("GITHUB_REPOSITORY")?.let { githubRepo ->
99-
val (owner, repoName) = githubRepo.split('/').map(String::toLowerCase)
112+
val (owner, repoName) = githubRepo.split('/').map(String::lowercase)
100113
group = "com.github.$owner.$repoName"
101114
version = System.getProperty("version")
102115
publishing {

gradle.properties

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,12 @@ org.gradle.vfs.watch=true
1212

1313
kotlin.code.style=official
1414
kotlin.incremental=true
15-
kotlin.mpp.enableGranularSourceSetsMetadata=true
1615
kotlin.mpp.stability.nowarn=true
17-
kotlin.native.enableDependencyPropagation=false
18-
19-
## Kapt Build Settings
20-
21-
kapt.include.compile.classpath=false
22-
kapt.incremental.apt=true
23-
kapt.use.worker.api=true
2416

2517
## Kotlin Gradle Plugin
2618

27-
kgp=1.5.10
19+
kgp=1.8.21
2820

2921
## Gradle Plugins
3022

31-
plugin.com.github.ben-manes.versions=0.38.0
23+
plugin.com.github.ben-manes.versions=0.46.0

gradle/wrapper/gradle-wrapper.jar

618 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)