89 lines
2.2 KiB
Kotlin
89 lines
2.2 KiB
Kotlin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
plugins {
|
|
`kotlin-dsl`
|
|
`java-gradle-plugin`
|
|
`maven-publish`
|
|
id("com.gradle.plugin-publish").version("0.10.0")
|
|
id("com.github.ben-manes.versions").version("0.20.0")
|
|
id("org.jlleitschuh.gradle.ktlint").version("6.3.1")
|
|
id("io.gitlab.arturbosch.detekt").version("1.0.0-RC12")
|
|
}
|
|
|
|
version = "0.9.8-beta"
|
|
group = "net.thauvin.erik.gradle"
|
|
|
|
var github = "https://github.com/ethauvin/semver-gradle"
|
|
var packageName = "net.thauvin.erik.gradle.semver"
|
|
|
|
var spekVersion = "1.2.1"
|
|
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
implementation(gradleApi())
|
|
|
|
testImplementation(kotlin("reflect"))
|
|
testImplementation(kotlin("test"))
|
|
testImplementation(gradleTestKit())
|
|
|
|
testImplementation("org.jetbrains.spek:spek-api:$spekVersion") {
|
|
exclude(group = "org.jetbrains.kotlin")
|
|
}
|
|
|
|
testRuntimeOnly("org.jetbrains.spek:spek-junit-platform-engine:$spekVersion") {
|
|
exclude(group = "org.jetbrains.kotlin")
|
|
exclude(group = "org.junit.platform")
|
|
}
|
|
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.3.2") {
|
|
because("Needed to run tests IDEs that bundle an older version")
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
withType<KotlinCompile> {
|
|
kotlinOptions.jvmTarget = "1.8"
|
|
// Gradle 4.6
|
|
kotlinOptions.apiVersion = "1.2"
|
|
}
|
|
|
|
withType<Test> {
|
|
useJUnitPlatform {
|
|
includeEngines("spek")
|
|
}
|
|
}
|
|
|
|
"check" {
|
|
dependsOn("ktlintCheck")
|
|
}
|
|
}
|
|
|
|
detekt {
|
|
input = files("src/main/kotlin")
|
|
filters = ".*/resources/.*,.*/build/.*"
|
|
baseline = project.rootDir.resolve("detekt-baseline.xml")
|
|
}
|
|
|
|
gradlePlugin {
|
|
plugins {
|
|
create(project.name) {
|
|
id = packageName
|
|
displayName = "SemVer Plugin"
|
|
description = "Semantic Version Plugin for Gradle"
|
|
implementationClass = "$packageName.SemverPlugin"
|
|
}
|
|
}
|
|
}
|
|
|
|
pluginBundle {
|
|
website = github
|
|
vcsUrl = github
|
|
tags = listOf("semver", "semantic", "version", "versioning", "auto-increment", "kotlin", "java")
|
|
mavenCoordinates {
|
|
groupId = project.group.toString()
|
|
artifactId = project.name
|
|
}
|
|
}
|