2019-06-28 16:22:11 +03:00
|
|
|
plugins {
|
2020-09-05 14:17:04 +03:00
|
|
|
`java-gradle-plugin`
|
2019-06-28 16:22:11 +03:00
|
|
|
`kotlin-dsl`
|
|
|
|
`maven-publish`
|
2020-08-31 12:40:13 +03:00
|
|
|
id("org.jetbrains.changelog") version "0.4.0"
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
2020-08-20 10:02:28 +03:00
|
|
|
group = "ru.mipt.npm"
|
2020-09-09 10:18:00 +03:00
|
|
|
version = "0.6.0-dev-5"
|
2019-06-28 16:22:11 +03:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
gradlePluginPortal()
|
|
|
|
jcenter()
|
2019-07-21 17:40:08 +03:00
|
|
|
maven("https://kotlin.bintray.com/kotlinx")
|
2019-07-20 11:42:22 +03:00
|
|
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
2020-09-09 10:18:00 +03:00
|
|
|
maven("https://dl.bintray.com/kotlin/kotlin-dev")
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
2020-09-09 10:18:00 +03:00
|
|
|
val kotlinVersion = "1.4.20-dev-3898-14"
|
2019-06-28 16:22:11 +03:00
|
|
|
|
2019-11-20 10:41:37 +03:00
|
|
|
java {
|
2019-11-20 12:25:02 +03:00
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2019-11-20 10:41:37 +03:00
|
|
|
}
|
|
|
|
|
2019-06-28 16:22:11 +03:00
|
|
|
// Add plugins used in buildSrc as dependencies, also we should specify version only here
|
|
|
|
dependencies {
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
2019-07-20 20:39:26 +03:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
|
2020-08-20 10:02:28 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.14.4")
|
2020-09-05 14:17:04 +03:00
|
|
|
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.0")
|
2020-09-07 13:32:25 +03:00
|
|
|
implementation("org.jetbrains.dokka:dokka-base:1.4.0")
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
gradlePlugin {
|
|
|
|
plugins {
|
2020-09-05 14:17:04 +03:00
|
|
|
create("kscience.publish") {
|
|
|
|
id = "ru.mipt.npm.publish"
|
2019-11-01 22:06:41 +03:00
|
|
|
description = "The publication plugin for bintray and github"
|
2020-08-20 10:02:28 +03:00
|
|
|
implementationClass = "ru.mipt.npm.gradle.KSciencePublishPlugin"
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
2019-07-21 17:40:08 +03:00
|
|
|
|
2020-08-20 10:02:28 +03:00
|
|
|
create("kscience.mpp") {
|
2020-09-05 14:17:04 +03:00
|
|
|
id = "ru.mipt.npm.mpp"
|
2019-06-28 16:22:11 +03:00
|
|
|
description = "Pre-configured multiplatform project"
|
2020-08-20 10:02:28 +03:00
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceMPPlugin"
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
2019-07-21 17:40:08 +03:00
|
|
|
|
2020-08-20 10:02:28 +03:00
|
|
|
create("kscience.jvm") {
|
2020-09-05 14:17:04 +03:00
|
|
|
id = "ru.mipt.npm.jvm"
|
2019-07-21 17:40:08 +03:00
|
|
|
description = "Pre-configured JVM project"
|
2020-08-20 10:02:28 +03:00
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceJVMPlugin"
|
2019-07-21 17:40:08 +03:00
|
|
|
}
|
|
|
|
|
2020-08-20 10:02:28 +03:00
|
|
|
create("kscience.js") {
|
2020-09-05 14:17:04 +03:00
|
|
|
id = "ru.mipt.npm.js"
|
2019-07-21 17:40:08 +03:00
|
|
|
description = "Pre-configured JS project"
|
2020-08-20 10:02:28 +03:00
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceJSPlugin"
|
|
|
|
}
|
|
|
|
|
|
|
|
create("kscience.native") {
|
2020-09-05 14:17:04 +03:00
|
|
|
id = "ru.mipt.npm.native"
|
2020-08-20 10:02:28 +03:00
|
|
|
description = "Additional native targets to be use alongside mpp"
|
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceNativePlugin"
|
|
|
|
}
|
|
|
|
|
|
|
|
create("kscience.node") {
|
2020-09-05 14:17:04 +03:00
|
|
|
id = "ru.mipt.npm.node"
|
2020-08-20 10:02:28 +03:00
|
|
|
description = "NodeJS target for kotlin-mpp and kotlin-js"
|
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceNodePlugin"
|
2019-07-21 17:40:08 +03:00
|
|
|
}
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories {
|
2020-09-05 14:17:04 +03:00
|
|
|
maven("https://bintray.com/mipt-npm/kscience")
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
val vcs = "https://github.com/mipt-npm/scientifik-gradle-tools"
|
|
|
|
|
|
|
|
// Process each publication we have in this project
|
|
|
|
publications.filterIsInstance<MavenPublication>().forEach { publication ->
|
|
|
|
|
|
|
|
publication.pom {
|
|
|
|
name.set(project.name)
|
|
|
|
description.set(project.description)
|
|
|
|
url.set(vcs)
|
|
|
|
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name.set("The Apache Software License, Version 2.0")
|
|
|
|
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
|
|
|
distribution.set("repo")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id.set("MIPT-NPM")
|
|
|
|
name.set("MIPT nuclear physics methods laboratory")
|
|
|
|
organization.set("MIPT")
|
|
|
|
organizationUrl.set("http://npm.mipt.ru")
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url.set(vcs)
|
2020-09-05 14:17:04 +03:00
|
|
|
tag.set(project.version.toString())
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-05 14:17:04 +03:00
|
|
|
val bintrayUser: String? by project
|
|
|
|
val bintrayApiKey: String? by project
|
|
|
|
|
|
|
|
val bintrayRepo = if (project.version.toString().contains("dev")) {
|
|
|
|
"dev"
|
|
|
|
} else {
|
|
|
|
findProperty("bintrayRepo") as? String
|
|
|
|
}
|
2019-06-28 16:22:11 +03:00
|
|
|
|
2020-09-05 14:17:04 +03:00
|
|
|
val projectName = project.name
|
|
|
|
|
|
|
|
if (bintrayRepo != null && bintrayUser != null && bintrayApiKey != null) {
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "bintray"
|
|
|
|
url = uri(
|
|
|
|
"https://api.bintray.com/maven/mipt-npm/$bintrayRepo/$projectName/;publish=1;override=1"
|
|
|
|
)
|
|
|
|
credentials {
|
|
|
|
username = bintrayUser
|
|
|
|
password = bintrayApiKey
|
|
|
|
}
|
|
|
|
}
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-09-05 14:17:04 +03:00
|
|
|
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|