Skip to content

Commit

Permalink
fix(build): create version file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingwersaft committed Mar 9, 2020
1 parent 44b5186 commit e9decc2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import net.nemerosa.versioning.tasks.VersionDisplayTask
plugins {
kotlin("jvm") version "1.3.61"
`java-gradle-plugin`
id("org.gradle.kotlin.kotlin-dsl") version "1.3.4"
id("org.gradle.kotlin.kotlin-dsl") version "1.3.3"
`maven-publish`
id("com.gradle.plugin-publish") version "0.10.1"
id("net.nemerosa.versioning") version "2.12.0"
Expand Down Expand Up @@ -47,15 +47,20 @@ tasks {
println("[VersionDisplayTask] version=$version")
}
}
val build by existing {
val createVersionFile by creating {
doLast {
mkdir(buildDir)
file("$buildDir/version").apply {
if (exists()) delete()
createNewFile()
writeText(project.version.toString())
}
}
}
val build by existing
val publish by existing
val publishToMavenLocal by existing
listOf(build.get(), publish.get(), publishToMavenLocal.get()).forEach { it.dependsOn(createVersionFile) }
}
publishing {
repositories {
Expand Down

0 comments on commit e9decc2

Please sign in to comment.