-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: BT (calcastor/mame) <[email protected]>
- Loading branch information
Showing
16 changed files
with
445 additions
and
229 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
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,65 @@ | ||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
|
||
plugins { | ||
id("buildlogic.java-conventions") | ||
`maven-publish` | ||
id("com.gradleup.shadow") | ||
} | ||
|
||
tasks.named<ShadowJar>("shadowJar") { | ||
archiveFileName = "ingame.jar" | ||
destinationDirectory = rootProject.projectDir.resolve("build/libs") | ||
|
||
minimize() | ||
|
||
dependencies { | ||
exclude(dependency("org.jetbrains:annotations")) | ||
} | ||
|
||
relocate("co.aikar.taskchain", "rip.bolt.ingame.taskchain") | ||
|
||
exclude("META-INF/**") | ||
} | ||
|
||
publishing { | ||
publications.create<MavenPublication>("ingame") { | ||
groupId = project.group as String | ||
artifactId = project.name | ||
version = project.version as String | ||
|
||
artifact(tasks["shadowJar"]) | ||
} | ||
repositories { | ||
maven { | ||
name = "ghPackages" | ||
url = uri("https://maven.pkg.github.com/bolt-rip/ingame") | ||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks { | ||
processResources { | ||
filesMatching(listOf("plugin.yml")) { | ||
expand( | ||
"name" to project.name, | ||
"description" to project.description, | ||
"mainClass" to "rip.bolt.ingame.Ingame", | ||
"version" to project.version, | ||
"commitHash" to project.latestCommitHash(), | ||
"url" to "https://github.com/bolt-rip/" | ||
) | ||
} | ||
} | ||
|
||
named("jar") { | ||
enabled = false | ||
} | ||
|
||
named("build") { | ||
dependsOn(shadowJar) | ||
} | ||
} |
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 @@ | ||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.0") | ||
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.0.BETA4") | ||
implementation("de.skuzzle.restrictimports:restrict-imports-gradle-plugin:2.6.0") | ||
} |
70 changes: 70 additions & 0 deletions
70
buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts
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 { | ||
`java-library` | ||
id("com.diffplug.spotless") | ||
id("de.skuzzle.restrictimports") | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven("https://www.jitpack.io") | ||
maven("https://oss.sonatype.org/content/repositories/snapshots/") // Snapshots | ||
maven("https://repo.pgm.fyi/snapshots/") // PGM-specific depdencies | ||
maven("https://repo.papermc.io/repository/maven-public/") // Needed for bungeecord-chat | ||
maven("https://repo.ashcon.app/content/repositories/snapshots/") | ||
maven("https://repo.aikar.co/content/groups/aikar/") | ||
} | ||
|
||
dependencies { | ||
api("tc.oc.occ:Dispense:1.0.0-SNAPSHOT") | ||
api("com.squareup.retrofit2:retrofit:2.9.0") | ||
api("com.squareup.retrofit2:converter-jackson:2.9.0") | ||
api("com.squareup.retrofit2:converter-gson:2.9.0") | ||
api("co.aikar:taskchain-bukkit:3.7.2") | ||
api("org.java-websocket:Java-WebSocket:1.5.1") | ||
|
||
implementation("org.incendo:cloud-annotations:2.0.0") | ||
implementation("org.jetbrains:annotations:22.0.0") | ||
|
||
compileOnly("app.ashcon:sportpaper:1.8.8-R0.1-SNAPSHOT") | ||
compileOnly("tc.oc.pgm:core:0.16-SNAPSHOT") | ||
compileOnly("dev.pgm:Events:1.0.0-SNAPSHOT") | ||
} | ||
|
||
group = "rip.bolt" | ||
version = "1.0.0-SNAPSHOT" | ||
|
||
tasks { | ||
withType<JavaCompile>() { | ||
options.encoding = "UTF-8" | ||
} | ||
withType<Javadoc>() { | ||
options.encoding = "UTF-8" | ||
} | ||
} | ||
|
||
spotless { | ||
ratchetFrom = "origin/master" | ||
java { | ||
removeUnusedImports() | ||
palantirJavaFormat("2.47.0").style("GOOGLE").formatJavadoc(true) | ||
} | ||
} | ||
|
||
|
||
restrictImports { | ||
group { | ||
reason = "Use org.jetbrains.annotations to add annotations" | ||
bannedImports = listOf("javax.annotation.**") | ||
} | ||
group { | ||
reason = "Use tc.oc.pgm.util.Assert to add assertions" | ||
bannedImports = listOf("com.google.common.base.Preconditions.**", "java.util.Objects.requireNonNull") | ||
} | ||
} |
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,16 @@ | ||
import org.gradle.api.Project | ||
import java.io.ByteArrayOutputStream | ||
|
||
|
||
fun Project.latestCommitHash(): String { | ||
return runGitCommand(listOf("rev-parse", "--short", "HEAD")) | ||
} | ||
|
||
fun Project.runGitCommand(args: List<String>): String { | ||
val byteOut = ByteArrayOutputStream() | ||
exec { | ||
commandLine = listOf("git") + args | ||
standardOutput = byteOut | ||
} | ||
return byteOut.toString(Charsets.UTF_8.name()).trim() | ||
} |
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.10-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.