3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-27 19:30:07 +01:00
FastAsyncWorldEdit/build.gradle.kts

Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen.

64 Zeilen
1.8 KiB
Plaintext

2019-08-26 06:45:03 +02:00
import org.ajoberstar.grgit.Grgit
import java.time.format.DateTimeFormatter
logger.lifecycle("""
*******************************************
You are building FastAsyncWorldEdit!
If you encounter trouble:
1) Read COMPILING.md if you haven't yet
2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle
2021-02-16 23:49:04 +01:00
4) If you still need help, ask on Discord! https://discord.gg/intellectualsites
2019-08-26 06:45:03 +02:00
Output files will be in [subproject]/build/libs
*******************************************
""")
2020-08-14 21:29:15 +02:00
2019-08-26 06:45:03 +02:00
//TODO FIX THIS WHEN I FEEL LIKE IT
2020-08-14 21:29:15 +02:00
var rootVersion by extra("1.16")
var revision: String by extra("")
var buildNumber by extra("")
var date: String by extra("")
2019-08-26 06:45:03 +02:00
ext {
val git: Grgit = Grgit.open {
2020-02-05 22:27:50 +01:00
dir = File("$rootDir/.git");
2019-08-26 06:45:03 +02:00
}
2020-08-14 21:29:15 +02:00
date = git.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"));
revision = "-${git.head().abbreviatedId}";
2019-08-26 06:45:03 +02:00
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()) {
2020-02-05 22:27:50 +01:00
parents = git.resolve.toCommit(parents[0]).parentIds
2019-08-26 06:45:03 +02:00
index++;
}
buildNumber = index.toString();
}
}
2019-11-07 11:28:17 +01:00
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile::class) {
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
}
}
}
2019-08-26 06:45:03 +02:00
version = String.format("%s-%s", rootVersion, buildNumber)
2020-08-14 21:29:15 +02:00
applyCommonConfiguration()
2019-08-26 06:45:03 +02:00
if (!project.hasProperty("gitCommitHash")) {
apply(plugin = "org.ajoberstar.grgit")
ext["gitCommitHash"] = try {
2020-07-14 04:50:59 +02:00
extensions.getByName<Grgit>("grgit").head()?.abbreviatedId
2019-08-26 06:45:03 +02:00
} catch (e: Exception) {
logger.warn("Error getting commit hash", e)
2020-07-14 04:50:59 +02:00
"no.git.id"
2019-08-26 06:45:03 +02:00
}
}