kmath/build.gradle.kts

111 lines
3.6 KiB
Plaintext
Raw Normal View History

2019-01-31 18:19:02 +03:00
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
buildscript {
2019-02-12 11:58:58 +03:00
val kotlinVersion: String by rootProject.extra("1.3.21")
2019-02-20 12:54:39 +03:00
val ioVersion: String by rootProject.extra("0.1.5")
2019-01-26 19:38:18 +03:00
val coroutinesVersion: String by rootProject.extra("1.1.1")
2019-02-03 13:07:35 +03:00
val atomicfuVersion: String by rootProject.extra("0.12.1")
2019-02-22 13:52:35 +03:00
val dokkaVersion: String by rootProject.extra("0.9.17")
repositories {
2019-01-26 19:38:18 +03:00
//maven("https://dl.bintray.com/kotlin/kotlin-eap")
jcenter()
}
dependencies {
2018-11-21 09:55:39 +03:00
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jfrog.buildinfo:build-info-extractor-gradle:4+")
2019-02-21 08:58:55 +03:00
classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
2019-02-22 13:52:35 +03:00
classpath("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion")
}
}
plugins {
2019-02-12 14:14:16 +03:00
id("com.jfrog.artifactory") version "4.9.1" apply false
}
2019-02-22 13:52:35 +03:00
val kmathVersion by extra("0.1.0")
2019-02-22 13:52:35 +03:00
allprojects {
group = "scientifik"
2019-02-22 13:52:35 +03:00
version = kmathVersion
2018-12-24 15:19:35 +03:00
2019-01-04 18:12:28 +03:00
repositories {
2019-01-31 18:19:02 +03:00
//maven("https://dl.bintray.com/kotlin/kotlin-eap")
2018-12-24 15:19:35 +03:00
jcenter()
}
2019-01-31 18:19:02 +03:00
2019-02-22 13:52:35 +03:00
apply(plugin = "maven")
apply(plugin = "maven-publish")
// apply bintray configuration
apply(from = "${rootProject.rootDir}/gradle/bintray.gradle")
//apply artifactory configuration
apply(from = "${rootProject.rootDir}/gradle/artifactory.gradle")
}
subprojects {
if (!name.startsWith("kmath")) return@subprojects
2019-01-31 18:19:02 +03:00
extensions.findByType<KotlinMultiplatformExtension>()?.apply {
jvm {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
targets.all {
sourceSets.all {
languageSettings.progressiveMode = true
}
}
2019-02-21 08:58:55 +03:00
2019-02-22 13:52:35 +03:00
extensions.findByType<PublishingExtension>()?.apply {
publications.filterIsInstance<MavenPublication>().forEach { publication ->
if (publication.name == "kotlinMultiplatform") {
// for our root metadata publication, set artifactId with a package and project name
publication.artifactId = project.name
} else {
// for targets, set artifactId with a package, project name and target name (e.g. iosX64)
publication.artifactId = "${project.name}-${publication.name}"
}
}
2019-02-21 08:58:55 +03:00
2019-02-22 13:52:35 +03:00
// Create empty jar for sources classifier to satisfy maven requirements
val stubSources by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
//from(sourceSets.main.get().allSource)
}
// Create empty jar for javadoc classifier to satisfy maven requirements
val stubJavadoc by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
extensions.findByType<KotlinMultiplatformExtension>()?.apply {
targets.forEach { target ->
val publication = publications.findByName(target.name) as MavenPublication
// Patch publications with fake javadoc
publication.artifact(stubJavadoc)
// Remove gradle metadata publishing from all targets which are not native
// if (target.platformType.name != "native") {
// publication.gradleModuleMetadataFile = null
// tasks.matching { it.name == "generateMetadataFileFor${name.capitalize()}Publication" }.all {
// onlyIf { false }
// }
// }
}
}
2019-02-21 08:58:55 +03:00
}
}
}
2019-02-22 13:52:35 +03:00