Cleanup
This commit is contained in:
parent
d19857bdd7
commit
5e6a29fbe0
7 changed files with 49 additions and 50 deletions
22
README.md
22
README.md
|
@ -49,7 +49,7 @@ or in your `gradle.build` file:
|
|||
|
||||
```gradle
|
||||
someTask {
|
||||
dependsOn(incrementPatch)
|
||||
dependsOn incrementPatch
|
||||
...
|
||||
}
|
||||
```
|
||||
|
@ -178,7 +178,7 @@ But, for example, if you wanted to save the version properties in a different fi
|
|||
|
||||
```gradle
|
||||
semver {
|
||||
properties = "my.version" // read and save properties in "my.version"
|
||||
properties = 'my.version' // read and save properties in "my.version"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -186,13 +186,13 @@ or using different property keys for the version data:
|
|||
|
||||
```gradle
|
||||
semver {
|
||||
keysPrefix = "" // no prefix
|
||||
semverKey = "version"
|
||||
majorKey = "maj"
|
||||
minorKey = "min"
|
||||
patchKey = "build"
|
||||
preReleaseKey = "rel"
|
||||
buildMetaKey = "meta"
|
||||
keysPrefix = '' // no prefix
|
||||
semverKey = 'version'
|
||||
majorKey = 'maj'
|
||||
minorKey = 'min'
|
||||
patchKey = 'build'
|
||||
preReleaseKey = 'rel'
|
||||
buildMetaKey = 'meta'
|
||||
}
|
||||
```
|
||||
which would match the data in `my.version`:
|
||||
|
@ -227,8 +227,8 @@ In order to quickly support multiple projects. The `keysPrefix` property is avai
|
|||
|
||||
```gradle
|
||||
semver {
|
||||
properties = "test.properties"
|
||||
keysPrefix = "test."
|
||||
properties = 'test.properties'
|
||||
keysPrefix = 'test.'
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -3,25 +3,24 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java
|
||||
`java-gradle-plugin`
|
||||
`maven-publish`
|
||||
jacoco
|
||||
kotlin("jvm") version "1.4.31" // Don't upgrade until kotlin-dsl plugin is upgraded.
|
||||
id("com.github.ben-manes.versions") version "0.38.0"
|
||||
id("com.gradle.plugin-publish") version "0.14.0"
|
||||
id("com.github.ben-manes.versions") version "0.39.0"
|
||||
id("com.gradle.plugin-publish") version "0.15.0"
|
||||
id("io.gitlab.arturbosch.detekt") version "1.17.1"
|
||||
id("jacoco")
|
||||
id("java")
|
||||
id("java-gradle-plugin")
|
||||
id("maven-publish")
|
||||
id("org.gradle.kotlin.kotlin-dsl") version "2.1.4"
|
||||
id("org.sonarqube") version "3.2.0"
|
||||
kotlin("jvm") version "1.4.31" // Don't upgrade until kotlin-dsl plugin is upgraded.
|
||||
}
|
||||
|
||||
version = "1.0.5"
|
||||
group = "net.thauvin.erik.gradle"
|
||||
|
||||
object VersionInfo {
|
||||
const val spek = "2.0.15" // Don't upgrade until 2.0.17
|
||||
object Versions {
|
||||
const val SPEK = "2.0.15" // Don't upgrade until 2.0.17
|
||||
}
|
||||
val versions: VersionInfo by extra { VersionInfo }
|
||||
|
||||
val github = "https://github.com/ethauvin/semver-gradle"
|
||||
val packageName = "net.thauvin.erik.gradle.semver"
|
||||
|
@ -34,7 +33,7 @@ repositories {
|
|||
dependencies {
|
||||
implementation(gradleApi())
|
||||
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
||||
implementation(platform(kotlin("bom")))
|
||||
implementation(kotlin("stdlib"))
|
||||
|
||||
testImplementation(kotlin("reflect"))
|
||||
|
@ -42,8 +41,8 @@ dependencies {
|
|||
|
||||
//testImplementation(gradleTestKit())
|
||||
|
||||
testImplementation("org.spekframework.spek2:spek-dsl-jvm:${versions.spek}")
|
||||
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:${versions.spek}")
|
||||
testImplementation("org.spekframework.spek2:spek-dsl-jvm:${Versions.SPEK}")
|
||||
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:${Versions.SPEK}")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
@ -58,7 +57,7 @@ tasks {
|
|||
withType<Test> {
|
||||
testLogging {
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
||||
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
||||
}
|
||||
|
||||
useJUnitPlatform {
|
||||
|
|
|
@ -14,7 +14,7 @@ mainClassName = 'com.example.Example'
|
|||
|
||||
defaultTasks 'run'
|
||||
|
||||
def semverProcessor = "net.thauvin.erik:semver:1.2.0"
|
||||
def semverProcessor = 'net.thauvin.erik:semver:1.2.0'
|
||||
|
||||
dependencies {
|
||||
annotationProcessor semverProcessor
|
||||
|
@ -41,8 +41,8 @@ run {
|
|||
}
|
||||
|
||||
semver {
|
||||
// properties = "example.properties"
|
||||
// keysPrefix = "example."
|
||||
// preReleaseKey = "release"
|
||||
// buildMetaKey = "meta"
|
||||
// properties = 'example.properties'
|
||||
// keysPrefix = 'example.'
|
||||
// preReleaseKey = 'release'
|
||||
// buildMetaKey = 'meta'
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
plugins {
|
||||
kotlin("jvm").version("1.5.0")
|
||||
application
|
||||
id("org.jetbrains.kotlin.kapt").version("1.5.0")
|
||||
id("net.thauvin.erik.gradle.semver").version("1.0.4")
|
||||
id("com.github.ben-manes.versions").version("0.38.0")
|
||||
id("application")
|
||||
id("com.github.ben-manes.versions") version "0.38.0"
|
||||
id("net.thauvin.erik.gradle.semver") version "1.0.4"
|
||||
kotlin("jvm") version "1.5.0"
|
||||
kotlin("kapt") version "1.5.0"
|
||||
}
|
||||
|
||||
// ./gradlew
|
||||
|
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id 'java'
|
||||
id 'application'
|
||||
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
|
||||
id 'com.github.ben-manes.versions' version '0.38.0'
|
||||
id 'com.github.ben-manes.versions' version '0.39.0'
|
||||
}
|
||||
|
||||
// ./gradlew
|
||||
|
@ -36,10 +36,10 @@ application {
|
|||
}
|
||||
|
||||
semver {
|
||||
// properties = "example.properties"
|
||||
// keysPrefix = "example."
|
||||
// preReleaseKey = "release"
|
||||
// buildMetaKey = "meta"
|
||||
// properties = 'example.properties'
|
||||
// keysPrefix = 'example.'
|
||||
// preReleaseKey = 'release'
|
||||
// buildMetaKey = 'meta'
|
||||
}
|
||||
|
||||
incrementBuildMeta {
|
||||
|
@ -60,5 +60,5 @@ run {
|
|||
}
|
||||
|
||||
task echoVersion(type:Exec) {
|
||||
commandLine 'echo', "${-> project.version}"
|
||||
commandLine('echo', "${-> project.version}")
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.time.LocalDateTime
|
|||
import java.time.format.DateTimeFormatter
|
||||
|
||||
plugins {
|
||||
kotlin("jvm").version("1.5.0")
|
||||
application
|
||||
id("net.thauvin.erik.gradle.semver").version("1.0.4")
|
||||
id("com.github.ben-manes.versions").version("0.38.0")
|
||||
id("application")
|
||||
id("com.github.ben-manes.versions") version "0.39.0"
|
||||
id("net.thauvin.erik.gradle.semver") version "1.0.4"
|
||||
kotlin("jvm") version "1.5.10"
|
||||
}
|
||||
|
||||
// ./gradlew
|
||||
|
|
|
@ -4,7 +4,7 @@ buildscript {
|
|||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "net.thauvin.erik.gradle:semver:1.0.5-beta"
|
||||
classpath 'net.thauvin.erik.gradle:semver:1.0.5-beta'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,9 +31,9 @@ repositories {
|
|||
}
|
||||
|
||||
application {
|
||||
println(project.version)
|
||||
println project.version
|
||||
project.afterEvaluate {
|
||||
println(project.version)
|
||||
println project.version
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,13 +47,13 @@ incrementBuildMeta {
|
|||
|
||||
run {
|
||||
doFirst {
|
||||
println("Version: $semver.major$semver.separator$semver.minor$semver.separator$semver.patch$semver.preReleasePrefix$semver.preRelease$semver.buildMetaPrefix$semver.buildMeta")
|
||||
println "Version: $semver.major$semver.separator$semver.minor$semver.separator$semver.patch$semver.preReleasePrefix$semver.preRelease$semver.buildMetaPrefix$semver.buildMeta"
|
||||
args = [f.name]
|
||||
}
|
||||
}
|
||||
|
||||
task echoVersion(type:Exec) {
|
||||
commandLine "echo", "${-> version}"
|
||||
commandLine('echo', "${-> version}")
|
||||
}
|
||||
|
||||
semver {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue