equivalent-exchange-3/build.gradle

152 lines
4.7 KiB
Groovy
Raw Normal View History

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-03-28 02:34:47 +01:00
apply plugin: 'forge'
2013-12-13 10:45:03 +01: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
archivesBaseName = "EquivalentExchange3"
2013-12-13 10:45:03 +01:00
minecraft {
version = config.minecraft_version + "-" + config.forge_version
replaceIn "reference/Reference.java"
replace "@VERSION@", "${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
if (project.hasProperty("ee3_signature")) {
replace "@FINGERPRINT@", project.ee3_signature
}
}
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
processResources {
// exclude xcf files, as they are for development only
exclude '**/*.xcf'
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include '*.info'
2014-03-28 02:34:47 +01:00
// replace version and mcversion
expand 'mod_version': project.version, 'minecraft_version': project.config.minecraft_version
}
2014-03-28 02:34:47 +01:00
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
2014-06-10 00:20:25 +02:00
exclude '**/*.info'
}
}
task devJar(type: Jar, dependsOn: 'classes') {
from(sourceSets.main.output) {
include '**'
}
extension = 'jar'
classifier = 'dev'
}
artifacts {
archives devJar
}
import net.minecraftforge.gradle.delayed.*
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
task createChangelog(type: ChangelogTask) {
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() });
setOutput(new DelayedFile(project, 'build/libs/' + project.getName() + '-' + project.version + '-changelog.txt'));
}
onlyIf {
return (("${System.getenv().JOB_NAME}" != null) && project.hasProperty("jenkins_server") && project.hasProperty("jenkins_password"))
}
}
tasks.build.dependsOn('createChangelog')
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:38:41 +02:00
issueManagement {
system 'github'
url 'https://github.com/pahimar/Equivalent-Exchange-3/issues'
}
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:38:41 +02:00
developers {
developer {
id 'Pahimar'
name 'Pahimar'
roles {
role 'developer'
}
}
}
}
}
}
}