2021-06-14 20:29:53 +02:00
|
|
|
import org.yatopiamc.toothpick.*
|
|
|
|
|
2021-01-21 11:58:52 +01:00
|
|
|
plugins {
|
|
|
|
`java-library`
|
|
|
|
`maven-publish`
|
2021-06-14 20:29:53 +02:00
|
|
|
id("org.yatopiamc.toothpick") version "1.0.1-SNAPSHOT"
|
2021-01-21 11:58:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
toothpick {
|
|
|
|
forkName = "Yatopia"
|
|
|
|
groupId = "org.yatopiamc"
|
|
|
|
val versionTag = System.getenv("BUILD_NUMBER")
|
|
|
|
?: "\"${gitCmd("rev-parse", "--short", "HEAD").output}\""
|
2021-02-01 11:44:34 +01:00
|
|
|
if(!System.getenv("BRANCH_NAME").isNullOrEmpty()) {
|
|
|
|
currentBranch = System.getenv("BRANCH_NAME")
|
|
|
|
} else if (!System.getenv("GITHUB_HEAD_REF").isNullOrEmpty()) {
|
|
|
|
currentBranch = System.getenv("GITHUB_HEAD_REF")
|
|
|
|
} else if (!System.getenv("GITHUB_REF").isNullOrEmpty()) {
|
|
|
|
currentBranch = System.getenv("GITHUB_REF").substring("refs/heads/".length)
|
|
|
|
} else {
|
|
|
|
currentBranch = gitCmd("rev-parse", "--abbrev-ref", "HEAD").output.toString().trim()
|
|
|
|
if(currentBranch == "HEAD") logger.warn("You are currently in \'detached HEAD\' state, branch information isn\'t available")
|
|
|
|
}
|
|
|
|
forkVersion = "git-$forkName-$currentBranch-$versionTag"
|
2021-01-21 11:58:52 +01:00
|
|
|
forkUrl = "https://github.com/YatopiaMC/Yatopia"
|
|
|
|
|
2021-06-14 21:11:18 +02:00
|
|
|
minecraftVersion = "1.17"
|
|
|
|
nmsPackage = "1_17_R1"
|
2021-01-21 11:58:52 +01:00
|
|
|
nmsRevision = "R0.1-SNAPSHOT"
|
|
|
|
|
|
|
|
upstream = "Paper"
|
|
|
|
upstreamBranch = "origin/master"
|
|
|
|
|
|
|
|
paperclipName = "yatopia-$minecraftVersion-paperclip.jar"
|
|
|
|
|
|
|
|
patchCreditsOutput = "PATCHES.md"
|
|
|
|
patchCreditsTemplate = ".template.md"
|
|
|
|
|
|
|
|
server {
|
|
|
|
project = project(":$forkNameLowercase-server")
|
|
|
|
patchesDir = rootProject.projectDir.resolve("patches/server")
|
|
|
|
}
|
|
|
|
api {
|
|
|
|
project = project(":$forkNameLowercase-api")
|
|
|
|
patchesDir = rootProject.projectDir.resolve("patches/api")
|
|
|
|
}
|
2021-02-01 11:44:34 +01:00
|
|
|
|
|
|
|
logger.lifecycle("Configured version string: $calcVersionString")
|
2021-01-21 11:58:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven("https://repo.aikar.co/content/groups/aikar/")
|
|
|
|
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
|
|
|
|
maven("https://libraries.minecraft.net")
|
|
|
|
maven("https://repo.codemc.io/repository/maven-public/")
|
2021-04-21 23:26:49 +02:00
|
|
|
maven("https://jitpack.io")
|
2021-06-14 20:29:53 +02:00
|
|
|
maven("https://mvn.thearcanebrony.net/maven-public/")
|
2021-01-21 11:58:52 +01:00
|
|
|
mavenLocal()
|
2021-01-22 15:13:44 +01:00
|
|
|
maven("${rootProjectDir}/.repository")
|
2021-01-21 11:58:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
2021-06-14 21:11:18 +02:00
|
|
|
if(JavaVersion.VERSION_16 > JavaVersion.current()){
|
|
|
|
error("This build must be run with Java 16 or newer")
|
2021-01-21 11:58:52 +01:00
|
|
|
}
|
2021-06-14 21:11:18 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_16
|
|
|
|
targetCompatibility = JavaVersion.VERSION_16
|
2021-01-21 11:58:52 +01:00
|
|
|
withSourcesJar()
|
|
|
|
}
|
2021-06-14 20:29:53 +02:00
|
|
|
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
|
|
options.isIncremental = true
|
|
|
|
options.isFork = true
|
|
|
|
options.encoding = "UTF-8"
|
2021-06-14 21:11:18 +02:00
|
|
|
options.release.set(16)
|
2021-06-14 20:29:53 +02:00
|
|
|
}
|
2021-01-21 11:58:52 +01:00
|
|
|
}
|
2021-06-14 20:29:53 +02:00
|
|
|
|