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-10-20 08:38:40 +03:00
|
|
|
id("org.jetbrains.changelog") version "0.6.2"
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
2020-08-20 10:02:28 +03:00
|
|
|
group = "ru.mipt.npm"
|
2020-11-27 15:10:15 +03:00
|
|
|
version = "0.7.0"
|
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-11-25 12:16:09 +03:00
|
|
|
val kotlinVersion = "1.4.20"
|
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-11-25 12:16:09 +03:00
|
|
|
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.10.2")
|
2020-09-27 17:45:40 +03:00
|
|
|
implementation("org.jetbrains.dokka:dokka-base:1.4.10")
|
2020-11-25 12:16:09 +03:00
|
|
|
implementation("org.jetbrains.intellij.plugins:gradle-changelog-plugin:0.6.2")
|
|
|
|
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.2.4")
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
gradlePlugin {
|
|
|
|
plugins {
|
2020-11-25 12:16:09 +03:00
|
|
|
create("kscience.common"){
|
|
|
|
id = "ru.mipt.npm.kscience"
|
|
|
|
description = "The generalized kscience plugin that works in conjunction with any kotlin plugin"
|
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceCommonPlugin"
|
|
|
|
}
|
2020-11-27 15:10:15 +03:00
|
|
|
|
2020-09-22 16:21:09 +03:00
|
|
|
create("kscience.project"){
|
|
|
|
id = "ru.mipt.npm.project"
|
|
|
|
description = "The root plugin for multimodule project infrastructure"
|
2020-09-25 09:55:01 +03:00
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceProjectPlugin"
|
2020-09-10 11:38:57 +03:00
|
|
|
}
|
2020-11-27 15:10:15 +03:00
|
|
|
|
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"
|
|
|
|
}
|
2020-09-30 20:43:02 +03:00
|
|
|
|
|
|
|
create("kscience.node") {
|
|
|
|
id = "ru.mipt.npm.node"
|
|
|
|
description = "Additional nodejs target to be use alongside mpp"
|
|
|
|
implementationClass = "ru.mipt.npm.gradle.KScienceNodePlugin"
|
|
|
|
}
|
2019-06-28 16:22:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
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 projectName = project.name
|
|
|
|
|
2020-09-14 22:25:52 +03:00
|
|
|
if (bintrayUser != null && bintrayApiKey != null) {
|
2020-09-05 14:17:04 +03:00
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "bintray"
|
|
|
|
url = uri(
|
2020-09-14 22:25:52 +03:00
|
|
|
"https://api.bintray.com/maven/mipt-npm/dev/$projectName/;publish=1;override=1"
|
2020-09-05 14:17:04 +03:00
|
|
|
)
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|