Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile against Paper #282

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
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
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 'master'
- 'dev/paper-modules' # TODO remove later
tags-ignore:
- '**'
paths-ignore:
Expand All @@ -21,25 +22,16 @@ jobs:
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'

# Install Spigot dependencies if necessary.
- name: Install Spigot Dependencies
run: . scripts/install_spigot_dependencies.sh
- uses: gradle/actions/setup-gradle@v4

- name: Build With Maven
run: mvn -e clean package -am -P all
- name: Build with Gradle
run: ./gradlew build

# Upload artifacts
- name: Upload Distributable Jar
id: upload-final
uses: actions/upload-artifact@v4
with:
name: dist
path: ./target/*.jar
- name: Upload API Jar
id: upload-api
uses: actions/upload-artifact@v4
with:
name: api
path: ./api/target/openinvapi*.jar
path: ./dist/*
28 changes: 13 additions & 15 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,32 @@ jobs:
needs: [ run-ci ]
runs-on: ubuntu-latest
steps:
# Fetch all history - used to assemble changelog.
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Release Variables
run: bash ./scripts/set_release_env.sh

- name: Download build
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Package resource pack
run: |-
pushd resource-pack
zip -r ../dist/openinv-legibility-pack.zip .
popd

- name: Create Release
id: create-release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.VERSIONED_NAME }}
body: ${{ env.GENERATED_CHANGELOG }}
# TODO fetch from Gradle?
# May actually want to manually specify Paper versions all the time; they won't all
# need to be specified in code thanks to Mojang-mapped server internals.
# A bit annoying, but not terribly so.
# Instead, fetch min and max (which will also be Spigot version) and manually list intermediate versions?
body: |-
## Supported server versions
### Paper
TODO COMMA-SEPARATED VERSIONS
### Spigot
TODO VERSION

TODO HELLO HUMAN, PRESS THE GENERATE CHANGELOG BUTTON PLEASE.
draft: true
prerelease: false
files: ./dist/**
3 changes: 2 additions & 1 deletion .github/workflows/external_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- name: Set CurseForge Variables
run: . scripts/set_curseforge_env.sh "${{ github.event.release.body }}"

# TODO Investigate swap to Kir-Antipov/mc-publish
- name: Create CurseForge Release
uses: itsmeow/curseforge-upload@v3
with:
Expand All @@ -34,4 +35,4 @@ jobs:
game_versions: "${{ env.CURSEFORGE_MINECRAFT_VERSIONS }}"
release_type: release
changelog_type: markdown
changelog: "${{ env.CURSEFORGE_CHANGELOG }}"
changelog: "${{ github.event.release.body }}"
2 changes: 1 addition & 1 deletion .github/workflows/resource_pack_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: openinv-legibility-pack
path: ./resource-pack/
path: ./resource-pack/openinv-legibility-pack/
compression-level: 9
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
**/.project
**/.classpath
**/.idea/
**/.gradle/
**.iml
**/target/
**/bin/
**/out/
**/build/
**/dist/
**/dependency-reduced-pom.xml
**/pom.xml.versionsBackup
21 changes: 21 additions & 0 deletions addon/togglepersist/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
`openinv-base`
}

dependencies {
implementation(project(":openinvapi"))
}

tasks.processResources {
expand("version" to version)
}

tasks.register<Copy>("distributeAddons") {
into(rootProject.layout.projectDirectory.dir("dist"))
from(tasks.jar)
rename("openinvtogglepersist.*\\.jar", "OITogglePersist.jar")
}

tasks.assemble {
dependsOn(tasks.named("distributeAddons"))
}
72 changes: 0 additions & 72 deletions addon/togglepersist/pom.xml

This file was deleted.

2 changes: 1 addition & 1 deletion addon/togglepersist/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: OITogglePersist
main: com.github.jikoo.openinv.togglepersist.TogglePersist
version: ${project.version}
version: ${version}
author: Jikoo
description: An OpenInv addon allowing /anycontainer and /silentcontainer to persist across sessions.
api-version: "1.20"
Expand Down
4 changes: 4 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

plugins {
`openinv-base`
}
1 change: 1 addition & 0 deletions api/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artifactId = openinvapi
49 changes: 0 additions & 49 deletions api/pom.xml

This file was deleted.

24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
`java-library`
alias(libs.plugins.paperweight) apply false
alias(libs.plugins.shadow) apply false
}

repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}

// Allow submodules to target higher Java release versions.
// Not currently necessary (as lowest supported version is in the 1.21 range)
// but may become relevant in the future.
java.disableAutoTargetJvm()

// Task to delete ./dist where final files are output.
tasks.register("cleanDist") {
delete("dist")
}

tasks.clean {
// Also delete distribution folder when cleaning.
dependsOn(tasks.named("cleanDist"))
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}
35 changes: 35 additions & 0 deletions buildSrc/src/main/kotlin/openinv-base.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.maven
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.dependencies

plugins {
`java-library`
}

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

repositories {
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
}

dependencies {
val libs = versionCatalogs.named("libs")
compileOnly(libs.findLibrary("annotations").orElseThrow())
compileOnly(libs.findLibrary("spigot.api").orElseThrow())
}

tasks {
withType<JavaCompile>().configureEach {
options.release = 21
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc>().configureEach {
options.encoding = Charsets.UTF_8.name()
}
}
7 changes: 7 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`openinv-base`
}

dependencies {
implementation(project(":openinvapi"))
}
30 changes: 0 additions & 30 deletions common/pom.xml

This file was deleted.

9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Project meta
group = com.lishid.openinv
version = 5.1.7-SNAPSHOT
description = A Bukkit plugin for opening normally-inaccessible inventories.

# Gradle configuration
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
Loading
Loading