BiomesOPlenty/build.gradle

218 lines
6.2 KiB
Groovy
Raw Normal View History

2013-12-11 23:31:42 +00:00
buildscript {
repositories {
mavenCentral()
2014-01-26 07:02:49 +00:00
mavenLocal()
2013-12-11 23:31:42 +00:00
maven {
name = "ForgeFS"
url = "http://files.minecraftforge.net/maven"
}
2014-01-26 07:02:49 +00:00
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
2013-12-11 23:31:42 +00:00
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
2013-12-11 23:31:42 +00:00
}
}
2014-01-19 02:49:22 +00:00
configurations {
2014-01-19 02:56:17 +00:00
deployJars
2014-01-19 02:49:22 +00:00
}
apply plugin: "maven"
apply plugin: "forge"
2013-12-11 23:31:42 +00:00
2014-01-19 02:16:56 +00:00
repositories {
mavenLocal()
flatDir {
name "fileRepo"
dirs "repo"
}
ivy {
name 'Forge FS legacy'
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
}
}
2013-12-11 23:31:42 +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
}
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
}
group = "com.github.glitchfiend.biomesoplenty"
2013-12-11 23:31:42 +00:00
version = config.mod_version
archivesBaseName = "BiomesOPlenty"
2013-12-11 23:31:42 +00:00
minecraft {
2013-12-12 00:32:49 +00:00
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
assetDir = "run/assets"
2014-01-26 07:02:49 +00:00
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}"
jenkins {
job = 'BiomesOPlenty'
}
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 ([
2014-02-19 07:14:14 +00:00
'modid': project.archivesBaseName,
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'
}
}
jar {
manifest {
2014-01-16 06:31:27 +00:00
//attributes 'FMLCorePlugin': 'biomesoplenty.asm.BOPFMLLoadingPlugin'
//attributes 'FMLCorePluginContainsFMLMod': 'true'
2013-12-11 23:31:42 +00:00
}
2014-01-19 03:55:57 +00:00
classifier = '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) {
2014-01-26 07:02:49 +00:00
def jobName = "${System.getenv().JOB_NAME}"
def buildNumber = "${System.getenv().BUILD_NUMBER}"
2013-12-12 03:42:48 +00:00
2014-01-26 07:02:49 +00:00
setServerRoot(new DelayedString(project, 'http://ci.jenkins.minecraftforge.net/'))
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/distributions/' + project.getName() + '-' + project.version + '-changelog.txt'));
2013-12-12 02:31:58 +00:00
}
tasks.build.dependsOn('createChangelog')
2014-01-19 07:01:47 +00:00
2014-01-19 07:05:01 +00:00
task sourceZip(type: Zip) {
2014-01-19 02:42:01 +00:00
from sourceSets.main.allSource
2014-01-19 03:55:57 +00:00
classifier = 'src'
2014-01-19 02:42:01 +00:00
}
2014-01-19 07:05:01 +00:00
task apiZip(type: Zip) {
2014-01-19 02:42:01 +00:00
from(sourceSets.main.java)
{
include "biomesoplenty/api/*"
}
2014-01-19 03:55:57 +00:00
classifier = 'api'
2014-01-19 02:42:01 +00:00
}
task deobfJar(type: Jar) {
from sourceSets.main.output
2014-01-19 03:55:57 +00:00
classifier = 'deobf'
2014-01-19 02:42:01 +00:00
}
2014-01-19 02:43:33 +00:00
artifacts {
2014-01-19 07:05:01 +00:00
archives sourceZip
archives deobfJar
2014-01-19 07:05:01 +00:00
archives apiZip
2014-01-19 02:43:33 +00:00
}
2014-01-19 01:32:45 +00:00
uploadArchives {
repositories {
2014-01-26 07:02:49 +00:00
add getProject().repositories.mavenLocal()
2014-01-19 01:32:45 +00:00
}
repositories.mavenDeployer {
configuration = configurations.deployJars
2014-01-26 07:02:49 +00:00
2014-01-19 01:32:45 +00:00
if (project.hasProperty("filesmaven")) {
logger.info('Publishing to files server')
repository(url: project.filesmaven.url) {
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
}
} else {
logger.info('Publishing to repo folder')
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
}
pom.project {
name project.archivesBaseName
packaging 'jar'
2014-01-19 01:38:10 +00:00
description 'Biomes O Plenty'
2014-01-19 01:32:45 +00:00
url 'https://github.com/Glitchfiend/BiomesOPlenty'
2014-01-26 07:02:49 +00:00
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 3.0 Unported'
url 'http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US'
distribution 'repo'
}
}
developers {
developer {
id 'Adubbz'
name 'Adubbz'
roles { role 'developer' }
}
developer {
id 'Forstride'
name 'Forstride'
roles { role 'developer' }
}
developer {
id 'Amnet'
name 'Amnet'
roles { role 'developer' }
}
developer {
id 'ted80'
name 'ted80'
roles { role 'developer' }
}
}
}
}
2014-01-26 23:31:31 +00:00
}