ViaForge/build.gradle
2024-06-19 19:51:08 +02:00

123 lines
3.1 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven { url = "https://maven.minecraftforge.net/" }
maven { url = "https://repo.spongepowered.org/repository/maven-public/" }
maven { url = "https://repo.viaversion.com" }
maven { url = "https://jitpack.io/" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
classpath "com.github.johnrengelman:shadow:4.0.4"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "java"
apply plugin: "idea"
version = maven_version
group = "${maven_group}.${maven_name}"
archivesBaseName = maven_name
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = "UTF-8"
repositories {
mavenCentral()
maven { url = "https://maven.minecraftforge.net/" }
maven { url = "https://repo.spongepowered.org/repository/maven-public/" }
maven { url = "https://repo.viaversion.com" }
maven { url = "https://jitpack.io/" }
}
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_22"
makeObfSourceJar = false
clientJvmArgs += ["-Dfml.coreMods.load=de.florianmichael.viaforge.mixin.MixinLoader"]
}
sourceSets {
main.java.srcDirs += 'src/main/java'
main.java.srcDirs += '../shared/main/java'
main.resources.srcDirs += '../shared/main/resources'
}
configurations {
include
implementation.extendsFrom(include)
}
dependencies {
include compile ("org.spongepowered:mixin:${project.mixin_version}") {
exclude module: "launchwrapper"
}
// See the README file on how to get this folder
include fileTree(dir: 'output', include: '*.jar')
include "org.slf4j:slf4j-api:${project.slf4j_version}"
include "org.yaml:snakeyaml:${project.snake_yml_version}"
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
mixin {
add sourceSets.main, "mixins.${maven_name}.refmap.json"
}
jar {
manifest.attributes(
"MixinConfigs": "mixins.${maven_name}.json",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": 0,
"FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader",
"FMLCorePluginContainsFMLMod": "true"
)
enabled = false
}
idea {
module {
inheritOutputDirs = true
}
}
shadowJar {
archiveName = jar.archiveName
configurations = [project.configurations.include] // Include the dependencies from the include configuration
duplicatesStrategy DuplicatesStrategy.EXCLUDE
// Prevent conflicts with Forge's weird service loading
exclude("META-INF/maven/**")
exclude("META-INF/versions/**")
}
reobf {
shadowJar {}
}
jar.dependsOn("shadowJar")