-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci skip] chore: use Kotlin Gradle and TOML library config (#46)
- Loading branch information
Showing
21 changed files
with
1,001 additions
and
432 deletions.
There are no files selected for viewing
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
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,15 @@ | ||
# TODO | ||
|
||
## General | ||
|
||
- [x] move versions to `gradle/libs.versions.toml` | ||
- [ ] Share logic in [`buildSrc`](https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:using_buildsrc) | ||
|
||
## Individual project jars | ||
|
||
- [ ] bukkit: should dev jar include missing core dependency? | ||
- [ ] fabric: devlibs jar is missing core dependency | ||
|
||
## uber-jar shenanigans | ||
- [x] fix missing `jars/` directory in `META-INF` | ||
- [x] fix incorrect `MANIFEST.MF` |
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,70 @@ | ||
plugins { | ||
id("java-library") | ||
alias(libs.plugins.minotaur) | ||
} | ||
|
||
val buildNum = System.getenv("NEXT_BUILD_NUMBER") ?: "SNAPSHOT" | ||
project.version = "${libs.versions.minecraft.get()}-$buildNum" | ||
|
||
tasks { | ||
jar { | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
|
||
subprojects { | ||
dependsOn(project.tasks.build) | ||
} | ||
|
||
archiveClassifier = "" | ||
|
||
// this is janky, but it works | ||
val manifestFiles = subprojects.filter({ it.name != "webmap" && it.name != "core" }).map { | ||
val regularFile = it.layout.buildDirectory.file("libs/${project.name}-${it.name}-${it.version}.jar") | ||
if (regularFile.isPresent) { | ||
zipTree(regularFile) | ||
} else { | ||
null | ||
} | ||
}.filterNotNull() | ||
|
||
from(manifestFiles) { | ||
exclude("META-INF/MANIFEST.MF") | ||
} | ||
|
||
// this is janky, but it works | ||
doFirst { | ||
manifestFiles.forEach { | ||
it.matching { include("META-INF/MANIFEST.MF") }.files.forEach { | ||
manifest.from(it) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
modrinth { | ||
autoAddDependsOn = false | ||
token = System.getenv("MODRINTH_TOKEN") | ||
projectId = "pl3xmap" | ||
versionName = "${project.version}" | ||
versionNumber = "${project.version}" | ||
versionType = "beta" | ||
uploadFile = rootProject.layout.buildDirectory.file("libs/${rootProject.name}-${project.version}.jar").get() | ||
//additionalFiles.addAll([ | ||
// rootProject.layout.buildDirectory.file("libs/${rootProject.name}-${project.version}-javadoc.jar").get(), | ||
// rootProject.layout.buildDirectory.file("libs/${rootProject.name}-${project.version}-sources.jar").get() | ||
//]) | ||
gameVersions.addAll(listOf(libs.versions.minecraft.get())) | ||
loaders.addAll(listOf("bukkit", "fabric", /*"forge",*/ "paper", "purpur", "quilt", "spigot", "folia")) | ||
changelog = System.getenv("COMMIT_MESSAGE") | ||
dependencies { | ||
required.project("fabric-api") | ||
//optional.project( | ||
// "pl3xmap-banners", | ||
// "pl3xmap-claims", | ||
// "pl3xmap-mobs", | ||
// "pl3xmap-signs", | ||
// "pl3xmap-warps", | ||
// "deathspots", | ||
//) | ||
} | ||
} |
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,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
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,80 @@ | ||
plugins { | ||
id("java") | ||
alias(libs.plugins.paperweight.userdev) | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
val buildNum = System.getenv("NEXT_BUILD_NUMBER") ?: "SNAPSHOT" | ||
project.version = "${libs.versions.minecraft.get()}-$buildNum" | ||
project.group = "net.pl3x.map.bukkit" | ||
|
||
base { | ||
archivesName = "${rootProject.name}-${project.name}" | ||
} | ||
|
||
repositories { | ||
maven("https://oss.sonatype.org/content/repositories/snapshots/") { | ||
name = "oss-sonatype-snapshots" | ||
mavenContent { | ||
snapshotsOnly() | ||
} | ||
} | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { | ||
name = "s01-sonatype-snapshots" | ||
mavenContent { | ||
snapshotsOnly() | ||
} | ||
} | ||
mavenCentral() | ||
maven("https://jitpack.io") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core", configuration = "shadow")) | ||
|
||
implementation(libs.cloudBrigadier) | ||
implementation(libs.cloudPaper) | ||
|
||
implementation(libs.adventurePlatformBukkit) | ||
|
||
paperweight.paperDevBundle(libs.versions.bukkit) | ||
} | ||
|
||
tasks { | ||
reobfJar { | ||
dependsOn(shadowJar) | ||
} | ||
|
||
// needed for below jank | ||
compileJava { | ||
dependsOn(":core:jar") | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
|
||
// this is janky, but it works | ||
manifest { | ||
from(project(":core").tasks.named<Jar>("shadowJar").get().manifest) | ||
} | ||
} | ||
|
||
build { | ||
dependsOn(reobfJar) | ||
} | ||
|
||
processResources { | ||
inputs.properties(mapOf( | ||
"name" to rootProject.name, | ||
"group" to project.group, | ||
"version" to project.version, | ||
"authors" to project.properties["authors"], | ||
"description" to project.properties["description"], | ||
"website" to project.properties["website"] | ||
)) | ||
|
||
filesMatching("plugin.yml") { | ||
expand(inputs.properties) | ||
} | ||
} | ||
} |
Oops, something went wrong.