gradle-tools/build.gradle.kts

143 lines
4.4 KiB
Plaintext
Raw Normal View History

2019-06-28 16:22:11 +03:00
import java.util.*
plugins {
`kotlin-dsl`
`maven-publish`
id("com.jfrog.bintray") version "1.8.5"
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-02 12:09:48 +03:00
version = "0.6.0-dev-1"
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")
2019-06-28 16:22:11 +03:00
}
2020-08-20 10:02:28 +03:00
val kotlinVersion = "1.4.0"
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")
2020-08-20 10:02:28 +03:00
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.14.4")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.0-rc")
implementation("org.jetbrains.dokka:dokka-core:1.4.0-rc")
2019-06-28 16:22:11 +03:00
}
gradlePlugin {
plugins {
2020-08-20 10:02:28 +03:00
create("kscience-publish") {
id = "kscience.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") {
id = "kscience.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") {
id = "kscience.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") {
id = "kscience.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") {
id = "kscience.native"
description = "Additional native targets to be use alongside mpp"
implementationClass = "ru.mipt.npm.gradle.KScienceNativePlugin"
}
create("kscience.node") {
id = "kscience.node"
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 {
maven("https://bintray.com/mipt-npm/scientifik")
}
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)
}
}
}
bintray {
user = project.findProperty("bintrayUser") as? String ?: System.getenv("BINTRAY_USER")
key = project.findProperty("bintrayApiKey") as? String? ?: System.getenv("BINTRAY_API_KEY")
publish = true
override = true // for multi-platform Kotlin/Native publishing
// We have to use delegateClosureOf because bintray supports only dynamic groovy syntax
// this is a problem of this plugin
pkg.apply {
userOrg = "mipt-npm"
2020-08-20 10:02:28 +03:00
repo = if (project.version.toString().contains("dev")) "dev" else "kscience"
2019-06-28 16:22:11 +03:00
name = project.name
issueTrackerUrl = "$vcs/issues"
setLicenses("Apache-2.0")
vcsUrl = vcs
version.apply {
name = project.version.toString()
vcsTag = project.version.toString()
released = Date().toString()
}
}
//workaround bintray bug
project.afterEvaluate {
setPublications(*project.extensions.findByType<PublishingExtension>()!!.publications.names.toTypedArray())
}
}
}