Skip to content

Instantly share code, notes, and snippets.

@codeHusky
Created December 4, 2015 01:59
Show Gist options
  • Save codeHusky/3a6335ed714c1f226cc0 to your computer and use it in GitHub Desktop.
Save codeHusky/3a6335ed714c1f226cc0 to your computer and use it in GitHub Desktop.
// Gradle plugins
buildscript {
repositories {
maven {
name = 'plugins'
url = 'https://plugins.gradle.org/m2'
}
}
dependencies {
classpath 'gradle.plugin.net.minecraftforge.gradle:ForgeGradle:2.0.2'
classpath('nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0') {
exclude module: 'guava'
}
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
ext.minecraftPlugin = plugins.getPlugin('net.minecraftforge.gradle.forge')
ext.DIR_MCP_MAPPINGS = net.minecraftforge.gradle.common.Constants.DIR_MCP_MAPPINGS
// Apply shared implementation Gradle config
apply from: project(':SpongeCommon').file('gradle/implementation.gradle')
// Forge Version
ext.forgeBuild = '1577'
minecraft {
forgeVersion = forgeBuild
coreMod = 'org.spongepowered.mod.SpongeCoremod'
}
version = "$minecraft.version-$forgeBuild-$apiVersion-$buildNumber"
compileJava {
options.compilerArgs += [ "-Atokens=FORGE=$forgeBuild;FML=$forgeBuild" ]
}
jar {
exclude 'log4j2.xml' // log4j2 configuration is for the development workspace only
manifest {
attributes(
'Main-Class': 'org.spongepowered.launch.Main',
'TargetForgeBuild': forgeBuild,
'TargetForgeVersion': minecraft.forgeVersion,
'FMLCorePlugin': 'org.spongepowered.mod.SpongeCoremod',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0
)
}
}
processResources {
from('src/main/resources') {
include 'mcmod.info'
expand(
version: project.version,
url: project.url,
minecraftVersion: minecraft.version,
forgeVersion: minecraft.forgeVersion
)
}
}
shadowJar {
exclude 'log4j2.xml' // log4j2 configuration is for the development workspace only
// Temporarily relocate and shade to avoid confict with forge. TODO: Remove when Forge updates to 1.3.0
relocate('com.typesafe.config', 'configurate.typesafe.config')
dependencies {
include dependency('com.typesafe:config')
// This is not available on the client so we need to shade it
include dependency('com.google.code.findbugs:jsr305')
}
}
copySrgs << {
def file = project.file('build/srgs/mcp-srg.srg')
file.append project.file('extraSrg.srg').text
}
apply from: 'changelog.gradle'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment