Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed May 7, 2024
1 parent 040724b commit e88cac2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins {
}

val jdkVersion = property("jdkVersion").toString().toInt()
val projectName = property("projectName").toString()
val projectRepo = property("projectRepo").toString()

kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(jdkVersion)
Expand Down Expand Up @@ -41,7 +43,7 @@ allprojects {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/${property("projectRepo")}")
url = uri("https://maven.pkg.github.com/$projectRepo")

credentials {
username = System.getenv("GITHUB_USERNAME")
Expand Down Expand Up @@ -90,18 +92,18 @@ subprojects {
}

paperweight {
serverProject = project(":${property("projectName").toString().lowercase()}-server")
serverProject = project(":${projectName.lowercase()}-server")

remapRepo = "https://repo.papermc.io/repository/maven-public/"
decompileRepo = "https://repo.papermc.io/repository/maven-public/"

usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("${property("projectName")}-API"))
apiOutputDir.set(layout.projectDirectory.dir("$projectName-API"))

serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("${property("projectName")}-Server"))
serverOutputDir.set(layout.projectDirectory.dir("$projectName-Server"))
}

patchTasks.register("generatedApi") {
Expand All @@ -115,7 +117,7 @@ paperweight {
isBareDirectory = true
upstreamDirPath = "Paper-MojangAPI"
patchDir = layout.projectDirectory.dir("patches/mojang-api")
outputDir = layout.projectDirectory.dir("${property("projectName")}-MojangAPI")
outputDir = layout.projectDirectory.dir("$projectName-MojangAPI")
}
}
}
Expand Down Expand Up @@ -146,19 +148,19 @@ tasks {
}

generateDevelopmentBundle {
apiCoordinates.set("${group}:${property("projectName").toString().lowercase()}-api")
mojangApiCoordinates.set("${group}:${property("projectName").toString().lowercase()}-mojangapi")
apiCoordinates.set("${group}:${projectName.lowercase()}-api")
mojangApiCoordinates.set("${group}:${projectName.lowercase()}-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://maven.pkg.github.com/${property("projectRepo")}",
"https://maven.pkg.github.com/$projectRepo",
"https://papermc.io/repo/repository/maven-public/"
)
}

clean {
doLast {
projectDir.resolve(".gradle/caches").deleteRecursively()
listOf("${property("projectName")}-API", "${property("projectName")}-MojangAPI", "${property("projectName")}-Server", "paper-api-generator", "run").forEach {
listOf("$projectName-API", "$projectName-MojangAPI", "$projectName-Server", "paper-api-generator", "run").forEach {
projectDir.resolve(it).deleteRecursively()
}

Expand Down

0 comments on commit e88cac2

Please sign in to comment.