New TrueOG Network branch
This commit is contained in:
1 parent
0243f9bccb
commit
bea274d636
6 files changed
+131
-137
No files matched your search
@@ -10,6 +10,11 @@
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Eclipse files
|
||||
.settings
|
||||
.gradle
|
||||
.classpath
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
include:
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
|
||||
default:
|
||||
image: eclipse-temurin:21
|
||||
|
||||
cache:
|
||||
key: gradle-${CI_COMMIT_REF_SLUG}
|
||||
unprotect: true
|
||||
|
||||
paths:
|
||||
- .gradle
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
||||
script:
|
||||
- ./gradlew build
|
||||
- mv build/libs/*/*.jar ./
|
||||
|
||||
artifacts:
|
||||
name: DistantHorizonsSupport-${CI_COMMIT_REF_SLUG}-${CI_JOB_STARTED_AT}
|
||||
|
||||
paths:
|
||||
- "./*.jar"
|
||||
-107
@@ -1,107 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.gradleup.shadow' version '8.3.8'
|
||||
}
|
||||
|
||||
group = 'no.jckf.dhs'
|
||||
version = '0.11.0-SNAPSHOT'
|
||||
description = 'Distant Horizons Support'
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
|
||||
def paperVersions = [
|
||||
'1.16.5',
|
||||
]
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = 'https://repo.papermc.io/repository/maven-public/' }
|
||||
maven { url = 'https://jitpack.io/' }
|
||||
}
|
||||
|
||||
configurations {
|
||||
shade
|
||||
implementation {
|
||||
extendsFrom shade
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.jetbrains:annotations:25.0.0'
|
||||
|
||||
implementation 'com.google.guava:guava:33.3.1-jre'
|
||||
|
||||
shade 'org.bstats:bstats-bukkit:3.1.0'
|
||||
shade 'org.json:json:20240303'
|
||||
shade 'org.tukaani:xz:1.10'
|
||||
shade 'com.github.technicallycoded:FoliaLib:v0.4.3'
|
||||
|
||||
testImplementation 'junit:junit:4.11'
|
||||
}
|
||||
|
||||
paperVersions.each { mcVersion ->
|
||||
def taskSuffix = mcVersion.replace('.', '_')
|
||||
def taskName = "buildJar_${taskSuffix}"
|
||||
def outputDir = file("build/libs/$mcVersion")
|
||||
|
||||
def apiVersion = mcVersion.tokenize('.')[0..1].join('.')
|
||||
|
||||
def sourceSetName = "main"
|
||||
|
||||
// Custom processResources task per version
|
||||
def processTask = tasks.register("processResources_${taskSuffix}", Copy) {
|
||||
from(sourceSets[sourceSetName].resources.srcDirs)
|
||||
into("$buildDir/resources-processed/$mcVersion")
|
||||
|
||||
include '**/*.yml'
|
||||
|
||||
expand(
|
||||
version: project.version,
|
||||
'mainClass': 'no.jckf.dhsupport.bukkit.DhSupportBukkitPlugin',
|
||||
'mcApiVersion': apiVersion,
|
||||
)
|
||||
}
|
||||
|
||||
configurations {
|
||||
"compileOnly${mcVersion}" {
|
||||
canBeResolved = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "com.destroystokyo.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT"
|
||||
//compileOnly "io.papermc.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT"
|
||||
}
|
||||
|
||||
task(taskName, type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
|
||||
group = 'build'
|
||||
|
||||
archiveBaseName.set("DistantHorizonsSupport")
|
||||
archiveVersion.set(version)
|
||||
destinationDirectory.set(outputDir)
|
||||
|
||||
// Use processed resources as input
|
||||
// Exclude raw YAML to avoid unprocessed plugin.yml in final JAR
|
||||
from(sourceSets.main.output) {
|
||||
exclude '**/*.yml'
|
||||
}
|
||||
|
||||
from("$buildDir/resources-processed/$mcVersion")
|
||||
|
||||
configurations = [project.configurations.shade]
|
||||
|
||||
relocate 'org.bstats', 'no.jckf.dhsupport.bstats'
|
||||
relocate 'org.json', 'no.jckf.dhsupport.json'
|
||||
relocate 'org.tukaani.xz', 'no.jckf.dhsupport.xz'
|
||||
relocate 'com.tcoded.folialib', 'no.jckf.dhsupport.folialib'
|
||||
|
||||
exclude 'org/jetbrains/**'
|
||||
exclude 'org/intellij/**'
|
||||
|
||||
dependsOn processTask
|
||||
}
|
||||
|
||||
build.dependsOn(taskName)
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.api.tasks.Copy
|
||||
import org.gradle.api.tasks.SourceSetContainer
|
||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||
|
||||
plugins {
|
||||
java
|
||||
eclipse
|
||||
id("com.gradleup.shadow") version "8.3.8"
|
||||
}
|
||||
|
||||
group = "no.jckf.dhs"
|
||||
version = "0.11.0-SNAPSHOT"
|
||||
description = "Distant Horizons Support"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17 // Compile with JDK 17 compatibility.
|
||||
toolchain { // Select Java toolchain.
|
||||
languageVersion.set(JavaLanguageVersion.of(17)) // Use JDK 17.
|
||||
vendor.set(JvmVendorSpec.GRAAL_VM) // Use GraalVM CE.
|
||||
}
|
||||
}
|
||||
|
||||
val paperVersions = listOf(
|
||||
"1.16.5",
|
||||
)
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://jitpack.io/")
|
||||
}
|
||||
|
||||
val shade by configurations.creating
|
||||
configurations.named("implementation") {
|
||||
extendsFrom(shade)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.jetbrains:annotations:25.0.0")
|
||||
|
||||
implementation("com.google.guava:guava:33.3.1-jre")
|
||||
|
||||
shade("org.bstats:bstats-bukkit:3.1.0")
|
||||
shade("org.json:json:20240303")
|
||||
shade("org.tukaani:xz:1.10")
|
||||
shade("com.github.technicallycoded:FoliaLib:v0.4.3")
|
||||
|
||||
testImplementation("junit:junit:4.11")
|
||||
}
|
||||
|
||||
paperVersions.forEach { mcVersion ->
|
||||
val taskSuffix = mcVersion.replace('.', '_')
|
||||
val taskName = "buildJar_$taskSuffix"
|
||||
val outputDir = file("build/libs/$mcVersion")
|
||||
|
||||
val apiVersion = mcVersion.split('.').take(2).joinToString(".")
|
||||
|
||||
val sourceSetName = "main"
|
||||
|
||||
// Custom processResources task per version
|
||||
val processTask = tasks.register<Copy>("processResources_$taskSuffix") {
|
||||
val srcSets = project.extensions.getByName("sourceSets") as SourceSetContainer
|
||||
from(srcSets[sourceSetName].resources.srcDirs)
|
||||
into(layout.buildDirectory.dir("resources-processed/$mcVersion"))
|
||||
|
||||
include("**/*.yml")
|
||||
|
||||
expand(
|
||||
mapOf(
|
||||
"version" to project.version,
|
||||
"mainClass" to "no.jckf.dhsupport.bukkit.DhSupportBukkitPlugin",
|
||||
"mcApiVersion" to apiVersion,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
configurations.maybeCreate("compileOnly$mcVersion").apply {
|
||||
isCanBeResolved = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("compileOnly", "com.destroystokyo.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT")
|
||||
//compileOnly("io.papermc.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks.register<ShadowJar>(taskName) {
|
||||
group = "build"
|
||||
|
||||
archiveBaseName.set("DistantHorizonsSupport")
|
||||
archiveVersion.set(version.toString())
|
||||
destinationDirectory.set(outputDir)
|
||||
|
||||
// Use processed resources as input
|
||||
// Exclude raw YAML to avoid unprocessed plugin.yml in final JAR
|
||||
val srcSets = project.extensions.getByName("sourceSets") as SourceSetContainer
|
||||
from(srcSets["main"].output) {
|
||||
exclude("**/*.yml")
|
||||
}
|
||||
|
||||
from(layout.buildDirectory.dir("resources-processed/$mcVersion"))
|
||||
|
||||
configurations = listOf(project.configurations.getByName("shade"))
|
||||
|
||||
relocate("org.bstats", "no.jckf.dhsupport.bstats")
|
||||
relocate("org.json", "no.jckf.dhsupport.json")
|
||||
relocate("org.tukaani.xz", "no.jckf.dhsupport.xz")
|
||||
relocate("com.tcoded.folialib", "no.jckf.dhsupport.folialib")
|
||||
|
||||
exclude("org/jetbrains/**")
|
||||
exclude("org/intellij/**")
|
||||
|
||||
dependsOn(processTask)
|
||||
}
|
||||
|
||||
tasks.named("build") {
|
||||
dependsOn(taskName)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = 'DistantHorizonsSupport'
|
||||
@@ -0,0 +1,5 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention").version("0.10.0")
|
||||
}
|
||||
|
||||
rootProject.name = "DistantHorizonsSupport"
|
||||
Reference in new issue
Block a user