Kotlin 1.4.0 (#11)

Co-authored-by: Salomon BRYS <salomon@kodein.net>
This commit is contained in:
Salomon BRYS 2020-08-18 10:52:42 +02:00 committed by GitHub
parent 7a33c81c01
commit d702925e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 48 deletions

View File

@ -4,6 +4,8 @@ import org.apache.http.entity.ContentType
import org.apache.http.entity.StringEntity import org.apache.http.entity.StringEntity
import org.apache.http.impl.auth.BasicScheme import org.apache.http.impl.auth.BasicScheme
import org.apache.http.auth.UsernamePasswordCredentials import org.apache.http.auth.UsernamePasswordCredentials
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins { plugins {
kotlin("multiplatform") version "1.4.0" kotlin("multiplatform") version "1.4.0"
@ -13,47 +15,38 @@ plugins {
buildscript { buildscript {
repositories { repositories {
google() google()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
jcenter() jcenter()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:4.0.0") classpath("com.android.tools.build:gradle:4.0.1")
} }
} }
allprojects { allprojects {
group = "fr.acinq.secp256k1" group = "fr.acinq.secp256k1"
version = "0.3.0-1.4" version = "0.3.0"
repositories { repositories {
jcenter() jcenter()
google() google()
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
} }
} }
val currentOs = org.gradle.internal.os.OperatingSystem.current() val currentOs = OperatingSystem.current()
kotlin { kotlin {
explicitApi() explicitApi()
val commonMain by sourceSets.getting { val commonMain by sourceSets.getting
dependencies {
implementation(kotlin("stdlib-common"))
}
}
jvm { jvm {
compilations.all { compilations.all {
kotlinOptions.jvmTarget = "1.8" 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 { compilations["main"].cinterops {
val libsecp256k1 by creating { val libsecp256k1 by creating {
includeDirs.headerFilterOnly(project.file("native/secp256k1/include/")) includeDirs.headerFilterOnly(project.file("native/secp256k1/include/"))
@ -66,16 +59,17 @@ kotlin {
linuxX64("linux") { linuxX64("linux") {
secp256k1CInterop("host") secp256k1CInterop("host")
compilations["main"].defaultSourceSet.dependsOn(nativeMain)
// https://youtrack.jetbrains.com/issue/KT-39396 // https://youtrack.jetbrains.com/issue/KT-39396
compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/linux/libsecp256k1.a") compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/linux/libsecp256k1.a")
compilations["main"].defaultSourceSet.dependsOn(nativeMain)
} }
ios { ios {
secp256k1CInterop("ios") secp256k1CInterop("ios")
// https://youtrack.jetbrains.com/issue/KT-39396 // 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) 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 { sourceSets.all {
@ -88,13 +82,13 @@ kotlin {
allprojects { allprojects {
plugins.withId("org.jetbrains.kotlin.multiplatform") { plugins.withId("org.jetbrains.kotlin.multiplatform") {
afterEvaluate { afterEvaluate {
val currentOs = org.gradle.internal.os.OperatingSystem.current() val currentOs = OperatingSystem.current()
val targets = when { val targets = when {
currentOs.isLinux -> listOf() currentOs.isLinux -> listOf()
currentOs.isMacOsX -> listOf("linux") currentOs.isMacOsX -> listOf("linux")
currentOs.isWindows -> listOf("linux") currentOs.isWindows -> listOf("linux")
else -> 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) { configure(targets) {
compilations.all { compilations.all {
@ -189,12 +183,14 @@ if (hasBintray) {
} }
} }
afterEvaluate { allprojects {
tasks.withType<AbstractTestTask>() { afterEvaluate {
testLogging { tasks.withType<AbstractTestTask>() {
events("passed", "skipped", "failed", "standard_out", "standard_error") testLogging {
showExceptions = true events("passed", "skipped", "failed", "standard_out", "standard_error")
showStackTraces = true showExceptions = true
showStackTraces = true
}
} }
} }
} }

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -10,7 +10,6 @@ kotlin {
dependencies { dependencies {
api(project(":jni")) api(project(":jni"))
implementation(kotlin("stdlib-jdk8"))
} }
android { android {
@ -48,18 +47,12 @@ afterEvaluate {
} }
} }
android { afterEvaluate {
afterEvaluate { publishing {
publishing { publications {
publications { create<MavenPublication>("android") {
create<MavenPublication>("android") { artifactId = "secp256k1-jni-android"
artifactId = "secp256k1-jni-android" from(components["release"])
from(components["release"])
}
// create<MavenPublication>("androidDebug") {
// artifactId = "secp256k1-jni-android-debug"
// from(components["debug"])
// }
} }
} }
} }

View File

@ -14,7 +14,6 @@ kotlin {
dependencies { dependencies {
api(rootProject) api(rootProject)
implementation(kotlin("stdlib-jdk8"))
} }
val generateHeaders by tasks.creating(JavaCompile::class) { val generateHeaders by tasks.creating(JavaCompile::class) {

View File

@ -1,7 +1,6 @@
plugins { plugins {
`java-library` `java-library`
// `maven-publish` `maven-publish`
id("ru.vyarus.pom") version "2.1.0"
} }
dependencies { dependencies {

View File

@ -28,7 +28,6 @@ val buildNativeHost by tasks.creating(Exec::class) {
dependencies { dependencies {
api(project(":jni")) api(project(":jni"))
implementation(kotlin("stdlib-jdk8"))
} }
publishing { publishing {

View File

@ -1,6 +1,8 @@
import org.gradle.internal.os.OperatingSystem
evaluationDependsOn(":jni:android") 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 bash = if (currentOs.isWindows) "bash.exe" else "bash"
val buildSecp256k1 by tasks.creating { group = "build" } val buildSecp256k1 by tasks.creating { group = "build" }
@ -13,7 +15,7 @@ val buildSecp256k1Host by tasks.creating(Exec::class) {
currentOs.isLinux -> "linux" currentOs.isLinux -> "linux"
currentOs.isMacOsX -> "darwin" currentOs.isMacOsX -> "darwin"
currentOs.isWindows -> "mingw" currentOs.isWindows -> "mingw"
else -> error("UnsupportedmOS $currentOs") else -> error("Unsupported OS $currentOs")
} }
inputs.files(projectDir.resolve("build.sh")) inputs.files(projectDir.resolve("build.sh"))

View File

@ -1,7 +1,6 @@
pluginManagement { pluginManagement {
repositories { repositories {
google() google()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
gradlePluginPortal() gradlePluginPortal()
jcenter() jcenter()
} }

View File

@ -8,7 +8,6 @@ kotlin {
val commonMain by sourceSets.getting { val commonMain by sourceSets.getting {
dependencies { dependencies {
implementation(kotlin("stdlib-common"))
implementation(rootProject) implementation(rootProject)
} }
} }
@ -23,7 +22,6 @@ kotlin {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "1.8"
} }
compilations["main"].dependencies { compilations["main"].dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(project(":jni:jvm:all")) implementation(project(":jni:jvm:all"))
} }
compilations["test"].dependencies { compilations["test"].dependencies {
@ -36,7 +34,6 @@ kotlin {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "1.8"
} }
sourceSets["androidMain"].dependencies { sourceSets["androidMain"].dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(project(":jni:android")) implementation(project(":jni:android"))
} }
sourceSets["androidTest"].dependencies { sourceSets["androidTest"].dependencies {