Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Builds a Java project with Maven
# Builds a Java project with Gradle
name: Build

on:
Expand All @@ -20,7 +20,9 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew build
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ out/
# Maven
target/

# Gradle
.gradle/
build/

# Common working directory
run/
62 changes: 62 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
`java-library`
// Shade plugin
id("com.gradleup.shadow") version "9.3.0"
}

repositories {
mavenCentral()
// Spigot
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
// Jitpack
maven("https://jitpack.io")
// Floodgate / Geyser
maven("https://repo.opencollab.dev/main/")
}

dependencies {
implementation(libs.dev.dejvokep.boosted.yaml)
implementation(libs.com.github.earthcow.javadiscordwebhook)

compileOnly(files("libs/ThemisAPI.jar"))
compileOnly(libs.org.spigotmc.spigot.api)
compileOnly(libs.org.jetbrains.annotations)
compileOnly(libs.org.geysermc.floodgate.api)
}

group = "xyz.earthcow"
version = "0.3.0"

tasks.withType<JavaCompile>() {
options.encoding = "UTF-8"
}

tasks.withType<Javadoc>() {
options.encoding = "UTF-8"
}

tasks.processResources {
val props = mapOf(
"name" to project.name,
"version" to project.version,
)

inputs.properties(props)

filesMatching("plugin.yml") {
expand(props)
}
}

tasks.shadowJar {
// Overwrite default jar
archiveClassifier.set("")
// Relocate shaded dependencies to internal libs directory
relocate("dev.dejvokep.boostedyaml", "xyz.earthcow.themistodiscord.libs.boostedyaml")
// Exclude annotation packages from the uber jar file
exclude("org/intellij/**", "org/jetbrains/**")
}

tasks.build {
dependsOn(tasks.shadowJar)
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.configuration-cache=true
16 changes: 16 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
com-github-earthcow-javadiscordwebhook = "master-SNAPSHOT"
dev-dejvokep-boosted-yaml = "1.3.7"
org-geysermc-floodgate-api = "2.2.4-SNAPSHOT"
org-jetbrains-annotations = "24.1.0"
org-spigotmc-spigot-api = "1.17-R0.1-SNAPSHOT"

[libraries]
com-github-earthcow-javadiscordwebhook = { module = "com.github.EarthCow:JavaDiscordWebhook", version.ref = "com-github-earthcow-javadiscordwebhook" }
dev-dejvokep-boosted-yaml = { module = "dev.dejvokep:boosted-yaml", version.ref = "dev-dejvokep-boosted-yaml" }
org-geysermc-floodgate-api = { module = "org.geysermc.floodgate:api", version.ref = "org-geysermc-floodgate-api" }
org-jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "org-jetbrains-annotations" }
org-spigotmc-spigot-api = { module = "org.spigotmc:spigot-api", version.ref = "org-spigotmc-spigot-api" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
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-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
248 changes: 248 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading