Created
May 16, 2014 11:04
-
-
Save marchermans/aa0a966fdc1968feb7f7 to your computer and use it in GitHub Desktop.
Build.Gradle for Armory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the properties of this project | |
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 | |
} | |
logger.lifecycle("Minecraft version: " + config.minecraft_version) | |
logger.lifecycle("Forge version: " + config.forge_version) | |
logger.lifecycle("OrionsBelt version: " + config.orionsbelt_version) | |
logger.lifecycle("Mantle version: " + config.mantle_version) | |
logger.lifecycle("TinkersConstruct version: " + config.tconstruct_version) | |
logger.lifecycle("Mod version: " + config.mod_version) | |
// The ForgeGradle buildscript. | |
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
name = "forge" | |
url = "http://files.minecraftforge.net/maven" | |
} | |
maven { | |
name = "sonatype" | |
url = "https://oss.sonatype.org/content/repositories/snapshots/" | |
} | |
maven { | |
name 'OrionMinecraft' | |
url 'http://mavenrepo.orionminecraft.com' | |
} | |
maven { | |
name 'DVS1 Maven FS' | |
url 'http://dvs1.progwml6.com/files/maven' | |
} | |
} | |
dependencies { | |
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' | |
} | |
} | |
//The repositories in which the dependencies are stored | |
repositories { | |
mavenCentral() | |
maven { | |
name 'DVS1 Maven FS' | |
url 'http://dvs1.progwml6.com/files/maven' | |
} | |
maven { | |
name 'OrionMinecraft' | |
url 'http://mavenrepo.orionminecraft.com' | |
} | |
} | |
//These configurations are needed for uploading to a MavenRepo | |
configurations { | |
deployerJars | |
} | |
//These are the dependencies of Armory | |
dependencies { | |
//Mod dependencies | |
compile "com.Orion.OrionsBelt:OrionsBelt:"+ config.orionsbelt_version //<-- Error: Could not find funciton compile with given parameters// | |
compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf" | |
compile "tconstruct:TConstruct:${config.minecraft_version}-${config.tconstruct_version}:deobf" | |
//Maven uploader | |
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2' | |
} | |
apply plugin: 'forge' | |
apply plugin: 'maven' | |
version = config.mod_version.toString() + " - Alpha " + System.getenv().TRAVIS_BUILD_NUMBER.toString() | |
if(System.getenv().TRAVIS_BRANCH.toString().contains("Development")) | |
{ | |
version = version + "-SNAPSHOT" | |
} | |
group= "com.Orion.OrionsBelt" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | |
archivesBaseName = "OrionsBelt" | |
minecraft { | |
version = "1.7.2-10.12.1.1060" | |
assetDir = "run/assets" | |
} | |
processResources | |
{ | |
// this will ensure that this task is redone when the versions change. | |
inputs.property "version", project.version | |
inputs.property "mcversion", project.minecraft.version | |
// replace stuff in mcmod.info, nothing else | |
from(sourceSets.main.resources.srcDirs) { | |
include 'mcmod.info' | |
// replace version and mcversion | |
expand 'version':project.version, 'mcversion':project.minecraft.version | |
} | |
// copy everything else, thats not the mcmod.info | |
from(sourceSets.main.resources.srcDirs) { | |
exclude 'mcmod.info' | |
} | |
} | |
uploadArchives { | |
//logger.lifecycle("FTPUserName: "+ System.getenv().FTPUserName.toString()) | |
//logger.lifecycle("FTPPassword: "+ System.getenv().FTPPassword.toString()) | |
repositories.mavenDeployer { | |
configuration = configurations.deployerJars | |
if(System.getenv().TRAVIS_BRANCH.toString().contains("Development")) | |
{ | |
snapshotRepository(url: "ftp://mavenrepo.orionminecraft.com"){ | |
authentication(userName: System.getenv().FTPUserName.toString(), password: System.getenv().FTPPassword.toString()) | |
} | |
} | |
else { | |
repository(url: "ftp://mavenrepo.orionminecraft.com") { | |
authentication(userName: System.getenv().FTPUserName.toString(), password: System.getenv().FTPPassword.toString()) | |
} | |
} | |
} | |
} | |
task('uploadJars', dependsOn: uploadArchives) { | |
description = "uploads JARs" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment