1
0
mirror of https://github.com/chylex/Minecraft-Window-Title.git synced 2024-11-14 17:42:49 +01:00
Minecraft-Window-Title/Forge/build.gradle.kts

81 lines
1.8 KiB
Plaintext

import net.minecraftforge.gradle.userdev.UserDevExtension
import org.gradle.api.file.DuplicatesStrategy.INCLUDE
import org.spongepowered.asm.gradle.plugins.MixinExtension
val modId: String by project
val minecraftVersion: String by project
val forgeVersion: String by project
val mixinVersion: String by project
buildscript {
repositories {
maven("https://maven.minecraftforge.net")
maven("https://repo.spongepowered.org/maven")
mavenCentral()
}
dependencies {
classpath(group = "net.minecraftforge.gradle", name = "ForgeGradle", version = "[6.0,6.2)")
classpath(group = "org.spongepowered", name = "mixingradle", version = "0.7-SNAPSHOT")
}
}
plugins {
java
eclipse
}
apply {
plugin("net.minecraftforge.gradle")
plugin("org.spongepowered.mixin")
}
dependencies {
"minecraft"("net.minecraftforge:forge:$minecraftVersion-$forgeVersion")
if (System.getProperty("idea.sync.active") != "true") {
annotationProcessor("org.spongepowered:mixin:$mixinVersion:processor")
}
}
configure<UserDevExtension> {
mappings("official", minecraftVersion)
copyIdeResources.set(true)
runs {
create("client") {
taskName = "Client"
workingDirectory(rootProject.file("run"))
ideaModule("${rootProject.name}.${project.name}.main")
property("mixin.env.remapRefMap", "true")
property("mixin.env.refMapRemappingFile", "$projectDir/build/createSrgToMcp/output.srg")
arg("-mixin.config=$modId.mixins.json")
mods {
create(modId) {
source(sourceSets.main.get())
source(rootProject.sourceSets.main.get())
}
}
}
}
}
configure<MixinExtension> {
add(sourceSets.main.get(), "$modId.refmap.json")
}
tasks.processResources {
from(sourceSets.main.get().resources.srcDirs) {
include("META-INF/mods.toml")
expand(inputs.properties)
duplicatesStrategy = INCLUDE
}
}
tasks.jar {
finalizedBy("reobfJar")
}