| defaultTasks 'fullBuild' |
| |
| buildscript { |
| repositories { |
| jcenter() |
| 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:2.2-SNAPSHOT' |
| } |
| } |
| |
| apply plugin: 'idea' |
| |
| idea { |
| module { |
| // For some reason this is necessary for IDEA 2014 workspaces to recognize assets |
| inheritOutputDirs = true |
| } |
| } |
| |
| apply plugin: 'net.minecraftforge.gradle.forge' |
| |
| repositories { |
| maven { |
| name 'ForgeFS' |
| url 'http://files.minecraftforge.net/maven' |
| } |
| maven { |
| name 'amadornes' |
| url 'http://maven.amadornes.com/' |
| } |
| maven { |
| name 'prog' |
| url 'http://dvs1.progwml6.com/files/maven' |
| } |
| maven { |
| name 'tesla' |
| url 'http://maven.epoxide.org' |
| } |
| maven { |
| name 'curseforge' |
| url 'https://minecraft.curseforge.com/api/maven/' |
| } |
| maven { |
| name 'opencomputers' |
| url 'http://maven.cil.li/' |
| } |
| maven { |
| name 'hwyla' |
| url 'http://tehnut.info/maven' |
| } |
| maven { |
| name 'buildcraft' |
| url 'https://mod-buildcraft.com/maven/' |
| } |
| maven { |
| name 'ic2' |
| url 'http://maven.ic2.player.to' |
| } |
| maven { |
| name 'thiakil.io' |
| url 'https://thiakil.github.io/maven/' |
| } |
| maven { |
| name 'thiakil mirror' //in case GitHub doesn't like maven being hosted in GH Pages |
| url 'http://maven.thiakil.com' |
| } |
| } |
| |
| // 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 |
| } |
| |
| version = "${config.minecraft_version}-${config.mod_version}." + (System.env.BUILD_NUMBER ?: "homebaked") |
| archivesBaseName = "MekanismAll" |
| libsDirName = "../output" |
| distsDirName = "../output" |
| sourceCompatibility = '1.8' |
| targetCompatibility = '1.8' |
| |
| minecraft { |
| version = config.minecraft_version + "-" + config.forge_version |
| mappings = "${config.mappings_version}" |
| runDir = "run" |
| useDepAts = true |
| } |
| |
| dependencies { |
| deobfCompile "MCMultiPart2:MCMultiPart-exp:${config.mcmp_version}" |
| deobfCompile "mezz.jei:jei_${config.minecraft_version}:${config.jei_version}" |
| compile "net.darkhax.tesla:Tesla:${config.tesla_version}" |
| compile "inventory-tweaks:InventoryTweaks:${config.invtweak_version}:api" |
| compile "li.cil.oc:OpenComputers:MC${config.minecraft_version}-${config.opencomputers_version}:api" |
| deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla_version}" |
| deobfCompile "com.mod-buildcraft:buildcraft-api:${config.buildcraft_version}" |
| compile "net.industrial-craft:industrialcraft-2:${config.ic2_version}:api" |
| compile ("com.jaquadro.minecraft.storagedrawers:StorageDrawers:${config.minecraft_version}-${config.storagedrawers_version}:api") { |
| exclude module: "Chameleon" // we only use the API, which doesn't need Chameleon |
| exclude module: "jei_1.11.2" |
| exclude module: "Hwyla" |
| } |
| } |
| |
| processResources |
| { |
| // copy everything else, thats not the mcmod.info |
| from(sourceSets.main.resources.srcDirs) { |
| exclude 'mcmod.info' |
| exclude '**/*.blend*' |
| } |
| } |
| |
| task coreJar(type: Jar) { |
| archiveName = "Mekanism-${project.version}.jar" |
| dependsOn 'reobfJar' |
| classifier "core" |
| |
| from('etc/core') { |
| include '*.info' |
| expand 'version':config.mod_version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version |
| } |
| |
| from zipTree(jar.outputs.getFiles().getSingleFile()).matching { |
| exclude 'mekanism/tools/**', 'mekanism/generators/**', 'assets/mekanismtools/**', 'assets/mekanismgenerators/**', 'mcmod.info' |
| } |
| } |
| |
| task toolsJar(type: Jar) { |
| archiveName = "MekanismTools-${project.version}.jar" |
| dependsOn 'reobfJar' |
| classifier "tools" |
| |
| from('etc/tools') { |
| include '*.info' |
| expand 'version':config.mod_version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version |
| } |
| |
| from zipTree(jar.outputs.getFiles().getSingleFile()).matching { |
| include 'mekanism/tools/**', 'assets/mekanismtools/**' |
| } |
| } |
| |
| task generatorsJar(type: Jar) { |
| archiveName = "MekanismGenerators-${project.version}.jar" |
| dependsOn 'reobfJar' |
| classifier "generators" |
| |
| from('etc/generators') { |
| include '*.info' |
| expand 'version':config.mod_version,'mc_version':config.minecraft_version,'mcmp_version':config.mcmp_version |
| } |
| |
| from zipTree(jar.outputs.getFiles().getSingleFile()).matching { |
| include 'mekanism/generators/**', 'assets/mekanismgenerators/**' |
| } |
| } |
| |
| task apiJar(type: Jar) { |
| classifier "api" |
| baseName "Mekanism" |
| dependsOn "sourceMainJava" |
| include 'mekanism/api/**' |
| from sourceSets.main.java.srcDirs |
| from sourceSets.main.output |
| } |
| |
| artifacts { |
| archives apiJar |
| archives coreJar |
| archives toolsJar |
| archives generatorsJar |
| } |
| |
| task fullBuild(type: Delete) { |
| delete jar |
| dependsOn "build" |
| } |
| |
| apply plugin: 'maven' |
| apply plugin: 'maven-publish' |
| |
| uploadArchives { |
| if(System.getenv("LOCAL_MAVEN") != null) { |
| repositories { |
| mavenDeployer { |
| repository(url: "file://"+System.getenv("LOCAL_MAVEN")) |
| pom { |
| groupId = project.group |
| version = project.version |
| if (System.getenv("MAVEN_ARTIFACT") != null) { |
| artifactId = System.getenv("MAVEN_ARTIFACT") |
| } else { |
| artifactId = "Mekanism" |
| } |
| project { |
| name "Mekanism" |
| packaging 'jar' |
| description 'Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.' |
| url 'http://aidancbrady.com/mekanism/' |
| scm { |
| url 'https://github.com/aidancbrady/Mekanism.git' |
| } |
| issueManagement { |
| system 'github' |
| url 'https://github.com/aidancbrady/Mekanism/issues' |
| } |
| licenses { |
| license { |
| name 'MIT' |
| distribution 'repo' |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |