Skip to content

Instantly share code, notes, and snippets.

@mattmess1221
Last active December 2, 2015 22:23
Show Gist options
  • Save mattmess1221/f27731472f5e198a8e87 to your computer and use it in GitHub Desktop.
Save mattmess1221/f27731472f5e198a8e87 to your computer and use it in GitHub Desktop.
Example build script for liteloader 1.8 mods. Put the mcpnames jar in the libs folder.
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
//apply plugin: 'liteloader'
apply plugin: 'forge' // No liteloader plugin for 1.8 yet
version = "version"
group = "group"
archivesBaseName = "ModName"
ext.rev = "1" // the revision
minecraft {
version = "1.8-recommended"
runDir = "run"
mappings = "stable_15" // use the right mappings
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
inputs.property "rev", project.rev
// replace stuff in litemod.json, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'litemod.json'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version, "rev":project.rev
}
// copy everything else, thats not the litemod.json
from(sourceSets.main.resources.srcDirs) {
exclude 'litemod.json'
}
}
jar {
extension "litemod" // use the right extension
}
reobf {
setSrgMcp() // reobfuscate to notch names
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment