2013-12-13 10:45:03 +01:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "forge"
|
|
|
|
url = "http://files.minecraftforge.net/maven"
|
|
|
|
}
|
2014-03-28 02:34:47 +01:00
|
|
|
maven {
|
|
|
|
name = "sonatype"
|
|
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
|
|
}
|
2013-12-13 10:45:03 +01:00
|
|
|
}
|
|
|
|
dependencies {
|
2014-04-02 01:47:39 +02:00
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
2013-12-13 10:45:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-30 17:29:45 +02:00
|
|
|
apply plugin: 'java'
|
2014-03-28 02:34:47 +01:00
|
|
|
apply plugin: 'forge'
|
2015-01-31 04:13:04 +01:00
|
|
|
apply plugin: 'curseforge'
|
2014-09-30 17:29:45 +02:00
|
|
|
apply plugin: 'maven'
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven { // The repo from which to get waila
|
|
|
|
name "Mobius Repo"
|
|
|
|
url "http://mobiusstrip.eu/maven"
|
|
|
|
}
|
|
|
|
maven { // the repo from which to get NEI and stuff
|
|
|
|
name 'CB Repo'
|
|
|
|
url "http://chickenbones.net/maven/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
2014-10-03 21:55:22 +02:00
|
|
|
compile "mcp.mobius.waila:Waila:1.5.6_dev1_1.7.10"
|
2014-09-30 17:29:45 +02:00
|
|
|
}
|
2013-12-13 10:45:03 +01:00
|
|
|
|
2014-05-26 22:03:54 +02:00
|
|
|
ext.configFile = file "build.properties"
|
|
|
|
|
|
|
|
configFile.withReader {
|
|
|
|
def prop = new Properties()
|
|
|
|
prop.load(it)
|
|
|
|
project.ext.config = new ConfigSlurper().parse prop
|
|
|
|
}
|
|
|
|
|
|
|
|
version = config.mod_version
|
2014-03-28 02:34:47 +01:00
|
|
|
group = "com.pahimar.ee3" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
2013-12-15 02:04:17 +01:00
|
|
|
archivesBaseName = "EquivalentExchange3"
|
2013-12-13 10:45:03 +01:00
|
|
|
|
|
|
|
minecraft {
|
2014-05-26 22:03:54 +02:00
|
|
|
version = config.minecraft_version + "-" + config.forge_version
|
2014-05-15 20:49:52 +02:00
|
|
|
|
2014-05-26 22:03:54 +02:00
|
|
|
replaceIn "reference/Reference.java"
|
2014-06-05 02:21:56 +02:00
|
|
|
replace "@VERSION@", "${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
|
2014-06-05 02:59:10 +02:00
|
|
|
if (project.hasProperty("ee3_signature")) {
|
|
|
|
replace "@FINGERPRINT@", project.ee3_signature
|
|
|
|
}
|
2014-05-15 20:49:52 +02:00
|
|
|
}
|
|
|
|
|
2014-05-26 22:03:54 +02:00
|
|
|
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
|
|
|
|
|
2014-06-05 02:21:56 +02:00
|
|
|
processResources {
|
|
|
|
// exclude xcf files, as they are for development only
|
|
|
|
exclude '**/*.xcf'
|
2014-05-16 17:48:51 +02:00
|
|
|
|
2014-06-05 02:21:56 +02:00
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include '*.info'
|
2014-03-28 02:34:47 +01:00
|
|
|
|
2014-06-05 02:21:56 +02:00
|
|
|
// replace version and mcversion
|
|
|
|
expand 'mod_version': project.version, 'minecraft_version': project.config.minecraft_version
|
|
|
|
}
|
2014-03-28 02:34:47 +01:00
|
|
|
|
2014-06-05 02:21:56 +02:00
|
|
|
// copy everything else, thats not the mcmod.info
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
2014-06-10 00:20:25 +02:00
|
|
|
exclude '**/*.info'
|
2014-06-05 02:21:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-19 21:36:14 +02:00
|
|
|
task devJar(type: Jar, dependsOn: 'classes') {
|
2014-07-14 18:17:15 +02:00
|
|
|
from(sourceSets.main.output) {
|
|
|
|
include '**'
|
|
|
|
}
|
|
|
|
|
|
|
|
extension = 'jar'
|
2014-07-19 21:36:14 +02:00
|
|
|
classifier = 'dev'
|
2014-07-14 18:17:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
2014-07-19 21:36:14 +02:00
|
|
|
archives devJar
|
2014-07-14 18:17:15 +02:00
|
|
|
}
|
2014-06-05 02:21:56 +02:00
|
|
|
|
|
|
|
import net.minecraftforge.gradle.delayed.*
|
|
|
|
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
|
|
|
|
|
|
|
|
task createChangelog(type: ChangelogTask) {
|
2014-06-05 02:59:10 +02:00
|
|
|
|
2014-06-05 03:49:23 +02:00
|
|
|
if (("${System.getenv().JOB_NAME}" != null) && project.hasProperty("jenkins_server") && project.hasProperty("jenkins_password")) {
|
2014-06-05 03:50:44 +02:00
|
|
|
def jobName = "${System.getenv().JOB_NAME}"
|
2014-06-05 03:49:23 +02:00
|
|
|
def buildNumber = "${System.getenv().BUILD_NUMBER}"
|
|
|
|
|
|
|
|
setServerRoot(new DelayedString(project, project.jenkins_server))
|
|
|
|
setJobName(new DelayedString(project, jobName.toString()))
|
|
|
|
setAuthName(new DelayedString(project, project.jenkins_user))
|
|
|
|
setAuthPassword(new DelayedString(project, project.jenkins_password))
|
|
|
|
setTargetBuild({ buildNumber.toString() });
|
2014-09-04 21:58:11 +02:00
|
|
|
setOutput(new DelayedFile(project, 'build/libs/' + project.archivesBaseName + '-' + project.version + '-changelog.txt'));
|
2014-06-05 03:49:23 +02:00
|
|
|
}
|
2014-06-05 02:59:10 +02:00
|
|
|
|
|
|
|
onlyIf {
|
2014-06-05 03:00:55 +02:00
|
|
|
return (("${System.getenv().JOB_NAME}" != null) && project.hasProperty("jenkins_server") && project.hasProperty("jenkins_password"))
|
2014-06-05 02:59:10 +02:00
|
|
|
}
|
2014-06-05 02:21:56 +02:00
|
|
|
}
|
|
|
|
|
2014-06-05 02:59:10 +02:00
|
|
|
tasks.build.dependsOn('createChangelog')
|
2014-09-03 21:54:07 +02:00
|
|
|
tasks.build.dependsOn('signJar')
|
|
|
|
|
|
|
|
if (!project.hasProperty("keystore_location")) // keystore stuff
|
|
|
|
ext.keystore_location = "."
|
|
|
|
if (!project.hasProperty("keystore_password")) // keystore stuff
|
|
|
|
ext.keystore_password = ""
|
|
|
|
if (!project.hasProperty("ee3_keystore_alias")) // keystore stuff
|
|
|
|
ext.ee3_keystore_alias = ""
|
|
|
|
|
2014-09-04 19:09:07 +02:00
|
|
|
task signJar(dependsOn: ["reobf", "devJar"]) {
|
|
|
|
inputs.dir jar.destinationDir
|
2014-09-03 21:54:07 +02:00
|
|
|
inputs.file keystore_location
|
|
|
|
inputs.property "ee3_keystore_alias", ee3_keystore_alias
|
|
|
|
inputs.property "keystore_password", keystore_password
|
2014-09-04 19:09:07 +02:00
|
|
|
outputs.dir devJar.destinationDir
|
2014-10-01 05:48:42 +02:00
|
|
|
|
2014-09-03 21:54:07 +02:00
|
|
|
// only sign if the keystore exists
|
|
|
|
onlyIf {
|
|
|
|
return keystore_location != "." && keystore_password != ""
|
|
|
|
}
|
|
|
|
// the actual action.. sign the jar.
|
|
|
|
doLast {
|
2014-09-04 19:09:07 +02:00
|
|
|
jar.destinationDir.eachFile { file ->
|
|
|
|
if (!file.getPath().endsWith(".jar"))
|
|
|
|
return; // skip non-jars
|
|
|
|
|
|
|
|
logger.lifecycle "signing $file"
|
|
|
|
ant.signjar(
|
2014-10-01 05:48:42 +02:00
|
|
|
destDir: file.getParentFile(), // same place it came from
|
|
|
|
jar: file,
|
|
|
|
keystore: keystore_location,
|
|
|
|
alias: ee3_keystore_alias,
|
|
|
|
storepass: keystore_password
|
2014-09-04 19:09:07 +02:00
|
|
|
)
|
2014-10-01 05:48:42 +02:00
|
|
|
}
|
2014-09-03 21:54:07 +02:00
|
|
|
}
|
|
|
|
}
|
2014-07-18 03:35:36 +02:00
|
|
|
|
2014-10-01 05:48:42 +02:00
|
|
|
task copyChicken(type: Copy, dependsOn: "extractUserDev") {
|
|
|
|
from { configurations.compile }
|
2014-10-03 21:55:22 +02:00
|
|
|
include "**/*Chicken*.jar", "**/*NotEnoughItems*.jar"
|
2014-10-01 05:48:42 +02:00
|
|
|
exclude "**/CodeChickenLib*" // because CCC downloads it anyways.. -_-
|
|
|
|
into file("./run/mods") // paralell to the assets dir
|
|
|
|
mustRunAfter "deobfBinJar"
|
|
|
|
mustRunAfter "repackMinecraft"
|
|
|
|
}
|
|
|
|
tasks.setupDevWorkspace.dependsOn copyChicken
|
|
|
|
tasks.setupDecompWorkspace.dependsOn copyChicken
|
|
|
|
|
2015-01-31 04:13:04 +01:00
|
|
|
curse {
|
2015-01-31 05:31:54 +01:00
|
|
|
dependsOn 'reobf'
|
|
|
|
onlyIf { return project.hasProperty('ee3_curseforge_apikey') }
|
|
|
|
|
2015-01-31 04:13:04 +01:00
|
|
|
projectId = project.ee3_curseforge_projectid
|
2015-01-31 04:41:26 +01:00
|
|
|
apiKey = project.ee3_curseforge_apikey
|
2015-01-31 05:31:54 +01:00
|
|
|
changelog = project.hasProperty('changelog') ? project.changelog : ''
|
2015-02-02 03:04:49 +01:00
|
|
|
releaseType = config.release_type
|
2015-01-31 05:31:54 +01:00
|
|
|
|
2015-01-31 04:13:04 +01:00
|
|
|
additionalArtifact devJar
|
|
|
|
}
|
|
|
|
|
2014-07-18 03:35:36 +02:00
|
|
|
uploadArchives {
|
|
|
|
repositories {
|
|
|
|
mavenDeployer {
|
|
|
|
if (project.hasProperty("forgemaven_url")) {
|
|
|
|
logger.info('Publishing to files server')
|
|
|
|
repository(url: project.forgemaven_url) {
|
|
|
|
authentication(userName: project.forgemaven_username, password: project.forgemaven_password)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pom {
|
|
|
|
groupId = project.group
|
|
|
|
version = project.version
|
|
|
|
artifactId = project.archivesBaseName
|
|
|
|
}
|
|
|
|
|
|
|
|
pom.project {
|
|
|
|
name project.archivesBaseName
|
|
|
|
packaging 'jar'
|
|
|
|
description 'Equivalent Exchange 3'
|
|
|
|
url 'https://github.com/pahimar/Equivalent-Exchange-3/'
|
|
|
|
|
2014-07-18 03:38:41 +02:00
|
|
|
scm {
|
|
|
|
url 'https://github.com/pahimar/Equivalent-Exchange-3/'
|
|
|
|
connection 'scm:git:git://github.com/pahimar/Equivalent-Exchange-3.git'
|
|
|
|
developerConnection 'scm:git:git@github.com/pahimar/Equivalent-Exchange-3.git'
|
|
|
|
}
|
2014-07-18 03:35:36 +02:00
|
|
|
|
2014-07-18 03:38:41 +02:00
|
|
|
issueManagement {
|
|
|
|
system 'github'
|
|
|
|
url 'https://github.com/pahimar/Equivalent-Exchange-3/issues'
|
|
|
|
}
|
2014-07-18 03:35:36 +02:00
|
|
|
|
2014-07-18 03:38:41 +02:00
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'GNU Lesser General Public License 3.0'
|
|
|
|
url 'https://www.gnu.org/licenses/lgpl-3.0.txt'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
2014-07-18 03:35:36 +02:00
|
|
|
}
|
|
|
|
|
2014-07-18 03:38:41 +02:00
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id 'Pahimar'
|
|
|
|
name 'Pahimar'
|
|
|
|
roles {
|
|
|
|
role 'developer'
|
|
|
|
}
|
2014-07-18 03:35:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-09-04 19:09:07 +02:00
|
|
|
}
|