BiomesOPlenty/build.gradle

185 lines
5.1 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
2015-12-15 08:36:54 +00:00
jcenter()
maven {
2015-12-15 08:36:54 +00:00
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
2015-12-15 08:36:54 +00:00
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
2015-12-15 08:36:54 +00:00
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
2014-10-04 14:37:48 +00: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)
project.ext.config = new ConfigSlurper().parse prop
}
2014-10-05 01:07:24 +00:00
group = "com.github.glitchfiend.biomesoplenty"
2014-10-04 14:37:48 +00:00
version = config.mod_version
2015-06-19 09:58:24 +00:00
archivesBaseName = "BiomesOPlenty"
2014-10-04 14:37:48 +00:00
minecraft {
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
2015-12-15 08:36:54 +00:00
mappings = "snapshot_nodoc_20151214"
2014-10-04 14:37:48 +00:00
}
// add some stuff to the version
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
def commonManifest = {
attributes 'FMLCorePlugin': 'biomesoplenty.common.asm.BOPLoadingPlugin'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'ForceLoadAsMod': true
attributes 'FMLAT': 'biomesoplenty_at.cfg'
}
jar {
2015-03-10 05:33:46 +00:00
manifest commonManifest
classifier = 'universal'
}
2014-10-04 14:37:48 +00:00
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
2014-10-04 14:37:48 +00:00
])
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
}
}
2015-12-15 08:36:54 +00:00
import net.minecraftforge.gradle.tasks.JenkinsChangelog
2014-10-04 14:37:48 +00:00
import net.minecraftforge.gradle.common.Constants
2015-12-15 08:36:54 +00:00
task createChangelog(type: JenkinsChangelog) {
2014-10-04 14:37:48 +00:00
def buildNumber = "${System.getenv().BUILD_NUMBER}"
2015-12-15 08:36:54 +00:00
serverRoot = 'http://ci.jenkins.minecraftforge.net/'
jobName = 'BiomesOPlenty'
authName = 'console_script';
authPassword = 'dc6d48ca20a474beeac280a9a16a926e';
targetBuild = buildNumber.toString();
output = 'build/libs/' + project.getName() + '-' + project.version + '-changelog.txt';
}
2014-10-04 14:37:48 +00:00
tasks.build.dependsOn('createChangelog')
2015-12-15 08:36:54 +00:00
task sourcesJar(type: Jar) {
2014-10-04 14:37:48 +00:00
from sourceSets.main.allJava
from (sourceSets.main.output) {
include 'LICENSE.txt'
}
2014-10-04 14:37:48 +00:00
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
manifest commonManifest
2014-10-04 14:37:48 +00:00
classifier = 'deobf'
}
artifacts {
2015-12-15 08:36:54 +00:00
archives sourcesJar
2014-10-04 14:37:48 +00:00
archives deobfJar
}
2015-01-12 01:06:26 +00:00
uploadArchives {
2015-12-15 09:09:28 +00:00
dependsOn 'build'
2015-12-15 09:05:06 +00:00
repositories {
if (project.hasProperty("filesmaven")) {
2015-12-15 08:36:54 +00:00
logger.info('Publishing to files server')
2015-12-15 09:05:06 +00:00
mavenDeployer {
configuration = configurations.deployJars
repository(url: project.filesmaven.url) {
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
}
2015-12-15 09:05:06 +00:00
// This is just the pom data for the maven repo
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' }
}
}
}
}
}
} else {
logger.info('Publishing to repo folder')
2015-12-15 09:05:06 +00:00
mavenDeployer {
pom.version = "${project.minecraft.version}-${project.version}"
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
2014-10-04 14:37:48 +00:00
}
}
2015-12-15 08:36:54 +00:00
}