parent
7a33c81c01
commit
d702925e40
@ -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<AbstractTestTask>() {
|
||||
testLogging {
|
||||
events("passed", "skipped", "failed", "standard_out", "standard_error")
|
||||
showExceptions = true
|
||||
showStackTraces = true
|
||||
allprojects {
|
||||
afterEvaluate {
|
||||
tasks.withType<AbstractTestTask>() {
|
||||
testLogging {
|
||||
events("passed", "skipped", "failed", "standard_out", "standard_error")
|
||||
showExceptions = true
|
||||
showStackTraces = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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
|
||||
|
@ -10,7 +10,6 @@ kotlin {
|
||||
|
||||
dependencies {
|
||||
api(project(":jni"))
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
}
|
||||
|
||||
android {
|
||||
@ -48,18 +47,12 @@ afterEvaluate {
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("android") {
|
||||
artifactId = "secp256k1-jni-android"
|
||||
from(components["release"])
|
||||
}
|
||||
// create<MavenPublication>("androidDebug") {
|
||||
// artifactId = "secp256k1-jni-android-debug"
|
||||
// from(components["debug"])
|
||||
// }
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("android") {
|
||||
artifactId = "secp256k1-jni-android"
|
||||
from(components["release"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ kotlin {
|
||||
|
||||
dependencies {
|
||||
api(rootProject)
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
}
|
||||
|
||||
val generateHeaders by tasks.creating(JavaCompile::class) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
// `maven-publish`
|
||||
id("ru.vyarus.pom") version "2.1.0"
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -28,7 +28,6 @@ val buildNativeHost by tasks.creating(Exec::class) {
|
||||
|
||||
dependencies {
|
||||
api(project(":jni"))
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
@ -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"))
|
||||
|
@ -1,7 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||
gradlePluginPortal()
|
||||
jcenter()
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user