-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit converts the project from Maven to Gradle by removing the old Maven-related files such as `pom.xml` and the Maven Wrapper, and replacing them with their Gradle counterparts (more or less). Comparing the artifacts from Maven and Gradle indicates no significant differences in the resulting jar-files, and a quick test of the plugin shows that things are still working as expected. Bits of `build.gradle.kts` may need a bit of a tune-up later down the road, e.g. the test sources "hack" put in place. It may be cleaner to omit this hack and just suck up having to repeat dependencies, but in that case, it might be better to embrace the "libs" file instead of having to repeat dependencies in full. Note that this commit changes the caching mechanism used in the GitHub Actions build workflow, opting for the one built into `setup-java`.
- Loading branch information
1 parent
511d16f
commit f57f10e
Showing
14 changed files
with
424 additions
and
763 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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
# Java | ||
*.class | ||
|
||
# Maven | ||
target/ | ||
|
||
# Artifacts | ||
*.jar | ||
*.zip | ||
# Gradle | ||
.gradle/ | ||
build/ | ||
|
||
# IntelliJ | ||
.idea/ | ||
|
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,69 @@ | ||
plugins { | ||
id("java-library") | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
} | ||
|
||
group = "com.garbagemule" | ||
version = "0.107.1-SNAPSHOT" | ||
|
||
repositories { | ||
mavenLocal() | ||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") | ||
maven("https://jitpack.io") | ||
maven("https://repo.maven.apache.org/maven2/") | ||
} | ||
|
||
dependencies { | ||
compileOnly("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT") | ||
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") | ||
api("org.bstats:bstats-bukkit:2.2.1") | ||
|
||
testImplementation("junit:junit:4.13.2") | ||
testImplementation("org.hamcrest:hamcrest-all:1.3") | ||
testImplementation("org.mockito:mockito-core:3.12.4") | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
} | ||
|
||
sourceSets { | ||
test { | ||
// This is a bit of a hack. It ensures that the dependencies for the | ||
// "main" source set are available to the test suite. Without it, the | ||
// dependencies would have to be listed twice, and even that doesn't | ||
// seem to work with the currently used version of Mockito. | ||
configurations.testImplementation.configure { | ||
extendsFrom(configurations.compileOnly.get()) | ||
} | ||
} | ||
} | ||
|
||
tasks { | ||
processResources { | ||
filesMatching("plugin.yml") { | ||
expand("project" to mapOf( | ||
"name" to "MobArena", | ||
"version" to version, | ||
)) | ||
} | ||
} | ||
|
||
shadowJar { | ||
minimize() | ||
|
||
relocate("org.bstats", "com.garbagemule.MobArena.metrics") | ||
|
||
archiveBaseName = "MobArena" | ||
archiveClassifier = "" | ||
archiveVersion = "" | ||
} | ||
|
||
// We're using shadowJar, so we can skip the regular jar task. | ||
jar { enabled = false } | ||
|
||
// Let the build task produce the final artifact. | ||
build { dependsOn(shadowJar) } | ||
} |
Binary file not shown.
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 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.