Skip to content

Instantly share code, notes, and snippets.

@ddozzi
Last active August 30, 2023 20:40
Show Gist options
  • Save ddozzi/21aa5f5cee9a3bbd6adb26ea7bd34158 to your computer and use it in GitHub Desktop.
Save ddozzi/21aa5f5cee9a3bbd6adb26ea7bd34158 to your computer and use it in GitHub Desktop.
gradle file for mixins
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.tweaker-client'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'
version = "1.0"
group= "GROUP_NAME" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "BASE_NAME"
sourceCompatibility = targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
minecraft {
version = "1.8.9"
tweakClass = "GROUP_NAME.PROJECT_NAME.mixins.PROJECT_NAME+Tweaker"
runDir = "run"
mappings = "stable_20"
makeObfSourceJar = false
}
repositories {
maven { url "https://jitpack.io" }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven/'
}
mavenCentral()
jcenter()
}
configurations {
embed
compile.extendsFrom(embed)
}
dependencies {
embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
}
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT')
}
mixin {
defaultObfuscationEnv notch
add sourceSets.main, "mixins.PROJECT_NAME.refmap.json"
}
processResources {
inputs.files "src/main/resources"
outputs.dir "build/classes/main"
copy {
from("src/main/resources")
into("build/classes/main")
}
}
jar {
dependsOn configurations.compile
from {
configurations.embed.collect {
it.isDirectory() ? it : zipTree(it)
}
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
jar {
manifest.attributes(
"MixinConfigs": 'mixins.PROJECT_NAME.json',
"TweakClass": "GROUP_NAME.PROJECT_NAME.mixins.PROJECT_NAME+Tweaker",
"TweakOrder": 0,
"Manifest-Version": 1.0
)
configurations.embed.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment