Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Commit a2b5937

Browse files
author
Ben Asher
authored
hmpp + upgrades (#77)
1 parent 1c800aa commit a2b5937

4 files changed

Lines changed: 29 additions & 28 deletions

File tree

build.gradle.kts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget
12
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
23

3-
val coroutinesVersion = "1.3.9"
4-
val atomicfuVersion = "0.14.4"
4+
val coroutinesVersion = "1.4.3"
5+
val atomicfuVersion = "0.15.0"
56

67
plugins {
7-
kotlin("multiplatform") version "1.4.21"
8+
kotlin("multiplatform") version "1.4.32"
89
id("org.jetbrains.dokka") version "0.10.0"
910
id("maven-publish")
1011
id("signing")
@@ -36,19 +37,28 @@ kotlin {
3637
browser()
3738
nodejs()
3839
}
40+
}
3941

40-
val nativeTargets = mutableListOf<KotlinNativeTarget>()
42+
iosX64()
43+
iosArm64()
44+
iosArm32()
45+
macosX64()
46+
mingwX64()
47+
linuxX64()
4148

42-
iosX64 { nativeTargets.add(this) }
43-
iosArm64 { nativeTargets.add(this) }
44-
iosArm32 { nativeTargets.add(this) }
45-
macosX64 { nativeTargets.add(this) }
46-
mingwX64 { nativeTargets.add(this) }
47-
linuxX64 { nativeTargets.add(this) }
49+
targets.withType<KotlinNativeTarget> {
50+
val main by compilations.getting {
51+
kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
52+
}
53+
}
4854

49-
nativeTargets.forEach {
50-
val main by it.compilations.getting {
51-
kotlinOptions.freeCompilerArgs = listOf("-Xuse-experimental=kotlin.Experimental")
55+
// do this in afterEvaluate, when nativeMain compilation becomes available
56+
afterEvaluate {
57+
targets.withType<KotlinMetadataTarget> {
58+
for (compilation in compilations) {
59+
if (compilation.name == "nativeMain") {
60+
compilation.kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
61+
}
5262
}
5363
}
5464
}
@@ -103,7 +113,7 @@ kotlin {
103113
val ktlintConfig by configurations.creating
104114

105115
dependencies {
106-
ktlintConfig("com.pinterest:ktlint:0.40.0")
116+
ktlintConfig("com.pinterest:ktlint:0.41.0")
107117
}
108118

109119
val ktlint by tasks.registering(JavaExec::class) {

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
VERSION=0.6.3
1+
VERSION=0.6.4
2+
3+
kotlin.mpp.enableGranularSourceSetsMetadata=true
4+
kotlin.mpp.enableCompatibilityMetadataVariant=true
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-6.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

publish.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ def getRepositoryPassword() {
4848
return System.getenv('SONATYPE_PASSWORD') ?: ''
4949
}
5050

51-
task emptySourcesJar(type: Jar) {
52-
classifier = 'sources'
53-
}
54-
5551
task javadocsJar(type: Jar, dependsOn: dokka) {
5652
classifier = 'javadoc'
5753
from dokka.outputDirectory
@@ -94,13 +90,6 @@ publishing {
9490
}
9591
}
9692

97-
afterEvaluate {
98-
publications.getByName('kotlinMultiplatform') {
99-
// Source jars are only created for platforms, not the common artifact.
100-
artifact emptySourcesJar
101-
}
102-
}
103-
10493
repositories {
10594
maven {
10695
url isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl()
@@ -127,7 +116,6 @@ tasks.register('publishMac') {
127116
dependsOn 'publishIosX64PublicationToMavenRepository'
128117
dependsOn 'publishMacosX64PublicationToMavenRepository'
129118
dependsOn 'publishJvmPublicationToMavenRepository'
130-
dependsOn 'publishMetadataPublicationToMavenRepository'
131119
dependsOn 'publishKotlinMultiplatformPublicationToMavenRepository'
132120
dependsOn 'publishJsPublicationToMavenRepository'
133121
}

0 commit comments

Comments
 (0)