BiomesOPlenty/build.gradle

126 lines
No EOL
3.5 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven {
name = "ForgeFS"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}
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 {
ivy {
name 'Forge FS legacy'
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
}
}
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'
}
group = "biomesoplenty"
version = config.mod_version
archivesBaseName = "BiomesOPlenty"
minecraft {
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
}
// add some stuff to the version
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
processResources {
// replace stuff in the files we want.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
include '**/*.properties'
// replaces
expand ([
'mod_version': project.config.mod_version,
'minecraft_version': project.config.minecraft_version,
'build_number': project.config.build_number,
'worldcore_version': project.config.worldcore_version
])
}
// copy everything else, thats we didnt do before
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'
}
appendix = 'universal'
}
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
import net.minecraftforge.gradle.common.Constants
import net.minecraftforge.gradle.delayed.*
task createChangelog(type: ChangelogTask) {
def jobName = "${System.getenv().JOB_NAME}"
def buildNumber = "${System.getenv().BUILD_NUMBER}"
setServerRoot(new DelayedString(project, 'http://ci.jenkins.minecraftforge.net/'))
setJobName(new DelayedString(project, jobName.toString()));
setAuthName(new DelayedString(project, 'console_script'));
setAuthPassword(new DelayedString(project, 'dc6d48ca20a474beeac280a9a16a926e'));
setTargetBuild({buildNumber.toString()});
setOutput(new DelayedFile(project, 'build/libs/' + jobName + '-changelog-' + "${project.version}" + '.txt'));
}
tasks.build.dependsOn('createChangelog')
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
appendix = 'src'
}
task apiJar(type: Jar) {
from(sourceSets.main.java)
{
include "biomesoplenty/api/*"
}
appendix = 'api'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
appendix = 'deobf'
}
artifacts {
archives sourceJar
archives deobfJar
archives apiJar
}