diff --git a/build.gradle.kts b/build.gradle.kts index e1bfa0e..4e46bcd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,8 @@ import org.apache.http.entity.ContentType import org.apache.http.entity.StringEntity import org.apache.http.impl.auth.BasicScheme import org.apache.http.auth.UsernamePasswordCredentials +import org.gradle.internal.os.OperatingSystem +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { kotlin("multiplatform") version "1.4.0" @@ -13,47 +15,38 @@ plugins { buildscript { repositories { google() - maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter() } dependencies { - classpath("com.android.tools.build:gradle:4.0.0") + classpath("com.android.tools.build:gradle:4.0.1") } } allprojects { group = "fr.acinq.secp256k1" - version = "0.3.0-1.4" + version = "0.3.0" repositories { jcenter() google() - maven(url = "https://dl.bintray.com/kotlin/kotlin-eap") } } -val currentOs = org.gradle.internal.os.OperatingSystem.current() +val currentOs = OperatingSystem.current() kotlin { explicitApi() - val commonMain by sourceSets.getting { - dependencies { - implementation(kotlin("stdlib-common")) - } - } + val commonMain by sourceSets.getting jvm { compilations.all { kotlinOptions.jvmTarget = "1.8" } - compilations["main"].dependencies { - implementation(kotlin("stdlib-jdk8")) - } } - fun org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget.secp256k1CInterop(target: String) { + fun KotlinNativeTarget.secp256k1CInterop(target: String) { compilations["main"].cinterops { val libsecp256k1 by creating { includeDirs.headerFilterOnly(project.file("native/secp256k1/include/")) @@ -66,16 +59,17 @@ kotlin { linuxX64("linux") { secp256k1CInterop("host") + compilations["main"].defaultSourceSet.dependsOn(nativeMain) // https://youtrack.jetbrains.com/issue/KT-39396 compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/linux/libsecp256k1.a") - compilations["main"].defaultSourceSet.dependsOn(nativeMain) } ios { secp256k1CInterop("ios") // https://youtrack.jetbrains.com/issue/KT-39396 - compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/ios/libsecp256k1.a") compilations["main"].defaultSourceSet.dependsOn(nativeMain) + // https://youtrack.jetbrains.com/issue/KT-39396 + compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/ios/libsecp256k1.a") } sourceSets.all { @@ -88,13 +82,13 @@ kotlin { allprojects { plugins.withId("org.jetbrains.kotlin.multiplatform") { afterEvaluate { - val currentOs = org.gradle.internal.os.OperatingSystem.current() + val currentOs = OperatingSystem.current() val targets = when { currentOs.isLinux -> listOf() currentOs.isMacOsX -> listOf("linux") currentOs.isWindows -> listOf("linux") else -> listOf("linux") - }.mapNotNull { kotlin.targets.findByName(it) as? org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget } + }.mapNotNull { kotlin.targets.findByName(it) as? KotlinNativeTarget } configure(targets) { compilations.all { @@ -189,12 +183,14 @@ if (hasBintray) { } } -afterEvaluate { - tasks.withType() { - testLogging { - events("passed", "skipped", "failed", "standard_out", "standard_error") - showExceptions = true - showStackTraces = true +allprojects { + afterEvaluate { + tasks.withType() { + testLogging { + events("passed", "skipped", "failed", "standard_out", "standard_error") + showExceptions = true + showStackTraces = true + } } } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 186b715..ac33e99 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.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jni/android/build.gradle.kts b/jni/android/build.gradle.kts index e46fffe..b19f995 100644 --- a/jni/android/build.gradle.kts +++ b/jni/android/build.gradle.kts @@ -10,7 +10,6 @@ kotlin { dependencies { api(project(":jni")) - implementation(kotlin("stdlib-jdk8")) } android { @@ -48,18 +47,12 @@ afterEvaluate { } } -android { - afterEvaluate { - publishing { - publications { - create("android") { - artifactId = "secp256k1-jni-android" - from(components["release"]) - } -// create("androidDebug") { -// artifactId = "secp256k1-jni-android-debug" -// from(components["debug"]) -// } +afterEvaluate { + publishing { + publications { + create("android") { + artifactId = "secp256k1-jni-android" + from(components["release"]) } } } diff --git a/jni/build.gradle.kts b/jni/build.gradle.kts index 61fbe5e..62608e3 100644 --- a/jni/build.gradle.kts +++ b/jni/build.gradle.kts @@ -14,7 +14,6 @@ kotlin { dependencies { api(rootProject) - implementation(kotlin("stdlib-jdk8")) } val generateHeaders by tasks.creating(JavaCompile::class) { diff --git a/jni/jvm/all/build.gradle.kts b/jni/jvm/all/build.gradle.kts index 8aeb8a5..ea6e6ac 100644 --- a/jni/jvm/all/build.gradle.kts +++ b/jni/jvm/all/build.gradle.kts @@ -1,7 +1,6 @@ plugins { `java-library` -// `maven-publish` - id("ru.vyarus.pom") version "2.1.0" + `maven-publish` } dependencies { diff --git a/jni/jvm/build.gradle.kts b/jni/jvm/build.gradle.kts index 0379156..06efe68 100644 --- a/jni/jvm/build.gradle.kts +++ b/jni/jvm/build.gradle.kts @@ -28,7 +28,6 @@ val buildNativeHost by tasks.creating(Exec::class) { dependencies { api(project(":jni")) - implementation(kotlin("stdlib-jdk8")) } publishing { diff --git a/native/build.gradle.kts b/native/build.gradle.kts index 63e8ac4..d7880b6 100644 --- a/native/build.gradle.kts +++ b/native/build.gradle.kts @@ -1,6 +1,8 @@ +import org.gradle.internal.os.OperatingSystem + evaluationDependsOn(":jni:android") -val currentOs = org.gradle.internal.os.OperatingSystem.current() +val currentOs = OperatingSystem.current() val bash = if (currentOs.isWindows) "bash.exe" else "bash" val buildSecp256k1 by tasks.creating { group = "build" } @@ -13,7 +15,7 @@ val buildSecp256k1Host by tasks.creating(Exec::class) { currentOs.isLinux -> "linux" currentOs.isMacOsX -> "darwin" currentOs.isWindows -> "mingw" - else -> error("UnsupportedmOS $currentOs") + else -> error("Unsupported OS $currentOs") } inputs.files(projectDir.resolve("build.sh")) diff --git a/settings.gradle.kts b/settings.gradle.kts index f814864..2fdd2fb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,6 @@ pluginManagement { repositories { google() - maven("https://dl.bintray.com/kotlin/kotlin-eap") gradlePluginPortal() jcenter() } diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index 89c506a..585c8f9 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -8,7 +8,6 @@ kotlin { val commonMain by sourceSets.getting { dependencies { - implementation(kotlin("stdlib-common")) implementation(rootProject) } } @@ -23,7 +22,6 @@ kotlin { kotlinOptions.jvmTarget = "1.8" } compilations["main"].dependencies { - implementation(kotlin("stdlib-jdk8")) implementation(project(":jni:jvm:all")) } compilations["test"].dependencies { @@ -36,7 +34,6 @@ kotlin { kotlinOptions.jvmTarget = "1.8" } sourceSets["androidMain"].dependencies { - implementation(kotlin("stdlib-jdk8")) implementation(project(":jni:android")) } sourceSets["androidTest"].dependencies {