Skip to content
Open
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
24 changes: 14 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,41 @@ jobs:
fetch-depth: 0

- name: Set BUILD_VERSION
run: echo "BUILD_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))-b$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
run: |
echo "BUILD_VERSION=$(
git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null \
|| echo "5.0.0"
)-b$GITHUB_RUN_NUMBER" >> "$GITHUB_ENV"

- name: Restore Maven cache
- name: Restore cache
id: cache-restore
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./.github/workflows/buildtools.sh') }}
key: ${{ runner.os }}-maven-${{ hashFiles('./.github/workflows/buildtools.sh') }}
restore-keys: |
${{ runner.os }}-maven-${{ secrets.CACHE_VERSION }}-
${{ runner.os }}-maven

- name: Set up JDK 17/21
- name: Set up JDK 17/21/25
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
8
17
21
25
cache: gradle

- name: Run BuildTools
run: |
bash ./.github/workflows/buildtools.sh

- name: Build
run: |
mvn clean package --batch-mode -Drevision=$BUILD_VERSION
mv orebfuscator-plugin/target/orebfuscator-*.jar ./
./gradlew build -PbuildVersion="$BUILD_VERSION"
mv orebfuscator-bukkit/build/libs/orebfuscator-*.jar ./

- name: Save Maven cache
- name: Save cache
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
Expand All @@ -57,5 +61,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: orebfuscator-plugin
name: orebfuscator-bukkit
path: ./orebfuscator-*.jar
42 changes: 21 additions & 21 deletions .github/workflows/buildtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ build () {
checkVersion () {
echo Checking version $1

if [ ! -d ~/.m2/repository/org/spigotmc/spigot/$1-R0.1-SNAPSHOT ]; then
build $1 $2
if [ ! -d ~/.m2/repository/org/spigotmc/spigot/$1-$2-SNAPSHOT ]; then
build $1 $3
fi
}

checkVersion "1.16.5" "8"
checkVersion "1.17.1" "17"
checkVersion "1.18.1" "17"
checkVersion "1.18.2" "17"
checkVersion "1.19.2" "17"
checkVersion "1.19.3" "17"
checkVersion "1.19.4" "17"
checkVersion "1.20.1" "17"
checkVersion "1.20.2" "17"
checkVersion "1.20.4" "17"
checkVersion "1.20.6" "21"
checkVersion "1.21.1" "21"
checkVersion "1.21.3" "21"
checkVersion "1.21.4" "21"
checkVersion "1.21.5" "21"
checkVersion "1.21.8" "21"
checkVersion "1.21.10" "21"
checkVersion "1.21.11" "21"
checkVersion "26.1" "25"
checkVersion "1.16.5" "R0.1" "8"
checkVersion "1.17.1" "R0.1" "17"
checkVersion "1.18.1" "R0.1" "17"
checkVersion "1.18.2" "R0.1" "17"
checkVersion "1.19.2" "R0.1" "17"
checkVersion "1.19.3" "R0.1" "17"
checkVersion "1.19.4" "R0.1" "17"
checkVersion "1.20.1" "R0.1" "17"
checkVersion "1.20.2" "R0.1" "17"
checkVersion "1.20.4" "R0.1" "17"
checkVersion "1.20.6" "R0.1" "21"
checkVersion "1.21.1" "R0.1" "21"
checkVersion "1.21.3" "R0.1" "21"
checkVersion "1.21.4" "R0.1" "21"
checkVersion "1.21.5" "R0.1" "21"
checkVersion "1.21.8" "R0.1" "21"
checkVersion "1.21.10" "R0.1" "21"
checkVersion "1.21.11" "R0.2" "21"
checkVersion "26.1.1" "R0.1" "25"
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,45 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Maven cache
uses: actions/cache@v4

- name: Restore cache
id: cache-restore
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./.github/workflows/buildtools.sh') }}
key: ${{ runner.os }}-maven-${{ hashFiles('./.github/workflows/buildtools.sh') }}
restore-keys: |
${{ runner.os }}-maven-${{ secrets.CACHE_VERSION }}-
- name: Set up JDK 8/17/21
${{ runner.os }}-maven

- name: Set up JDK 17/21/25
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
8
17
21
25
cache: gradle

- name: Run BuildTools
run: |
bash ./.github/workflows/buildtools.sh

- name: Build
run: |
mvn clean package --batch-mode -Drevision=$RELEASE_VERSION
mv orebfuscator-plugin/target/orebfuscator-*.jar ./
./gradlew build -PbuildVersion="$RELEASE_VERSION"
mv orebfuscator-bukkit/build/libs/orebfuscator-*.jar ./

- name: Save cache
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ~/.m2/repository
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

- name: Release artifacts
uses: ncipollo/release-action@v1
with:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@ out/

# ---- VS Code (optional) ----
.vscode/

# ---- Gradle ----
.gradle
**/build/
!**/src/**/build/
gradle-app.setting
!gradle-wrapper.jar
!gradle-wrapper.properties
.gradletasknamecache
48 changes: 48 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
allprojects {
group = "dev.imprex"
version = findProperty("buildVersion") ?: "5.0.0-b0"
description = "High-Performance Anti X-Ray"
}

subprojects {
apply plugin: 'java'
apply plugin: 'java-library'

repositories {
mavenCentral()
maven {
name = 'spigot'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'papermc'
url = 'https://repo.papermc.io/repository/maven-public/'
}
maven {
name = 'codemc'
url = 'https://repo.codemc.io/repository/maven-releases/'
}
mavenLocal()
}

dependencies {
compileOnly(libs.jspecify)
compileOnly(libs.annotations)

testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform)
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

tasks.test {
useJUnitPlatform()
}
}
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Done to increase the memory available to gradle.
org.gradle.parallel=true
org.gradle.daemon=true

org.gradle.configuration-cache=false
org.gradle.vfs.watch=false
org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8
55 changes: 55 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[versions]
# gradle plugins
shadow = "9.4.1"

# test
junit = "5.13.4"

# common
jspecify = "1.0.0"
annotations = "26.0.2"

# core
netty = "4.1.90.Final"
guava = "33.5.0-jre"
gson = "2.13.2"
snakeyaml = "2.5"
joml = "1.10.8"
lz4 = "1.10.2"

# bukkit
spigot = "1.16.1-R0.1-SNAPSHOT"
paper = "1.20.1-R0.1-SNAPSHOT"
folia = "1.20.1-R0.1-SNAPSHOT"
bstats = "3.1.0"
protocollib = "5.3.0"

[plugins]
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }

[libraries]

# test
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" }
junit-platform = { module = "org.junit.platform:junit-platform-launcher" }

# common
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }

# core
netty-bom = { module = "io.netty:netty-bom", version.ref = "netty" }
netty-buffer = { module = "io.netty:netty-buffer" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" }
joml = { module = "org.joml:joml", version.ref = "joml" }
lz4 = { module = "at.yawk.lz4:lz4-java", version.ref = "lz4" }

# bukkit
spigot = { module = "org.spigotmc:spigot-api", version.ref = "spigot" }
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
folia = { module = "dev.folia:folia-api", version.ref = "folia" }
bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" }
protocollib = { module = "net.dmulloy2:ProtocolLib", version.ref = "protocollib" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Jan 28 20:48:32 CET 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading