diff --git a/build.gradle.kts b/build.gradle.kts index b487702..e65ccfe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,11 @@ +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -val coroutinesVersion = "1.3.9" -val atomicfuVersion = "0.14.4" +val coroutinesVersion = "1.4.3" +val atomicfuVersion = "0.15.0" plugins { - kotlin("multiplatform") version "1.4.21" + kotlin("multiplatform") version "1.4.32" id("org.jetbrains.dokka") version "0.10.0" id("maven-publish") id("signing") @@ -36,19 +37,28 @@ kotlin { browser() nodejs() } + } - val nativeTargets = mutableListOf() + iosX64() + iosArm64() + iosArm32() + macosX64() + mingwX64() + linuxX64() - iosX64 { nativeTargets.add(this) } - iosArm64 { nativeTargets.add(this) } - iosArm32 { nativeTargets.add(this) } - macosX64 { nativeTargets.add(this) } - mingwX64 { nativeTargets.add(this) } - linuxX64 { nativeTargets.add(this) } + targets.withType { + val main by compilations.getting { + kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") + } + } - nativeTargets.forEach { - val main by it.compilations.getting { - kotlinOptions.freeCompilerArgs = listOf("-Xuse-experimental=kotlin.Experimental") + // do this in afterEvaluate, when nativeMain compilation becomes available + afterEvaluate { + targets.withType { + for (compilation in compilations) { + if (compilation.name == "nativeMain") { + compilation.kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") + } } } } @@ -103,7 +113,7 @@ kotlin { val ktlintConfig by configurations.creating dependencies { - ktlintConfig("com.pinterest:ktlint:0.40.0") + ktlintConfig("com.pinterest:ktlint:0.41.0") } val ktlint by tasks.registering(JavaExec::class) { diff --git a/gradle.properties b/gradle.properties index 3784d67..de2e291 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,4 @@ -VERSION=0.6.3 +VERSION=0.6.4 + +kotlin.mpp.enableGranularSourceSetsMetadata=true +kotlin.mpp.enableCompatibilityMetadataVariant=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da9702f..442d913 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/publish.gradle b/publish.gradle index f8134e9..7cfc403 100644 --- a/publish.gradle +++ b/publish.gradle @@ -48,10 +48,6 @@ def getRepositoryPassword() { return System.getenv('SONATYPE_PASSWORD') ?: '' } -task emptySourcesJar(type: Jar) { - classifier = 'sources' -} - task javadocsJar(type: Jar, dependsOn: dokka) { classifier = 'javadoc' from dokka.outputDirectory @@ -94,13 +90,6 @@ publishing { } } - afterEvaluate { - publications.getByName('kotlinMultiplatform') { - // Source jars are only created for platforms, not the common artifact. - artifact emptySourcesJar - } - } - repositories { maven { url isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl() @@ -127,7 +116,6 @@ tasks.register('publishMac') { dependsOn 'publishIosX64PublicationToMavenRepository' dependsOn 'publishMacosX64PublicationToMavenRepository' dependsOn 'publishJvmPublicationToMavenRepository' - dependsOn 'publishMetadataPublicationToMavenRepository' dependsOn 'publishKotlinMultiplatformPublicationToMavenRepository' dependsOn 'publishJsPublicationToMavenRepository' }