WarpDrive/build.gradle

262 lines
9.1 KiB
Groovy
Raw Normal View History

2016-07-19 19:06:48 +02:00
buildscript {
repositories {
2016-07-19 19:06:48 +02:00
jcenter()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
2020-02-12 16:38:01 +01:00
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.1.2"
classpath "com.wynprice.cursemaven:CurseMaven:1.2.3"
}
}
2020-02-12 16:38:01 +01:00
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "com.matthewprenger.cursegradle"
apply plugin: "com.wynprice.cursemaven"
2016-02-07 23:39:03 +01:00
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
2015-08-08 15:46:59 +02:00
group = "cr0s.warpdrive" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 'SNAPSHOT'}"
2015-08-28 12:17:34 +02:00
archivesBaseName = "WarpDrive"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
2015-08-31 00:19:44 +02:00
minecraft {
2016-02-07 23:39:03 +01:00
version = config.minecraft_version + "-" + config.forge_version
runDir = "run"
2016-07-19 19:06:48 +02:00
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "${config.mappings_version}"
2016-07-19 19:06:48 +02:00
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
2015-08-08 15:46:59 +02:00
// replacing
replace "@version@", project.version
replaceIn "WarpDrive.java"
replaceIn "MyDummyModContainer.java"
}
curseforge {
2020-02-12 16:38:01 +01:00
// get token from gradle.properties (development space) or default to private environment variable (Travis CI & such)
if (project.hasProperty('token_curseforge')) {
apiKey = "${token_curseforge}"
} else {
apiKey = System.getenv('token_curseforge')
}
}
repositories {
2020-02-12 16:38:01 +01:00
mavenCentral()
maven { // JEI & Tinkers
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}
maven { // JEI fallback
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
maven { // CCC/NEI (for WAILA)
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
maven { // WAILA
name "ProfMobius Maven FS"
url "http://mobiusstrip.eu/maven"
}
maven { // OpenComputers
name "OpenComputers"
url "http://maven.cil.li/"
}
maven { // TOP
name 'tterrag maven'
url "http://maven.tterrag.com/"
}
maven { // CraftTweaker (aka MineTweaker3), Immersive Engineering, Patchouli
name 'jared maven'
url "http://blamejared.com/maven"
}
maven { // MCMultiPart
name 'amadornes maven'
url "http://maven.amadornes.com/"
}
maven {
name = "CoFH Maven"
url = "http://maven.covers1624.net"
}
// maven {
// name = "dmod's BuildBroken maven"
// url = "http://api.dmodoomsirius.me"
// }
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
ivy {
name "GalacticraftCore"
artifactPattern "https://ci.micdoodle8.com/job/Galacticraft-1.12/${config.Galacticraft_build}/artifact/Forge/build/libs/[module]-[revision].[ext]"
}
2020-02-12 16:38:01 +01:00
mavenLocal()
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
// using deobfCompile will include in run environment
provided "blusunrize:ImmersiveEngineering:${config.ImmersiveEngineering_version}:deobf"
provided "cofh:CoFHCore:${config.CoFHCore_version}:universal"
provided "cofh:RedstoneFlux:${config.RedstoneFlux_version}:universal"
provided "codechicken:CodeChickenLib:${config.CodeChickenLib_version}:universal"
provided name: "GalacticraftCore", version: "${config.Galacticraft_version}.${config.Galacticraft_build}", ext: "jar"
// provided "com.builtbroken.icbm-classic:ICBM-classic:${config.ICBMclassic_version}"
provided curse.resolve("icbm-classic", "${config.ICBMclassic_fileid}")
provided "li.cil.oc:OpenComputers:${config.OpenComputers_version}"
provided "vazkii.patchouli:Patchouli:${config.Patchouli_version}"
provided curse.resolve("matteroverdrive", "${config.MatterOverdrive_fileid}") // "${config.MatterOverdrive_version}"
2020-02-12 16:38:01 +01:00
// compileOnly "mezz.jei:jei_1.10.2:3.13.+"
// compileOnly "mcp.mobius.waila:Waila:1.7.0-B3_1.9.4"
// compileOnly "mcjty.theoneprobe:TheOneProbe:1.10-1.0.13-26"
// compileOnly "MineTweaker3:MineTweaker3-API:3.0.14.59"
// compileOnly "MCMultiPart2:MCMultiPart-exp:2.5.1+"
// compileOnly "slimeknights.mantle:Mantle:1.10.2-1.+"
// compileOnly "slimeknights:TConstruct:1.10.2-2.5.6.+"
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// skip source assets
2016-02-07 23:39:03 +01:00
exclude '**/*.pdn'
exclude '**/*.psd'
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
2016-02-07 23:39:03 +01:00
// 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'
}
}
// build the storage space for each computer scripts
task copyShipControllerCommons1(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveShipController'
into('build/resources/main/assets/warpdrive/lua.ComputerCraft/warpdriveShipCore')
}
task copyShipControllerCommons2(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveShipController'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipCore')
}
2018-09-23 20:07:05 +02:00
task copyOpenComputersCommons1(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator')
2018-09-23 20:07:05 +02:00
}
task copyOpenComputersCommons2(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore')
2018-09-23 20:07:05 +02:00
}
task copyOpenComputersCommons3(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
2018-04-29 17:34:37 +02:00
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController')
2018-09-23 20:07:05 +02:00
}
task copyOpenComputersCommons4(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipCore')
2018-09-23 20:07:05 +02:00
}
task copyOpenComputersCommons5(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
2018-04-29 17:34:37 +02:00
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveTransporterCore')
2018-09-23 20:07:05 +02:00
}
task copyOpenComputersCommons6(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
2018-04-29 17:34:37 +02:00
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveWeaponController')
}
jar {
dependsOn copyShipControllerCommons1, copyShipControllerCommons2
2018-09-23 20:07:05 +02:00
dependsOn copyOpenComputersCommons1, copyOpenComputersCommons2, copyOpenComputersCommons3, copyOpenComputersCommons4, copyOpenComputersCommons5, copyOpenComputersCommons6
2016-02-07 23:39:03 +01:00
manifest {
2017-03-12 16:53:00 +01:00
attributes FMLAT: "warpdrive_at.cfg"
2016-08-13 18:47:26 +02:00
attributes FMLCorePlugin: "cr0s.warpdrive.core.FMLLoadingPlugin"
attributes FMLCorePluginContainsFMLMod: "true"
}
classifier = ''
destinationDir = file 'output'
2016-05-16 05:56:04 +02:00
}
2018-07-01 04:04:56 +02:00
task signJar(type: SignJar) {
onlyIf { // Skip the task if our secret data isn't available
project.hasProperty('keyStore')
}
dependsOn reobfJar
if (project.hasProperty('keyStore')) { // This needs to be a path to the keystore file
keyStore = project.keyStore
alias = project.alias
storePass = project.storePass
keyPass = project.keyPass
inputFile = jar.archivePath
outputFile = jar.archivePath
}
}
build.dependsOn signJar
2016-05-16 05:56:04 +02:00
idea {
module {
inheritOutputDirs = true
}
}
runClient {
jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}
runServer {
jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}