Skip to content

Instantly share code, notes, and snippets.

@marchermans
Last active November 30, 2015 16:13
Show Gist options
  • Save marchermans/d0bb622b45221511d267 to your computer and use it in GitHub Desktop.
Save marchermans/d0bb622b45221511d267 to your computer and use it in GitHub Desktop.
1.8.8 Update
// For those who want the bleeding edge
buildscript{
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Buildscript: Armory
// Load the properties of this project.
ext.configFile = file "build.properties"
//Reference the properties inside the project:
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
//Date formatting helper function
def getDate() {
def date = new Date()
def formattedDate = date.format('dd-MM-yyyy : hh:mm:ss')
return formattedDate
}
def build_mode = config.build_mode
//Initializing the mod environment
version = config.mod_version.toString() + "-" + System.getenv().TRAVIS_BUILD_NUMBER.toString()
def apiversion = config.api_version.toString() + "-" + System.getenv().TRAVIS_BUILD_NUMBER.toString()
if(System.getenv().TRAVIS_BRANCH.toString().contains("Development"))
{
version = version + "-SNAPSHOT"
apiversion = apiversion + "-SNAPSHOT"
}
group = "com.SmithsModding.SmithsCore"
archivesBaseName = "SmithsCore"
minecraft {
mappings = "snapshot_20151130"
version = config.minecraft_version+ "-" + config.forge_version
runDir = "run/assets"
//Replacing stuff inside the code:
replace "@VERSION@", project.version
replace "@MCVERSION@", config.minecraft_version
replace "@APIVERSION@", apiversion
}
dependencies {
//Mod dependencies
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
}
//This will process all the resources used during build, and needed for running the project
processResources
{
//Replaces stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'VERSION': project.version, 'MCVERSION': config.minecraft_version
}
//Copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
exclude '**/Thumbs.db'
}
jar {
manifest {
attributes 'FMLAT': 'SmithsCore_at.cfg'
}
}
D:\Development\Minecraft\SmithsCore>gradlew setupDecompWorkspace idae
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'SmithsCore'.
> MISSING REPLACEMENT DATA FOR MAPPING_MCVERSION
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.474 secs
D:\Development\Minecraft\SmithsCore>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment