ViaForge/build.gradle
Howard ZHY c93999b9ba
Update Via* libraries and fixup build files (#93)
* Some small improvements

* Update Via*, Fix things

Fix incompatibility with Patcher
Fix jar manifest attribute caused not detected in mod list

* Update build.gradle

* Update src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java

Co-authored-by: EnZaXD <florian.michael07@gmail.com>

* Update src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java

* Update src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java

* Update src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java

* Update src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java

---------

Co-authored-by: EnZaXD <florian.michael07@gmail.com>
2024-06-11 15:29:03 +02:00

129 lines
3.5 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"
}
include "com.viaversion:viaversion-common:${project.viaversion_version}"
include "com.viaversion:viabackwards-common:${project.viabackwards_version}"
include "com.viaversion:viarewind-common:${project.viarewind_version}"
include ("net.raphimc:ViaLegacy:${project.vialegacy_version}") {
exclude group: "com.google.code.gson", module: "gson"
}
include "net.raphimc:ViaAprilFools:${project.viaaprilfools_version}"
include "net.raphimc:ViaLoader:${project.vialoader_version}"
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")