HexCasting/Forge/build.gradle

192 lines
7.3 KiB
Groovy
Raw Normal View History

2022-04-25 16:40:32 +02:00
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
2022-05-11 23:23:39 +02:00
maven {
url = 'https://repo.spongepowered.org/repository/maven-public/'
content { includeGroup "org.spongepowered" }
}
2022-04-25 16:40:32 +02:00
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
2022-05-11 23:23:39 +02:00
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
2022-04-25 16:40:32 +02:00
}
}
2022-05-20 02:33:28 +02:00
2022-04-25 16:40:32 +02:00
apply plugin: 'net.minecraftforge.gradle'
2022-05-11 23:23:39 +02:00
apply plugin: 'org.spongepowered.mixin'
2022-04-25 16:40:32 +02:00
archivesBaseName = getArtifactID("forge")
2022-04-25 16:40:32 +02:00
// Adds KFF as dependency and Kotlin libs to the runtime classpath
// If you already know how to add the Kotlin plugin to Gradle, this is the only line you need for KFF
2022-05-20 01:59:47 +02:00
apply from: 'https://raw.githubusercontent.com/thedarkcolour/KotlinForForge/site/thedarkcolour/kotlinforforge/gradle/kff-3.3.2.gradle'
2022-04-25 16:40:32 +02:00
minecraft {
mappings channel: 'official', version: minecraftVersion
2022-06-02 16:57:18 +02:00
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2022-04-25 16:40:32 +02:00
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
// This location is hardcoded in Forge and can not be changed.
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
project.logger.debug('Forge Access Transformers are enabled for this project.')
}
runs {
client {
2022-05-11 23:23:39 +02:00
workingDirectory project.file('run')
2022-04-25 16:40:32 +02:00
ideaModule "${rootProject.name}.${project.name}.main"
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
2022-05-11 23:23:39 +02:00
create(modID) {
2022-04-25 16:40:32 +02:00
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
server {
2022-05-11 23:23:39 +02:00
workingDirectory project.file('run')
2022-04-25 16:40:32 +02:00
ideaModule "${rootProject.name}.${project.name}.main"
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
2022-05-11 23:23:39 +02:00
create(modID) {
2022-04-25 16:40:32 +02:00
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
2022-05-11 23:23:39 +02:00
// We have to have a dummy data run to be parented from
data {}
xplatDatagen {
2022-05-11 23:23:39 +02:00
parent minecraft.runs.data
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', modID, '--all', '--output', file('../Common/src/generated/resources/'), '--existing', file('../Common/src/main/resources/')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
property 'hexcasting.xplat_datagen', 'true'
mods {
2022-05-11 23:23:39 +02:00
create(modID) {
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
forgeDatagen {
2022-05-11 23:23:39 +02:00
parent minecraft.runs.data
workingDirectory project.file('run')
2022-04-25 16:40:32 +02:00
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', modID, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
2022-05-26 16:15:56 +02:00
property 'hexcasting.forge_datagen', 'true'
2022-04-25 16:40:32 +02:00
mods {
2022-05-11 23:23:39 +02:00
create(modID) {
2022-04-25 16:40:32 +02:00
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
}
}
repositories {
mavenCentral()
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
// flatDir {
// dir 'libs'
// }
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
2022-07-25 16:56:23 +02:00
maven {
//location of the maven for curios api
url = "https://maven.theillusivec4.top/"
}
2022-04-25 16:40:32 +02:00
}
dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
compileOnly project(":Common")
2022-04-25 16:40:32 +02:00
2022-08-18 23:06:06 +02:00
compileOnly "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
testCompileOnly "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
2022-04-25 16:40:32 +02:00
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
compileOnly fg.deobf("at.petra-k.paucal:paucal-forge-$minecraftVersion:$paucalVersion")
runtimeOnly fg.deobf("at.petra-k.paucal:paucal-forge-$minecraftVersion:$paucalVersion")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion")
2022-04-25 16:40:32 +02:00
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion")
compileOnly fg.deobf("mezz.jei:jei-$minecraftVersion:$jeiVersion:api")
runtimeOnly fg.deobf("mezz.jei:jei-$minecraftVersion:$jeiVersion")
2022-05-20 01:59:47 +02:00
2022-07-25 16:56:23 +02:00
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:$minecraftVersion-$curiosVersion:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:$minecraftVersion-$curiosVersion")
2022-05-20 01:59:47 +02:00
// aughh
testCompileOnly fg.deobf("at.petra-k.paucal:paucal-forge-$minecraftVersion:$paucalVersion")
testCompileOnly fg.deobf("vazkii.patchouli:Patchouli:$minecraftVersion-$patchouliVersion")
2022-06-02 09:11:48 +02:00
api fg.deobf("com.github.Virtuoel:Pehkui:${pehkuiVersion}-${minecraftVersion}-forge")
2022-04-25 16:40:32 +02:00
}
2022-05-11 23:23:39 +02:00
mixin {
add project(":Common").sourceSets.main, "hexcasting.mixins.refmap.json"
2022-05-21 00:00:00 +02:00
add sourceSets.main, "hexcasting.mixins.refmap.json"
2022-05-11 23:23:39 +02:00
config "hexplat.mixins.json"
2022-05-12 18:13:06 +02:00
config "hexcasting_forge.mixins.json"
2022-05-11 23:23:39 +02:00
}
2022-04-25 16:40:32 +02:00
tasks.withType(JavaCompile) {
source(project(":Common").sourceSets.main.allSource)
}
compileKotlin {
2022-07-24 22:51:57 +02:00
source(project(":Common").sourceSets.main.kotlin)
}
2022-05-20 02:33:28 +02:00
compileTestKotlin {
2022-07-24 22:51:57 +02:00
source(project(":Common").sourceSets.main.kotlin)
2022-05-20 02:33:28 +02:00
}
2022-04-25 16:40:32 +02:00
2022-05-15 23:48:18 +02:00
sourceSets {
main.resources.srcDirs += ['src/generated/resources', '../Common/src/generated/resources']
main.kotlin.srcDirs += 'src/main/java'
2022-05-20 01:59:47 +02:00
test.kotlin.srcDirs += 'src/main/java'
2022-05-11 23:23:39 +02:00
}
2022-04-25 16:40:32 +02:00
processResources {
from project(":Common").sourceSets.main.resources
2022-05-11 23:23:39 +02:00
inputs.property "version", project.version
filesMatching("mods.toml") {
expand "version": project.version
}
2022-04-25 16:40:32 +02:00
}
2022-05-23 21:21:13 +02:00
jar.finalizedBy('reobfJar')
setupJar(this)