mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-13 20:33:01 +00:00
addon versioning
This commit is contained in:
@@ -13,6 +13,7 @@ import org.gradle.kotlin.dsl.getByName
|
||||
import org.gradle.kotlin.dsl.register
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.gradle.language.jvm.tasks.ProcessResources
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
fun Project.configureCompilation() {
|
||||
apply(plugin = "maven-publish")
|
||||
@@ -34,14 +35,13 @@ fun Project.configureCompilation() {
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
include("**/*.*")
|
||||
filter<org.apache.tools.ant.filters.ReplaceTokens>(
|
||||
filter<ReplaceTokens>(
|
||||
"tokens" to mapOf(
|
||||
"VERSION" to project.version.toString(),
|
||||
"DESCRIPTION" to project.properties["terra.description"],
|
||||
"WIKI" to project.properties["terra.wiki"],
|
||||
"SOURCE" to project.properties["terra.source"],
|
||||
"ISSUES" to project.properties["terra.issues"],
|
||||
"LICENSE" to project.properties["terra.license"]
|
||||
"DESCRIPTION" to properties["terra.description"],
|
||||
"WIKI" to properties["terra.wiki"],
|
||||
"SOURCE" to properties["terra.source"],
|
||||
"ISSUES" to properties["terra.issues"],
|
||||
"LICENSE" to properties["terra.license"]
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.dfsek.terra
|
||||
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.filter
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.gradle.language.jvm.tasks.ProcessResources
|
||||
|
||||
var isPrerelease = false
|
||||
|
||||
@@ -8,7 +12,7 @@ fun preRelease(preRelease: Boolean) {
|
||||
isPrerelease = preRelease
|
||||
}
|
||||
|
||||
fun Project.versionProjects(project:String, version:String) {
|
||||
fun Project.versionProjects(project: String, version: String) {
|
||||
project(project).subprojects.forEach {
|
||||
it.version = version
|
||||
}
|
||||
@@ -20,3 +24,14 @@ fun Project.version(version: String): String {
|
||||
else //Only use git hash if it's a prerelease.
|
||||
"$version-BETA+${getGitHash()}"
|
||||
}
|
||||
|
||||
fun Project.configureVersioning() {
|
||||
tasks.withType<ProcessResources> {
|
||||
include("**/*.*")
|
||||
filter<ReplaceTokens>(
|
||||
"tokens" to mapOf(
|
||||
"VERSION" to version.toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user