2020-10-04 08:45:35 +03:00
|
|
|
@file:Suppress("UNUSED_VARIABLE")
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
import kscience.kmath.gsl.codegen.matricesCodegen
|
2020-10-05 13:46:41 +03:00
|
|
|
import kscience.kmath.gsl.codegen.vectorsCodegen
|
2021-01-31 11:36:35 +03:00
|
|
|
import ru.mipt.npm.gradle.Maturity
|
2020-10-05 09:13:06 +03:00
|
|
|
|
2020-10-04 08:45:35 +03:00
|
|
|
plugins {
|
2020-10-04 10:10:53 +03:00
|
|
|
id("ru.mipt.npm.mpp")
|
2021-02-18 15:37:12 +03:00
|
|
|
id("de.undercouch.download")
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2020-10-11 17:24:10 +03:00
|
|
|
explicitApiWarning()
|
2021-02-18 15:37:12 +03:00
|
|
|
data class DownloadLinks(val gsl: String)
|
|
|
|
|
|
|
|
lateinit var downloadLinks: DownloadLinks
|
2020-10-11 17:24:10 +03:00
|
|
|
|
2020-10-04 11:53:24 +03:00
|
|
|
val nativeTarget = when (System.getProperty("os.name")) {
|
2021-01-07 15:38:46 +03:00
|
|
|
// "Mac OS X" -> macosX64()
|
2021-02-18 15:37:12 +03:00
|
|
|
"Linux" -> {
|
|
|
|
downloadLinks = DownloadLinks(gsl = "")
|
|
|
|
linuxX64()
|
|
|
|
}
|
2020-10-04 16:17:44 +03:00
|
|
|
|
2020-10-04 11:53:24 +03:00
|
|
|
else -> {
|
|
|
|
logger.warn("Current OS cannot build any of kmath-gsl targets.")
|
|
|
|
return@kotlin
|
|
|
|
}
|
2020-10-04 10:10:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
val main by nativeTarget.compilations.getting {
|
|
|
|
cinterops {
|
2020-10-15 09:15:11 +03:00
|
|
|
val libgsl by creating
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-15 09:15:11 +03:00
|
|
|
val test by nativeTarget.compilations.getting
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
sourceSets {
|
2021-01-30 20:57:15 +03:00
|
|
|
val nativeMain by creating {
|
2020-10-10 23:37:04 +03:00
|
|
|
val codegen by tasks.creating {
|
|
|
|
matricesCodegen(kotlin.srcDirs.first().absolutePath + "/kscience/kmath/gsl/_Matrices.kt")
|
|
|
|
vectorsCodegen(kotlin.srcDirs.first().absolutePath + "/kscience/kmath/gsl/_Vectors.kt")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin.srcDirs(files().builtBy(codegen))
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
dependencies {
|
2021-02-11 14:44:17 +03:00
|
|
|
api(project(":kmath-complex"))
|
2020-10-05 09:13:06 +03:00
|
|
|
api(project(":kmath-core"))
|
|
|
|
}
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
2020-10-15 09:15:11 +03:00
|
|
|
|
2021-01-30 20:57:15 +03:00
|
|
|
val nativeTest by creating {
|
2020-10-15 09:15:11 +03:00
|
|
|
dependsOn(nativeMain)
|
|
|
|
}
|
|
|
|
|
2021-01-30 20:57:15 +03:00
|
|
|
main.defaultSourceSet.dependsOn(nativeMain)
|
|
|
|
test.defaultSourceSet.dependsOn(nativeTest)
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
2020-10-10 21:24:16 +03:00
|
|
|
}
|
2021-01-31 11:36:35 +03:00
|
|
|
|
|
|
|
readme {
|
|
|
|
description = "Linear Algebra classes implemented with GNU Scientific Library"
|
|
|
|
maturity = Maturity.PROTOTYPE
|
|
|
|
propertyByTemplate("artifact", rootProject.file("docs/templates/ARTIFACT-TEMPLATE.md"))
|
|
|
|
|
|
|
|
feature(
|
|
|
|
id = "matrix-contexts",
|
|
|
|
description = "Matrix Contexts over Double, Float and Complex implemented with GSL",
|
|
|
|
ref = "src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrixContext.kt"
|
|
|
|
)
|
|
|
|
}
|