Files
L2Core/build.gradle
2025-07-28 14:06:49 +08:00

184 lines
4.9 KiB
Groovy

plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.80'
id 'net.darkhax.curseforgegradle' version '[1.1.24,)'
id "at.stnwtr.gradle-secrets-plugin" version "1.0.1"
id "com.modrinth.minotaur" version "2.+"
}
version = mod_version
group = 'dev.xkmc'
repositories {
mavenLocal()
}
base {
archivesName = mod_id
}
java {
withSourcesJar()
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
sourceSets {
client {}
server {}
data {}
common {}
}
neoForge {
// We currently only support NeoForge versions later than 21.0.x
// See https://projects.neoforged.net/neoforged/neoforge for the latest updates
version = "${neo_version}"
// Validate AT files and raise errors when they have invalid targets
// This option is false by default, but turning it on is recommended
//validateAccessTransformers = true
accessTransformers.from "./src/main/resources/META-INF/accesstransformer.cfg"
runs {
client {
client()
}
data {
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
server {
server()
}
}
mods {
"${mod_id}" {
sourceSet sourceSets.main
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
neo_version : neo_version, neo_version_range: neo_version_range,
loader_version_range: loader_version_range,
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors : mod_authors, mod_description: mod_description,
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties + [project: project]
}
}
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
if (lljij.toBoolean()) jarJar.enable()
jar {
manifest {
attributes([
"Specification-Title" : "${mod_id}",
"Specification-Vendor" : "xkmc",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "xkmc",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConfigs' : "${mod_id}.mixins.json"
])
}
}
if (lljij.toBoolean()) {
tasks.jarJar.configure {
archiveClassifier.set('')
}
jar {
archiveClassifier.set('slim')
}
}
repositories {
flatDir {
dirs 'libs'
}
maven { // Registrate
url "https://maven.ithundxr.dev/snapshots"
}
maven {
url = "https://maven.theillusivec4.top/"
}
maven {
// Location of the maven for vazkii's mods
name 'blamejared'
url 'https://maven.blamejared.com'
}
maven {
url 'https://www.cursemaven.com'
content {
includeGroup "curse.maven"
}
}
maven {
// Location of the maven that hosts JEI files (and TiC)
name 'Progwml6 maven'
url 'https://dvs1.progwml6.com/files/maven'
}
mavenLocal();
}
dependencies {
implementation "mezz.jei:jei-${jei_minecraft_version}:${jei_version}"
implementation "com.tterrag.registrate:Registrate:${registrate_version}"
implementation "dev.xkmc:l2serial:${l2serial_ver}"
compileOnly "vazkii.patchouli:Patchouli:${patchouli_ver}"
//runtimeOnly "dev.xkmc:l2damagetracker:3.0.3+2"
//runtimeOnly "dev.xkmc:l2menustacker:3.0.9"
//runtimeOnly "dev.xkmc:l2itemselector:3.0.8"
//runtimeOnly "dev.xkmc:l2library:3.0.2+4"
//runtimeOnly "dev.xkmc:l2complements:3.0.2+7"
//runtimeOnly "dev.xkmc:l2archery:3.0.0+8"
//runtimeOnly "curse.maven:embeddium-908741:5630163"
//runtimeOnly "curse.maven:farmers-delight-398521:5566383"
//runtimeOnly "dev.xkmc:cuisinedelight:1.2.2"
//implementation "curse.maven:enchantment-descriptions-250419:5760047"
//implementation "curse.maven:bookshelf-228525:5757624"
//implementation "curse.maven:prickle-1023259:5757615"
}