2020-07-01 13:53:26 +02:00
|
|
|
plugins {
|
|
|
|
kotlin("jvm")
|
2021-03-11 17:53:50 +01:00
|
|
|
id("org.jetbrains.dokka")
|
2020-07-02 11:39:42 +02:00
|
|
|
`maven-publish`
|
2020-07-01 13:53:26 +02:00
|
|
|
}
|
|
|
|
|
2020-07-09 15:54:34 +03:00
|
|
|
val currentOs = org.gradle.internal.os.OperatingSystem.current()
|
|
|
|
val bash = if (currentOs.isWindows) "bash.exe" else "bash"
|
|
|
|
|
|
|
|
val buildNativeHost by tasks.creating(Exec::class) {
|
|
|
|
group = "build"
|
|
|
|
dependsOn(":jni:generateHeaders")
|
|
|
|
dependsOn(":native:buildSecp256k1Host")
|
|
|
|
|
|
|
|
val target = when {
|
|
|
|
currentOs.isLinux -> "linux"
|
|
|
|
currentOs.isMacOsX -> "darwin"
|
|
|
|
currentOs.isWindows -> "mingw"
|
|
|
|
else -> error("Unsupported OS $currentOs")
|
|
|
|
}
|
|
|
|
|
|
|
|
inputs.files(projectDir.resolve("build.sh"))
|
|
|
|
outputs.dir(buildDir.resolve(target))
|
|
|
|
|
|
|
|
workingDir = projectDir
|
|
|
|
environment("TARGET", target)
|
|
|
|
commandLine(bash, "build.sh")
|
2020-07-01 13:53:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
api(project(":jni"))
|
|
|
|
}
|
|
|
|
|
2020-07-02 11:39:42 +02:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("jvm") {
|
2020-09-09 11:00:04 +02:00
|
|
|
artifactId = "secp256k1-kmp-jni-jvm-extract"
|
2020-07-02 11:39:42 +02:00
|
|
|
from(components["java"])
|
2021-03-11 17:53:50 +01:00
|
|
|
val sourcesJar = task<Jar>("sourcesJar") {
|
|
|
|
archiveClassifier.set("sources")
|
|
|
|
}
|
|
|
|
artifact(sourcesJar)
|
2020-07-02 11:39:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-09 15:54:34 +03:00
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
tasks["clean"].doLast {
|
|
|
|
delete("$buildDir/build/cmake")
|
|
|
|
}
|
|
|
|
}
|