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.

102 Zeilen
3.1 KiB
Plaintext

2019-08-26 06:45:03 +02:00
import org.ajoberstar.grgit.Grgit
import java.time.format.DateTimeFormatter
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
2021-11-22 16:56:20 +01:00
import java.net.URI
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.2.0"
id("xyz.jpenilla.run-paper") version "2.0.1"
2021-11-22 16:56:20 +01:00
}
2019-08-26 06:45:03 +02:00
if (!File("$rootDir/.git").exists()) {
logger.lifecycle("""
**************************************************************************************
You need to fork and clone this repository! Don't download a .zip file.
If you need assistance, consult the GitHub docs: https://docs.github.com/get-started/quickstart/fork-a-repo
**************************************************************************************
""".trimIndent()
).also { kotlin.system.exitProcess(1) }
}
2019-08-26 06:45:03 +02:00
logger.lifecycle("""
*******************************************
You are building FastAsyncWorldEdit!
If you encounter trouble:
1) Read COMPILING.adoc if you haven't yet
2019-08-26 06:45:03 +02:00
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
2023-02-07 23:25:17 +01:00
var rootVersion by extra("2.5.3")
var snapshot by extra("SNAPSHOT")
2020-08-14 21:29:15 +02:00
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 {
dir = File("$rootDir/.git")
2019-08-26 06:45:03 +02:00
}
date = git.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
revision = "-${git.head().abbreviatedId}"
buildNumber = if (project.hasProperty("buildnumber")) {
2021-12-21 16:27:46 +01:00
snapshot + "-" + project.properties["buildnumber"] as String
2019-08-26 06:45:03 +02:00
} else {
2021-11-22 14:35:40 +01:00
project.properties["snapshot"] as String
2019-11-07 11:28:17 +01:00
}
}
2023-02-07 23:25:17 +01:00
version = String.format("%s-%s", rootVersion, buildNumber)
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
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile::class) {
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
}
tasks.withType(Test::class) {
testLogging {
events(FAILED)
exceptionFormat = FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
}
}
applyCommonConfiguration()
2021-11-22 16:56:20 +01:00
2022-06-20 17:56:51 +02:00
tasks {
runServer {
minecraftVersion("1.19")
pluginJars(project(":worldedit-bukkit").file("build/libs/FastAsyncWorldEdit-Bukkit-$version.jar"))
}
}
2021-11-22 16:56:20 +01:00
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}