Switched to mustache built-in template.
This commit is contained in:
parent
3df73b7366
commit
3a34a6c03f
4 changed files with 2 additions and 38 deletions
|
@ -24,7 +24,7 @@ repositories {
|
|||
dependencies {
|
||||
kapt processorJar
|
||||
compileOnly processorJar
|
||||
compileOnly 'org.apache.velocity:velocity:1.7'
|
||||
compileOnly 'com.github.spullara.mustache.java:compiler:0.9.4'
|
||||
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -2,6 +2,6 @@
|
|||
version.prerelease=beta
|
||||
version.project=Example
|
||||
version.minor=1
|
||||
version.buildmeta=
|
||||
version.buildmeta=001
|
||||
version.patch=49
|
||||
version.major=3
|
||||
|
|
36
version.vm
36
version.vm
|
@ -1,36 +0,0 @@
|
|||
package ${packageName}
|
||||
|
||||
import java.util.*
|
||||
|
||||
open class ${className}
|
||||
private constructor() {
|
||||
companion object {
|
||||
val project = "${project}"
|
||||
|
||||
val buildDate = Date(${epoch}L)
|
||||
val major = ${major}
|
||||
val minor = ${minor}
|
||||
val patch = ${patch}
|
||||
val buildMeta = "${buildmeta}"
|
||||
val preRelease = "${prerelease}"
|
||||
|
||||
val version: String
|
||||
get() = ("\$major.\$minor.\$patch" + preReleaseWithPrefix() + buildMetaWithPrefix())
|
||||
|
||||
fun preReleaseWithPrefix(prefix: String = "-"): String {
|
||||
return if (preRelease.isNotEmpty() && prefix.isNotEmpty()) {
|
||||
"$prefix$preRelease"
|
||||
} else {
|
||||
preRelease
|
||||
}
|
||||
}
|
||||
|
||||
fun buildMetaWithPrefix(prefix: String = "+"): String {
|
||||
return if (buildMeta.isNotEmpty() && prefix.isNotEmpty()) {
|
||||
"$prefix$buildMeta"
|
||||
} else {
|
||||
buildMeta
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue