Plex-FAWE/build.gradle.kts

58 lines
1.6 KiB
Plaintext
Raw Normal View History

2019-08-26 04:45:03 +00: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 22:49:04 +00:00
4) If you still need help, ask on Discord! https://discord.gg/intellectualsites
2019-08-26 04:45:03 +00:00
Output files will be in [subproject]/build/libs
*******************************************
""")
2020-08-14 19:29:15 +00:00
var rootVersion by extra("1.16")
var revision: String by extra("")
var buildNumber by extra("")
var date: String by extra("")
2019-08-26 04:45:03 +00:00
ext {
val git: Grgit = Grgit.open {
dir = File("$rootDir/.git")
2019-08-26 04:45:03 +00:00
}
date = git.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
revision = "-${git.head().abbreviatedId}"
2021-04-18 18:42:32 +00:00
val commit: String? = git.head().abbreviatedId
buildNumber = if (project.hasProperty("buildnumber")) {
project.properties["buildnumber"] as String
2019-08-26 04:45:03 +00:00
} else {
commit.toString()
2019-11-07 10:28:17 +00:00
}
}
2019-08-26 04:45:03 +00:00
version = String.format("%s-%s", rootVersion, buildNumber)
if (!project.hasProperty("gitCommitHash")) {
apply(plugin = "org.ajoberstar.grgit")
ext["gitCommitHash"] = try {
2020-07-14 02:50:59 +00:00
extensions.getByName<Grgit>("grgit").head()?.abbreviatedId
2019-08-26 04:45:03 +00:00
} catch (e: Exception) {
logger.warn("Error getting commit hash", e)
2020-07-14 02:50:59 +00:00
"no.git.id"
2019-08-26 04:45:03 +00:00
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile::class) {
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
}
}
}
applyCommonConfiguration()