184 lines
5.5 KiB
Groovy
184 lines
5.5 KiB
Groovy
plugins {
|
|
id "net.minecraftforge.gradle.forge" version "2.0.1"
|
|
}
|
|
|
|
apply plugin: "maven"
|
|
|
|
repositories {
|
|
flatDir {
|
|
name "fileRepo"
|
|
dirs "repo"
|
|
}
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
group = "com.github.glitchfiend.biomesoplenty"
|
|
version = config.mod_version
|
|
archivesBaseName = "BiomesOPlenty"
|
|
|
|
minecraft {
|
|
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
|
|
mappings = "snapshot_nodoc_20150214"
|
|
}
|
|
|
|
// add some stuff to the version
|
|
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
|
|
|
|
// Source compiler configuration
|
|
tasks.withType(JavaCompile) {
|
|
//options.compilerArgs += [ '-Xlint:all', '-Xlint:-path', '-Xlint:-processing' ]
|
|
//options.deprecation = true
|
|
options.encoding = 'utf8'
|
|
}
|
|
|
|
def commonManifest = {
|
|
attributes 'FMLCorePlugin': 'biomesoplenty.common.asm.BOPLoadingPlugin'
|
|
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
|
attributes 'ForceLoadAsMod': true
|
|
attributes 'FMLAT': 'biomesoplenty_at.cfg'
|
|
}
|
|
|
|
jar {
|
|
manifest commonManifest
|
|
classifier = 'universal'
|
|
}
|
|
|
|
processResources {
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
include '**/*.info'
|
|
include '**/*.properties'
|
|
|
|
// replaces
|
|
expand ([
|
|
'modid': project.archivesBaseName,
|
|
'mod_version': project.config.mod_version,
|
|
'minecraft_version': project.config.minecraft_version,
|
|
'build_number': project.config.build_number
|
|
])
|
|
}
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
exclude '**/*.info'
|
|
exclude '**/*.properties'
|
|
}
|
|
}
|
|
|
|
import net.minecraftforge.gradle.tasks.JenkinsChangelog
|
|
import net.minecraftforge.gradle.common.Constants
|
|
|
|
task createChangelog(type: JenkinsChangelog) {
|
|
def jobName = "${System.getenv().JOB_NAME}"
|
|
def buildNumber = "${System.getenv().BUILD_NUMBER}"
|
|
|
|
serverRoot = 'http://ci.jenkins.minecraftforge.net/'
|
|
jobName = jobName.toString();
|
|
authName = 'console_script';
|
|
authPassword = 'dc6d48ca20a474beeac280a9a16a926e';
|
|
targetBuild = buildNumber.toString();
|
|
output = 'build/libs/' + project.getName() + '-' + project.version + '-changelog.txt';
|
|
}
|
|
|
|
tasks.build.dependsOn('createChangelog')
|
|
|
|
task sourcesJar(type: Jar) {
|
|
from sourceSets.main.allJava
|
|
from (sourceSets.main.output) {
|
|
include 'LICENSE.txt'
|
|
}
|
|
|
|
classifier = 'sources'
|
|
}
|
|
|
|
task deobfJar(type: Jar) {
|
|
from sourceSets.main.output
|
|
|
|
manifest commonManifest
|
|
classifier = 'deobf'
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives deobfJar
|
|
}
|
|
|
|
uploadArchives {
|
|
dependsOn 'build'
|
|
repositories.mavenDeployer {
|
|
if (project.hasProperty('forgeMavenPass'))
|
|
{
|
|
repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
|
|
authentication(userName: "forge", password: project.getProperty('forgeMavenPass')) // the elvis operator. look it up.
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local
|
|
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
|
}
|
|
|
|
pom {
|
|
groupId = project.group
|
|
version = project.version
|
|
artifactId = project.archivesBaseName
|
|
project {
|
|
name project.archivesBaseName
|
|
packaging 'jar'
|
|
description 'Biomes O Plenty'
|
|
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
|
|
|
scm {
|
|
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
|
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
|
|
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
|
|
}
|
|
|
|
issueManagement {
|
|
system 'github'
|
|
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
|
|
}
|
|
|
|
licenses {
|
|
license {
|
|
name 'Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International Public License'
|
|
url 'http://creativecommons.org/licenses/by-nc-nd/4.0/'
|
|
distribution 'repo'
|
|
}
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
id 'Adubbz'
|
|
name 'Adubbz'
|
|
roles { role 'developer' }
|
|
}
|
|
developer {
|
|
id 'Amnet'
|
|
name 'Amnet'
|
|
roles { role 'developer' }
|
|
}
|
|
developer {
|
|
id 'Forstride'
|
|
name 'Forstride'
|
|
roles { role 'developer' }
|
|
}
|
|
developer {
|
|
id 'ted80'
|
|
name 'ted80'
|
|
roles { role 'developer' }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|