Skip to content

Commit ce306b9

Browse files
committed
Move to gradle
1 parent eb52cde commit ce306b9

File tree

11 files changed

+432
-171
lines changed

11 files changed

+432
-171
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,21 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030
- name: Setup JDK
31-
uses: actions/setup-java@v4
31+
uses: actions/setup-java@v2
3232
with:
33+
distribution: 'adopt'
3334
java-version: '21'
34-
distribution: 'temurin'
35-
cache: maven
36-
- name: Build
35+
- name: Build with Gradle
3736
run: |
38-
mvn -B package --file pom.xml
37+
chmod 777 gradlew
38+
./gradlew clean jar javadocJar sourcesJar
3939
git_hash=$(git rev-parse --short "$GITHUB_SHA")
4040
echo "git_hash=$git_hash" >> $GITHUB_ENV
4141
echo "snapshotVersion=5.5-SNAPSHOT" >> $GITHUB_ENV
42-
echo "artifactPath=$(pwd)/builds" >> $GITHUB_ENV
42+
echo "artifactPath=$(pwd)/builds" >> $GITHUB_ENV
43+
- name: Publishing to Maven Repository
44+
run: |
45+
./gradlew publish
46+
env:
47+
MAVEN_USERNAME: ${{ secrets.MAVEN_NAME }}
48+
MAVEN_PASSWORD: ${{ secrets.MAVEN_SECRET }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ out/
88
out/*
99
.idea_modules/
1010
.idea_modules/*
11+
.gradle/
12+
build/

build.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
}
5+
6+
repositories {
7+
mavenLocal()
8+
maven { url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/') }
9+
maven { url = uri('https://maven.enginehub.org/repo/') }
10+
maven { url = uri('https://repo.maven.apache.org/maven2/') }
11+
}
12+
13+
dependencies {
14+
api libs.org.jetbrains.annotations
15+
compileOnly libs.com.sk89q.worldedit.worldedit.bukkit
16+
compileOnly libs.com.sk89q.worldguard.worldguard.core
17+
compileOnly libs.org.spigotmc.spigot.api
18+
}
19+
20+
group = 'net.raidstone'
21+
version = '1.18.1'
22+
description = 'WorldGuard Events'
23+
java.sourceCompatibility = JavaVersion.VERSION_21
24+
25+
java {
26+
withSourcesJar()
27+
withJavadocJar()
28+
}
29+
30+
publishing {
31+
repositories {
32+
maven {
33+
url = uri('https://mvn.mathiasd.fr/releases')
34+
credentials {
35+
username = System.getenv("MAVEN_USERNAME") ?: project.findProperty("MAVEN_USERNAME")
36+
password = System.getenv("MAVEN_PASSWORD") ?: project.findProperty("MAVEN_PASSWORD")
37+
}
38+
}
39+
}
40+
41+
publications {
42+
mavenJar(MavenPublication) {
43+
from components.java
44+
45+
artifactId = "wgevents"
46+
groupId = group
47+
version = version
48+
}
49+
}
50+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.configuration-cache=true

gradle/libs.versions.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
3+
4+
[versions]
5+
com-sk89q-worldedit-worldedit-bukkit = "7.3.0-SNAPSHOT"
6+
com-sk89q-worldguard-worldguard-core = "7.0.6-SNAPSHOT"
7+
org-jetbrains-annotations = "20.1.0"
8+
org-spigotmc-spigot-api = "1.16.5-R0.1-SNAPSHOT"
9+
10+
[libraries]
11+
com-sk89q-worldedit-worldedit-bukkit = { module = "com.sk89q.worldedit:worldedit-bukkit", version.ref = "com-sk89q-worldedit-worldedit-bukkit" }
12+
com-sk89q-worldguard-worldguard-core = { module = "com.sk89q.worldguard:worldguard-core", version.ref = "com-sk89q-worldguard-worldguard-core" }
13+
org-jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "org-jetbrains-annotations" }
14+
org-spigotmc-spigot-api = { module = "org.spigotmc:spigot-api", version.ref = "org-spigotmc-spigot-api" }

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Nov 30 23:22:51 CET 2024
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

gradlew

Lines changed: 252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)