ExDeorum/build.gradle
thedarkcolour b78263e071
Ex Deorum 3.0
First port to 1.21 is complete. I have to document what changed for modpack makers later on.
2024-07-07 20:10:55 -07:00

204 lines
6.0 KiB
Groovy

plugins {
id 'java-library'
id 'idea'
id 'net.neoforged.moddev' version '0.1.120'
}
version = '3.0'
group = 'thedarkcolour.exdeorum'
base {
archivesName = 'exdeorum'
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
neoForge {
version = neo_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
//validateAccessTransformers = true
accessTransformers.add('src/main/resources/META-INF/accesstransformer.cfg')
runs {
configureEach {
logLevel = org.slf4j.event.Level.DEBUG
jvmArgument '-XX:+AllowEnhancedClassRedefinition'
}
client {
client()
}
server {
server()
gameDirectory.set(project.layout.projectDirectory.dir('run/server'))
programArgument '--nogui'
}
data {
data()
// instead of using --all, skip file check validation
programArguments.addAll('--server', '--client', '--dev', '--reports')
programArguments.addAll ('--mod', 'exdeorum', '--output', file('src/generated/resources/').absolutePath, '--existing', file('src/main/resources/').absolutePath)
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
coremod {
dependency project(':coremod')
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
// Exclude KubeJS compat till they update todo remove when KubeJS updates
// If IntelliJ ignores this, you have to change Gradle settings to build projects using Gradle instead of IntelliJ
sourceSets {
main {
java {
exclude 'thedarkcolour/exdeorum/compat/kubejs/'
exclude 'thedarkcolour/exdeorum/compat/top/'
}
}
}
repositories {
mavenCentral()
maven {
name = 'McJty maven'
url = 'https://maven.k-4u.nl'
content { includeGroup 'mcjty.theoneprobe' }
}
maven {
name = 'jei'
url = 'https://maven.blamejared.com/'
content { includeGroup "mezz.jei" }
}
maven {
name = 'rei'
url = "https://maven.shedaniel.me"
}
maven {
name = 'Architectury API'
url = "https://maven.architectury.dev"
content { includeGroup "dev.architectury" }
}
maven {
name = 'KubeJS and Rhino'
url = "https://maven.saps.dev/minecraft"
content { includeGroup "dev.latvian.mods" }
}
maven {
name = 'ModKit'
url 'https://jitpack.io'
content { includeGroup 'com.github.thedarkcolour' }
}
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com'
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeModule("maven.modrinth", "oculus")
includeModule("maven.modrinth", "embeddium")
}
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
dependencies {
// TOP OPTIONAL
//compileOnly("mcjty.theoneprobe:theoneprobe:${mc_version}_neo-${top_version}") {
// transitive = false
//}
// JADE OPTIONAL
compileOnly("curse.maven:jade-324717:5109393")
// JEI OPTIONAL
compileOnly("mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}")
runtimeOnly("mezz.jei:jei-${mc_version}-neoforge:${jei_version}")
// REI OPTIONAL todo add
compileOnly("me.shedaniel:RoughlyEnoughItems-forge:${rei_version}")
compileOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}")
// EMI OPTIONAL
compileOnly("dev.emi:emi-neoforge:${emi_version}:api")
compileOnly("dev.emi:emi-neoforge:${emi_version}")
//implementation("curse.maven:reipc-521393:4837449")
// KubeJS OPTIONAL todo add when KubeJS updates
//implementation("dev.architectury:architectury-neoforge:${architectury_version}")
//implementation("dev.latvian.mods:rhino-neoforge:${rhino_version}")
//implementation("dev.latvian.mods:kubejs-neoforge:${kubejs_version}")
// ModKit DEV ONLY
implementation('com.github.thedarkcolour:ModKit:81a0889b26')
// Core mod
implementation(jarJar(project(':coremod')))
// Oculus + Embeddium OPTIONAL
compileOnly('maven.modrinth:oculus:1.20.1-1.6.9')
compileOnly('maven.modrinth:embeddium:0.3.9+mc1.20.4')
// testing
//implementation("curse.maven:allthecompressed-514045:4938351")
implementation("curse.maven:alltheores-405593:5500624")
//implementation("curse.maven:inventorysorter-240633:4655091")
//implementation("curse.maven:cyclic-239286:4994392")
//implementation("curse.maven:flib-661261:4724762")
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
mc_version: mc_version,
mod_version: version,
neo_version_range: neo_version_range,
loader_version_range: loader_version_range
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
// Minify JSON resources
// Actual reduction in file size is just a few KB, but why not?
doLast {
fileTree(dir: outputs.files.asPath, include: "**/*.json").each {
File file ->
//noinspection UnnecessaryQualifiedReference
try {
file.text = groovy.json.JsonOutput.toJson(new groovy.json.JsonSlurper().parse(file))
} catch (Exception e) {
println "Unable to minify file ${file.name}"
throw new RuntimeException(e)
}
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}