ViaForge/build.gradle

132 lines
3.8 KiB
Groovy
Raw Normal View History

plugins {
id "java"
id "idea"
id "maven-publish"
id "net.minecraftforge.gradle" version "5.1.+"
id "org.spongepowered.mixin" version "0.7-SNAPSHOT"
id "com.github.johnrengelman.shadow" version "7.0.0"
2021-02-16 21:39:05 +01:00
}
version = "${minecraft_version}-${mod_version}"
group = "${mod_base_package}.${mod_id}"
archivesBaseName = mod_id
2021-02-16 21:39:05 +01:00
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = "UTF-8"
2021-02-16 21:39:05 +01:00
minecraft {
mappings channel: mappings_channel, version: mappings_version
runs {
client {
workingDirectory project.file("run")
property 'forge.logging.markers', 'REGISTRIES'
property "forge.logging.console.level", "debug"
// mixin
property 'mixin.debug.export', 'true'
property "mixin.hotSwap", "true"
property "fml.coreMods.load", "de.enzaxd.viaforge.injection.MixinLoader"
2021-09-10 17:55:16 +02:00
if (project.hasProperty('mc_uuid'))
args '--uuid', project.getProperty('mc_uuid')
2021-09-10 17:55:16 +02:00
if (project.hasProperty('mc_username'))
args '--username', project.getProperty('mc_username')
2021-09-10 17:55:16 +02:00
if (project.hasProperty('mc_accessToken'))
args '--accessToken', project.getProperty('mc_accessToken')
args '-mixin.config=' + 'mixins.' + project.getProperty('mod_id') + '.json'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
}
2021-02-16 21:39:05 +01:00
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
2021-02-16 21:39:05 +01:00
repositories {
maven { url = "https://repo.spongepowered.org/repository/maven-public" }
maven { url = "https://repo.viaversion.com" }
2021-02-16 21:39:05 +01:00
}
configurations {
include
implementation.extendsFrom(include)
2021-02-16 21:39:05 +01:00
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
include "org.spongepowered:mixin:${mixin_version}"
2021-09-10 17:55:16 +02:00
include "com.viaversion:viaversion:${viaversion_version}"
include "com.viaversion:viabackwards:${viabackwards_version}"
include "org.yaml:snakeyaml:1.29"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
2021-02-16 21:39:05 +01:00
}
mixin {
add sourceSets.main, "mixins.${mod_id}.refmap.json"
2021-02-16 21:39:05 +01:00
}
jar {
manifest.attributes(
"Specification-Title": "viaforge",
"Specification-Vendor": "viaforge",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${archiveVersion}",
"Implementation-Vendor" :"viaforge",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd"-"HH:mm:ssZ"),
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": "0",
"FMLCorePluginContainsFMLMod": "true",
"FMLCorePlugin": "de.enzaxd.viaforge.injection.MixinLoader",
"MixinConfigs": "mixins.${mod_id}.json",
"ForceLoadAsMod": "true"
2021-02-16 21:39:05 +01:00
)
enabled = false
2021-02-16 21:39:05 +01:00
}
shadowJar {
archiveFileName = jar.archiveFileName
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = [project.configurations.include]
exclude "LICENSE.md"
exclude "dummyThing"
exclude "**/module-info.class"
exclude "*.so"
exclude "*.dylib"
exclude "*.dll"
exclude "*.jnilib"
exclude "ibxm/**"
exclude "com/jcraft/**"
exclude "org/lwjgl/**"
exclude "net/java/**"
exclude "META-INF/proguard/**"
exclude "META-INF/maven/**"
exclude "META-INF/versions/**"
exclude "META-INF/com.android.tools/**"
exclude "fabric.mod.json"
exclude "bungee.yml"
exclude "plugin.yml"
exclude "velocity-plugin.json"
exclude "LICENSE.txt"
2021-02-16 21:39:05 +01:00
}
reobf {
shadowJar {}
2021-02-16 21:39:05 +01:00
}
jar.dependsOn("shadowJar")