-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Mastriel/main
Convert to Kotlin Build Scripts, fix publishing
- Loading branch information
Showing
16 changed files
with
175 additions
and
168 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT") | ||
|
||
compileOnly(project(":NMS:Wrapper")) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT") | ||
|
||
compileOnly(project(":NMS:Wrapper")) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT") | ||
|
||
compileOnly(project(":NMS:Wrapper")) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT") | ||
|
||
compileOnly(project(":NMS:Wrapper")) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
} | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.20.3-R0.1-SNAPSHOT") | ||
|
||
compileOnly(project(":NMS:Wrapper")) | ||
} | ||
tasks.reobfJar {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies { | ||
compileOnly("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
plugins { | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
id("io.papermc.paperweight.userdev") version "1.5.11" | ||
`maven-publish` | ||
java | ||
} | ||
|
||
|
||
|
||
allprojects { | ||
apply(plugin = "java") | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "com.github.johnrengelman.shadow") | ||
|
||
group = "com.github.Outspending" | ||
version = "0.0.1" | ||
|
||
|
||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
|
||
} | ||
|
||
// The file for publication. | ||
val reobfBuildFile = project.layout.buildDirectory.file("libs/${project.name}-${project.version}.jar") | ||
|
||
// Check if a project has the reobfJar task. | ||
fun Project.usesReobfuscatedJar() : Boolean { | ||
return try { | ||
tasks.named("reobfJar") | ||
true | ||
} catch (ignored: UnknownTaskException) { | ||
false | ||
} | ||
} | ||
|
||
// needs to be in after evaluate, otherwise the project's reobfJar task (if it exists) | ||
// won't be there. | ||
afterEvaluate { | ||
|
||
// publish NMS apis, and the main project API | ||
// this is required because consumers require getting the POM | ||
// files from this project's dependencies, even if they"re completely | ||
// shaded and included in this file. | ||
// | ||
// not optimal because this leads to more network calls when downloading | ||
// the api for the first time. ideally we only publish the main api. | ||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
groupId = "com.github.Outspending" | ||
artifactId = project.name | ||
|
||
|
||
if (usesReobfuscatedJar()) artifact(reobfBuildFile) | ||
from(components["java"]) | ||
} | ||
} | ||
} | ||
|
||
// Throws an error if we don"t explicitly say we're using the output | ||
// of reobfJar in the final build. | ||
tasks.named("publishMavenPublicationToMavenLocal") { | ||
if (usesReobfuscatedJar()) { | ||
dependsOn(tasks.reobfJar) | ||
} | ||
} | ||
|
||
// Don't use the task if it doesn't exist on this project | ||
if (usesReobfuscatedJar()) { | ||
tasks.reobfJar { | ||
outputJar.set(reobfBuildFile) | ||
} | ||
} | ||
|
||
// Run reobfJar on applicable projects | ||
tasks.assemble { | ||
if (usesReobfuscatedJar()) dependsOn(tasks.reobfJar) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "papermc-repo" | ||
url = uri("https://repo.papermc.io/repository/maven-public/") | ||
} | ||
maven { | ||
name = "sonatype" | ||
url = uri("https://oss.sonatype.org/content/groups/public/") | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly("org.projectlombok:lombok:1.18.30") | ||
annotationProcessor("org.projectlombok:lombok:1.18.30") | ||
} | ||
} | ||
|
||
|
||
val nmsVersions = listOf("1.19_R2", "1.19_R3", "1.20_R1", "1.20_R2", "1.20_R3") | ||
|
||
dependencies { | ||
paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT") | ||
|
||
implementation(project(":NMS:Wrapper")) | ||
for (version in nmsVersions) { | ||
implementation(project(":NMS:${version}")) | ||
} | ||
} | ||
|
||
|
||
tasks.wrapper { | ||
gradleVersion = "8.1.1" | ||
distributionType = Wrapper.DistributionType.ALL | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
rootProject.name = "BiomesAPI" | ||
|
||
include("NMS:Wrapper") | ||
include("NMS:1.19_R2") | ||
include("NMS:1.19_R3") | ||
include("NMS:1.20_R1") | ||
include("NMS:1.20_R2") | ||
include("NMS:1.20_R3") | ||
|