BiomesOPlenty/build.gradle

126 lines
3.5 KiB
Groovy
Raw Normal View History

2013-12-11 23:31:42 +00:00
buildscript {
repositories {
mavenCentral()
maven {
name = "ForgeFS"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
2013-12-27 05:44:33 +00:00
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
2013-12-11 23:31:42 +00:00
}
}
apply plugin: "forge"
// 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)
project.ext.config = new ConfigSlurper().parse prop
}
repositories {
2013-12-12 00:32:49 +00:00
ivy {
name 'Forge FS legacy'
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
}
2013-12-11 23:31:42 +00:00
}
dependencies {
//compile name: 'WorldCore', version: "${config.minecraft_version}-${config.worldcore_version}", ext: 'jar'
//compile name: 'ForgeMultipart', version: "${config.minecraft_version}-${config.fmp_version}", ext: 'jar'
2013-12-11 23:31:42 +00:00
}
2013-12-12 00:32:49 +00:00
group = "biomesoplenty"
2013-12-11 23:31:42 +00:00
version = config.mod_version
archivesBaseName = "BiomesOPlenty"
minecraft {
2013-12-12 00:32:49 +00:00
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
assetDir = "run/assets"
replaceIn "BiomesOPlenty.java"
replace "1.42.666.42.1", config.forge_version
2013-12-11 23:31:42 +00:00
}
// add some stuff to the version
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
2013-12-12 00:32:49 +00:00
processResources {
// replace stuff in the files we want.
2013-12-11 23:31:42 +00:00
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
2013-12-12 00:32:49 +00:00
2013-12-11 23:31:42 +00:00
// replaces
expand ([
2013-12-12 00:32:49 +00:00
'mod_version': project.config.mod_version,
'minecraft_version': project.config.minecraft_version,
'build_number': project.config.build_number,
'worldcore_version': project.config.worldcore_version
])
2013-12-11 23:31:42 +00:00
}
2013-12-12 00:32:49 +00:00
// copy everything else, thats we didnt do before
2013-12-11 23:31:42 +00:00
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
}
}
// change the name of my obfuscated jar
jar {
manifest {
attributes 'FMLCorePlugin': 'biomesoplenty.asm.BOPFMLLoadingPlugin'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
2013-12-12 00:32:49 +00:00
appendix = 'universal'
2013-12-11 23:31:42 +00:00
}
2013-12-12 02:31:58 +00:00
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
import net.minecraftforge.gradle.common.Constants
2013-12-12 02:31:58 +00:00
import net.minecraftforge.gradle.delayed.*
task createChangelog(type: ChangelogTask) {
2013-12-12 03:42:48 +00:00
def jobName = "${System.getenv().JOB_NAME}"
2013-12-12 03:50:07 +00:00
def buildNumber = "${System.getenv().BUILD_NUMBER}"
2013-12-12 03:42:48 +00:00
2013-12-12 02:43:44 +00:00
setServerRoot(new DelayedString(project, 'http://ci.jenkins.minecraftforge.net/'))
2013-12-12 03:47:42 +00:00
setJobName(new DelayedString(project, jobName.toString()));
2013-12-12 02:43:44 +00:00
setAuthName(new DelayedString(project, 'console_script'));
setAuthPassword(new DelayedString(project, 'dc6d48ca20a474beeac280a9a16a926e'));
2013-12-12 03:50:07 +00:00
setTargetBuild({buildNumber.toString()});
setOutput(new DelayedFile(project, 'build/libs/' + jobName + '-changelog-' + "${project.version}" + '.txt'));
2013-12-12 02:31:58 +00:00
}
2013-12-12 02:37:46 +00:00
tasks.build.dependsOn('createChangelog')
2013-12-11 23:31:42 +00:00
// add a source jar
task sourceJar(type: Jar) {
2013-12-12 00:32:49 +00:00
from sourceSets.main.allSource
appendix = 'src'
2013-12-11 23:31:42 +00:00
}
task apiJar(type: Jar) {
2013-12-12 00:32:49 +00:00
from(sourceSets.main.java)
2013-12-11 23:31:42 +00:00
{
include "biomesoplenty/api/*"
}
appendix = 'api'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
2013-12-12 00:32:49 +00:00
from sourceSets.main.output
appendix = 'deobf'
2013-12-11 23:31:42 +00:00
}
artifacts {
2013-12-12 00:32:49 +00:00
archives sourceJar
archives deobfJar
archives apiJar
2013-12-11 23:31:42 +00:00
}