Skip to content

Commit

Permalink
Gradlise 1.6.x builds for Mantle inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunstrike committed Jan 8, 2014
1 parent aafb1ec commit 396abec
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 318 deletions.
160 changes: 160 additions & 0 deletions build.gradle
@@ -0,0 +1,160 @@
/*
* Tinkers Construct
* Master build file
*
* Authors: Sunstrike, ProgWML6
* Help from AbrarSyed
*/

buildscript {
repositories {
mavenCentral()
maven {
name = 'ForgeFS'
url = 'http://files.minecraftforge.net/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}

repositories {
ivy {
name 'Forge FS legacy'
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
}
ivy {
name 'CB FS'
artifactPattern "http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.6.4/[module]-dev%20[revision].[ext]"
}
maven {
name 'SlimeKnights Maven FS'
url 'http://aeon.sunstrike.io'
}
maven {
name 'ForgeFS'
url 'http://files.minecraftforge.net/maven'
}
}

// Load ForgeGradle
apply plugin: 'forge'

// Define properties file
ext.configFile = file "build.properties"

configFile.withReader {
// Load config. It shall from now be referenced as simply config or project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}

ext.artifact_version_override = 'NotUsed'
//gitignored config file -- if this has the entry for override it will override the version for local builds
//create a file called version.properties with the line artifact_version_override=NotUsed
//replace not used w/ version #'s for manual local overrides
ext.configFile2 = file "version.properties"
if (configFile2.exists()){
configFile2.withReader {
def prop2 = new Properties()
prop2.load(it)
ext.GIVersionFL = new ConfigSlurper().parse prop2
if (GIVersionFL != null){
project.artifact_version_override = GIVersionFL.artifact_version_override
}
}
}

dependencies {
compile "mantle:Mantle:${config.mantle_version}:dev"
compile name: 'ForgeMultipart', version: "${config.minecraft_version}-${config.FMP_version}", ext: 'jar'
compile name: 'CodeChickenLib', version: "${config.minecraft_version}-${config.CCLIB_version}", ext: 'jar'
compile name: 'NotEnoughItems', version: "${config.NEI_version}", type: 'jar'
}

// Finds and sets version data
task buildInfo {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
proc.waitFor()
if (proc.exitValue() == 0) {
ext.revision = proc.text.trim()
} else {
ext.revision = "GITBORK"
}

if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "DEV"
}
}
ext.artifact_version = 'NFG'
if (System.getenv().ARTIFACT_VERSION == null && artifact_version_override == 'NotUsed') {
artifact_version = "${project.buildInfo.buildNum}.${project.buildInfo.revision}"
}
if (System.getenv().ARTIFACT_VERSION != null && artifact_version_override == 'NotUsed') {
artifact_version = "${system.getenv().ARTIFACT_VERSION}"
}
if (artifact_version_override != 'NotUsed') {
artifact_version = "${artifact_version_override}"
}
version = "${config.minecraft_version}-${artifact_version}"

minecraft {
version = config.minecraft_version + "-" + config.forge_version
assetDir = 'run/assets'
replace '${version}', project.version
}


sourceSets {
main {
resources {
srcDir 'resources'
}
}
}
processResources
{
// Replace stuff in text files, not binaries.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
// Replace version and MCversion
expand 'version':artifact_version,'MCversion':config.minecraft_version
}

// Copy everything else that's not text
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
}
}

// Add Coremod Manifest
jar {
manifest {
attributes 'FMLCorePlugin': 'tconstruct.preloader.TConstructLoaderContainer'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
}

// Create deobf dev jars
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}

// Create API library jar
task libJar(type: Jar) {
from(sourceSets.main.java) {
include "tconstruct/library/*"
}
classifier = 'lib'
}

artifacts {
archives deobfJar
archives libJar
}
6 changes: 6 additions & 0 deletions build.properties
@@ -0,0 +1,6 @@
minecraft_version=1.6.4
forge_version=9.11.1.964
mantle_version=906110
FMP_version=1.0.0.182
CCLIB_version=1.0.0.36
NEI_version=1.6.1.8

0 comments on commit 396abec

Please sign in to comment.