Skip to content

Commit

Permalink
1.18.2 support (#12)
Browse files Browse the repository at this point in the history
* Start work

* WIP

* Remove particle tracers

* Update maven.yml

* Update maven.yml

* Remove NMS utils

* Update pom.xml

* Update maven.yml

* Initial gradle auto import

* Last few updates

* Finish switch to gradle

* Changing permission of gradlew

* Update gradle.yml

* Update gradle.yml

* Update gradle.yml

* Update build

* Update build.gradle.kts
  • Loading branch information
TylerS1066 authored Jul 4, 2024
1 parent 3a0c0d9 commit 3ec607b
Show file tree
Hide file tree
Showing 19 changed files with 514 additions and 358 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Java CI

on:
workflow_dispatch:
push:
pull_request:

jobs:
# Build AP-Turrets
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout AP-Turrets
uses: actions/checkout@v4
with:
path: AP-Turrets
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Checkout Movecraft-Combat
uses: actions/checkout@v3
with:
repository: 'APDevTeam/Movecraft-Combat'
path: Movecraft-Combat
ref: 'main'
- name: Checkout Movecraft-WorldGuard
uses: actions/checkout@v3
with:
repository: 'APDevTeam/Movecraft-WorldGuard'
path: Movecraft-WorldGuard
ref: 'main'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Cache Maven packages
id: cacheMain
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2

# Build Movecraft-Combat
- name: Build Movecraft-Combat
run: mvn -B package -T 1C --file Movecraft-Combat/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Build Movecraft-WorldGuard
- name: Build Movecraft-WorldGuard
run: mvn -B package -T 1C --file Movecraft-WorldGuard/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build AP-Turrets
run: cd AP-Turrets && ./gradlew clean build

- name: Stage jar
run: mkdir staging && cp AP-Turrets/build/libs/AP-Turrets.jar staging && mv staging/AP-Turrets.jar staging/AP-Turrets_$GITHUB_SHA.jar
- name: Upload jar
uses: actions/upload-artifact@v4
with:
name: AP-Turrets_Dev-Build
path: staging/AP-Turrets_*.jar
105 changes: 0 additions & 105 deletions .github/workflows/maven.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,27 @@ hs_err_pid*
target/*
libs/*
.vscode/*

### GitHub example for gradle
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AP-Turrets
Mounted Guns!

**Built and tested in Java 11 on Spigot 1.14.4 with Movecraft 8.x**
**Built and tested in Java 17 on Paper 1.18.2 with Movecraft 8.x**

Dev builds are provided with no claim to functionality at the [GitHub actions page](https://github.com/APDevTeam/Ap-Turrets/actions).

Expand Down
57 changes: 57 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
`java-library`
`maven-publish`
id("io.papermc.paperweight.userdev") version "1.7.1"
id("io.github.0ffz.github-packages") version "1.2.1"
}

repositories {
gradlePluginPortal()
mavenLocal()
githubPackage("apdevteam/movecraft")
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
maven {
url = uri("https://maven.enginehub.org/repo/")
}
maven {
url = uri("https://jitpack.io")
}
}

dependencies {
api("org.jetbrains:annotations-java5:24.1.0")
paperweight.paperDevBundle("1.18.2-R0.1-SNAPSHOT")
compileOnly("net.countercraft:movecraft:+")
compileOnly(files("../Movecraft-WorldGuard/target/Movecraft-WorldGuard.jar"))
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.7")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
}

group = "snowleapord.github.com"
version = "3.0.0_beta-2"
description = "APTurrets"

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

tasks.assemble {
dependsOn(tasks.reobfJar)
}

tasks.reobfJar {
outputJar = layout.buildDirectory.file("libs/AP-Turrets.jar")
}

tasks.processResources {
from(rootProject.file("LICENSE.md"))
filesMatching("*.yml") {
expand(mapOf("projectVersion" to project.version))
}
}
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-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3ec607b

Please sign in to comment.