WarpDrive/build.gradle
Unknown 530c5401bf Updated gradle script
- added curseforge maven
- switched to JEI fallback maven
2019-12-24 03:16:53 +01:00

247 lines
No EOL
8.2 KiB
Groovy

buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.1.2'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'
// 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
}
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'}"
archivesBaseName = "WarpDrive"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "run"
// 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}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// replacing
replace "@version@", project.version
replaceIn "WarpDrive.java"
replaceIn "MyDummyModContainer.java"
}
curseforge {
apiKey = "${token_curseforge}"
}
repositories {
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
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/"
}
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 "com.builtbroken.icbm-classic:ICBM-classic:${config.ICBMclassic_version}"
provided "li.cil.oc:OpenComputers:${config.OpenComputers_version}"
// 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
exclude '**/*.pdn'
exclude '**/*.psd'
// 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'
}
}
// 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')
}
task copyOpenComputersCommons1(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveAccelerator')
}
task copyOpenComputersCommons2(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore')
}
task copyOpenComputersCommons3(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipController')
}
task copyOpenComputersCommons4(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveShipCore')
}
task copyOpenComputersCommons5(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveTransporterCore')
}
task copyOpenComputersCommons6(type: Copy) {
from 'src/main/resources/assets/warpdrive/lua.OpenComputers/common'
into('build/resources/main/assets/warpdrive/lua.OpenComputers/warpdriveWeaponController')
}
jar {
dependsOn copyShipControllerCommons1, copyShipControllerCommons2
dependsOn copyOpenComputersCommons1, copyOpenComputersCommons2, copyOpenComputersCommons3, copyOpenComputersCommons4, copyOpenComputersCommons5, copyOpenComputersCommons6
manifest {
attributes FMLAT: "warpdrive_at.cfg"
attributes FMLCorePlugin: "cr0s.warpdrive.core.FMLLoadingPlugin"
attributes FMLCorePluginContainsFMLMod: "true"
}
classifier = ''
destinationDir = file 'output'
}
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
idea {
module {
inheritOutputDirs = true
}
}
runClient {
jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}
runServer {
jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}