gradle-tools/build.gradle.kts

164 lines
5.1 KiB
Plaintext
Raw Normal View History

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`
2021-02-16 22:58:16 +03:00
signing
2021-02-16 18:19:22 +03:00
id("de.marcphilipp.nexus-publish") version "0.4.0"
2021-01-18 22:06:13 +03:00
id("org.jetbrains.changelog") version "1.0.0"
2021-02-16 22:58:16 +03:00
id("org.jetbrains.dokka") version "1.4.20"
2019-06-28 16:22:11 +03:00
}
2020-08-20 10:02:28 +03:00
group = "ru.mipt.npm"
2021-02-16 18:19:22 +03:00
version = "0.7.7"
description = "Build tools for DataForge and kscience projects"
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
}
2021-02-03 20:13:22 +03:00
val kotlinVersion = "1.4.30"
2019-06-28 16:22:11 +03:00
java {
targetCompatibility = JavaVersion.VERSION_1_8
}
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")
implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
2021-02-03 20:13:22 +03:00
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.15.1")
2020-12-16 14:14:51 +03:00
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.20")
implementation("org.jetbrains.dokka:dokka-base:1.4.20")
2021-01-18 22:06:13 +03:00
implementation("org.jetbrains.intellij.plugins:gradle-changelog-plugin:1.0.0")
2021-02-03 20:13:22 +03:00
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.4.0")
2019-06-28 16:22:11 +03:00
}
gradlePlugin {
plugins {
2021-02-16 22:58:16 +03:00
create("kscience.common") {
2020-11-25 12:16:09 +03:00
id = "ru.mipt.npm.kscience"
description = "The generalized kscience plugin that works in conjunction with any kotlin plugin"
implementationClass = "ru.mipt.npm.gradle.KScienceCommonPlugin"
}
2021-02-16 22:58:16 +03:00
create("kscience.project") {
2020-09-22 16:21:09 +03:00
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-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 {
2021-02-16 22:58:16 +03:00
val vcs = "https://github.com/mipt-npm/gradle-tools"
val sourcesJar: Jar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.named("main").get().allSource)
}
val javadocsJar: Jar by tasks.creating(Jar::class) {
group = "documentation"
archiveClassifier.set("javadoc")
from(tasks.dokkaHtml)
}
2019-06-28 16:22:11 +03:00
// Process each publication we have in this project
publications.filterIsInstance<MavenPublication>().forEach { publication ->
2021-02-16 22:58:16 +03:00
publication.apply {
artifact(sourcesJar)
artifact(javadocsJar)
2019-06-28 16:22:11 +03:00
2021-02-16 22:58:16 +03:00
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")
}
2019-06-28 16:22:11 +03:00
}
2021-02-16 22:58:16 +03:00
developers {
developer {
id.set("MIPT-NPM")
name.set("MIPT nuclear physics methods laboratory")
organization.set("MIPT")
organizationUrl.set("http://npm.mipt.ru")
}
2019-06-28 16:22:11 +03:00
2021-02-16 22:58:16 +03:00
}
scm {
url.set(vcs)
tag.set(project.version.toString())
}
2019-06-28 16:22:11 +03:00
}
}
}
2021-02-16 18:19:22 +03:00
val sonatypeUser: String? by project
val sonatypePassword: String? by project
if (sonatypeUser != null && sonatypePassword != null) {
nexusPublishing {
repositories {
2021-02-16 22:58:16 +03:00
sonatype {
2021-02-16 18:19:22 +03:00
username.set(sonatypeUser)
password.set(sonatypePassword)
2020-09-05 14:17:04 +03:00
}
}
2019-06-28 16:22:11 +03:00
}
}
2020-09-05 14:17:04 +03:00
2021-02-16 22:58:16 +03:00
signing {
useGpgCmd()
sign(publications)
}
2019-06-28 16:22:11 +03:00
}