Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
attempt at setting up fawe.properties
Dieser Commit ist enthalten in:
Ursprung
b5b89412d9
Commit
70d4af006a
@ -1,4 +1,5 @@
|
||||
import org.ajoberstar.grgit.Grgit
|
||||
import java.time.format.DateTimeFormatter
|
||||
|
||||
plugins {
|
||||
id("com.gradle.build-scan") version "2.4.1"
|
||||
@ -18,6 +19,28 @@ logger.lifecycle("""
|
||||
*******************************************
|
||||
""")
|
||||
//TODO FIX THIS WHEN I FEEL LIKE IT
|
||||
var rootVersion = "1.13"
|
||||
var revision: String = ""
|
||||
var buildNumber = ""
|
||||
var date: String = ""
|
||||
ext {
|
||||
val git: Grgit = Grgit.open {
|
||||
dir = File(rootDir.toString() + "/.git");
|
||||
}
|
||||
ext["date"] = git.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"));
|
||||
ext["revision"] = "-${git.head().abbreviatedId}";
|
||||
var parents: MutableList<String>? = git.head().parentIds;
|
||||
if (project.hasProperty("buildnumber")) {
|
||||
buildNumber = project.properties["buildnumber"] as String;
|
||||
} else {
|
||||
var index = -2109; // Offset to match CI
|
||||
while (parents != null && parents.isNotEmpty()) {
|
||||
parents = git.getResolve().toCommit(parents.get(0)).getParentIds()
|
||||
index++;
|
||||
}
|
||||
buildNumber = index.toString();
|
||||
}
|
||||
}
|
||||
//def rootVersion = "1.13"
|
||||
//def revision = ""
|
||||
//def buildNumber = ""
|
||||
@ -40,6 +63,8 @@ logger.lifecycle("""
|
||||
//
|
||||
//version = String.format("%s.%s", rootVersion, buildNumber)
|
||||
|
||||
version = String.format("%s.%s", rootVersion, buildNumber)
|
||||
|
||||
if (!project.hasProperty("gitCommitHash")) {
|
||||
apply(plugin = "org.ajoberstar.grgit")
|
||||
ext["gitCommitHash"] = try {
|
||||
|
@ -1,4 +1,4 @@
|
||||
group=com.sk89q.worldedit
|
||||
version=7.1.0-SNAPSHOT
|
||||
#version=7.1.0-SNAPSHOT
|
||||
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
|
@ -59,9 +59,9 @@ sourceSets {
|
||||
|
||||
tasks.named<Copy>("processResources") {
|
||||
filesMatching("fawe.properties") {
|
||||
// expand("version" to project.ext["internalVersion"])
|
||||
// expand("commit" to "TODO GIT")
|
||||
// expand("date" to "TODO Date")
|
||||
expand("version" to "$version")
|
||||
expand("commit" to "${rootProject.ext["revision"]}")
|
||||
expand("date" to "${rootProject.ext["date"]}")
|
||||
}
|
||||
}
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren