ViaForge/build.gradle

129 lines
3.5 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
2023-04-20 18:29:34 +02:00
mavenCentral()
2023-04-20 22:16:45 +02:00
maven { url = "https://maven.minecraftforge.net/" }
maven { url = "https://repo.spongepowered.org/repository/maven-public/" }
2023-04-20 22:16:45 +02:00
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"
}
2023-01-04 03:42:43 +01:00
}
2023-01-04 03:45:28 +01:00
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "java"
2023-12-02 00:28:46 +01:00
apply plugin: "idea"
2024-04-28 21:42:33 +02:00
version = maven_version
2023-12-02 00:28:46 +01:00
group = "${maven_group}.${maven_name}"
archivesBaseName = maven_name
2023-01-04 03:45:28 +01:00
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
2023-12-02 00:28:46 +01:00
compileJava.options.encoding = "UTF-8"
2023-01-04 03:45:28 +01:00
repositories {
2023-04-20 18:29:34 +02:00
mavenCentral()
maven { url = "https://maven.minecraftforge.net/" }
2023-01-04 03:45:28 +01:00
maven { url = "https://repo.spongepowered.org/repository/maven-public/" }
2023-04-20 22:16:45 +02:00
maven { url = "https://repo.viaversion.com" }
2023-01-04 03:45:28 +01:00
maven { url = "https://jitpack.io/" }
}
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_22"
2023-01-04 03:45:28 +01:00
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 {
2023-12-02 00:28:46 +01:00
include compile ("org.spongepowered:mixin:${project.mixin_version}") {
2023-01-04 03:45:28 +01:00
exclude module: "launchwrapper"
}
2024-04-30 20:52:01 +02:00
include "com.viaversion:viaversion-common:${project.viaversion_version}"
include "com.viaversion:viabackwards-common:${project.viabackwards_version}"
include "com.viaversion:viarewind-common:${project.viarewind_version}"
2023-12-02 00:28:46 +01:00
include ("net.raphimc:ViaLegacy:${project.vialegacy_version}") {
exclude group: "com.google.code.gson", module: "gson"
2023-01-04 03:45:28 +01:00
}
2023-12-02 00:28:46 +01:00
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}"
2023-01-04 03:45:28 +01:00
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
2023-12-02 00:28:46 +01:00
include "mcmod.info"
2023-01-04 03:45:28 +01:00
2023-12-02 00:28:46 +01:00
expand "version": project.version
2023-01-04 03:45:28 +01:00
}
from(sourceSets.main.resources.srcDirs) {
2023-12-02 00:28:46 +01:00
exclude "mcmod.info"
2023-01-04 03:45:28 +01:00
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
mixin {
2024-05-01 08:17:12 +02:00
add sourceSets.main, "mixins.${maven_name}.refmap.json"
2023-01-04 03:45:28 +01:00
}
jar {
manifest.attributes(
2024-05-01 08:17:12 +02:00
"MixinConfigs": "mixins.${maven_name}.json",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
2023-01-04 03:45:28 +01:00
"TweakOrder": 0,
"FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader",
"FMLCorePluginContainsFMLMod": "true"
2023-01-04 03:45:28 +01:00
)
enabled = false
}
idea {
module {
inheritOutputDirs = true
}
}
shadowJar {
archiveName = jar.archiveName
2023-12-02 00:28:46 +01:00
configurations = [project.configurations.include] // Include the dependencies from the include configuration
duplicatesStrategy DuplicatesStrategy.EXCLUDE
2023-01-04 03:45:28 +01:00
2023-12-02 00:28:46 +01:00
// Prevent conflicts with Forge's weird service loading
exclude("META-INF/maven/**")
exclude("META-INF/versions/**")
2023-01-04 03:45:28 +01:00
}
reobf {
shadowJar {}
}
2023-04-20 22:16:45 +02:00
jar.dependsOn("shadowJar")