2014-09-24 14:32:58 +02:00
|
|
|
// This sets us up for building a forge project - you need all of these
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
2015-11-23 05:59:04 +01:00
|
|
|
jcenter()
|
2014-09-24 14:32:58 +02:00
|
|
|
maven {
|
|
|
|
name = "forge"
|
|
|
|
url = "http://files.minecraftforge.net/maven"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
2016-05-20 00:17:38 +02:00
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
}
|
2016-01-18 21:39:18 +01:00
|
|
|
plugins {
|
|
|
|
id "com.matthewprenger.cursegradle" version "1.0.7"
|
|
|
|
}
|
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
apply plugin: 'idea'
|
2014-09-24 14:32:58 +02:00
|
|
|
|
|
|
|
// This is a simple flatdir repository for "uploadArchives" when you don't have a remote repo to target
|
|
|
|
repositories {
|
|
|
|
flatDir {
|
|
|
|
name "fileRepo"
|
|
|
|
dirs "repo"
|
|
|
|
}
|
2016-05-20 00:01:50 +02:00
|
|
|
maven {
|
|
|
|
name 'DVS1 Maven FS'
|
|
|
|
url 'http://dvs1.progwml6.com/files/maven'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2016-11-19 04:33:35 +01:00
|
|
|
deobfCompile "mezz.jei:jei_1.11:4.0.1.193"
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// This is our group. I'm cpw.mods
|
2016-06-24 00:42:26 +02:00
|
|
|
group = "cpw.mods" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
2014-09-24 14:32:58 +02:00
|
|
|
// This is our actual project within the group. Note: FML has "fml" here. But this is ironchest.
|
|
|
|
archivesBaseName = "ironchest"
|
|
|
|
|
|
|
|
// Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here
|
|
|
|
minecraft {
|
2016-11-19 04:33:35 +01:00
|
|
|
version = "1.11-13.19.0.2153"
|
|
|
|
mappings = "snapshot_20161118"
|
2015-11-23 06:34:34 +01:00
|
|
|
runDir = "run"
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
|
2016-01-19 07:21:35 +01:00
|
|
|
// IronChest uses git tagging to mark major versions. This sets up the project version to that version data
|
|
|
|
def versionInfo = getGitVersion()
|
|
|
|
version = "${project.minecraft.version}-${versionInfo['IronChest.version']}"
|
2016-01-18 21:39:18 +01:00
|
|
|
|
|
|
|
curseforge {
|
|
|
|
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
|
|
|
|
project {
|
|
|
|
id = '228756'
|
|
|
|
changelog = 'Empty'
|
|
|
|
releaseType = 'beta'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-24 14:32:58 +02:00
|
|
|
// This wrangles the resources for the jar files- stuff like textures and languages
|
|
|
|
processResources
|
|
|
|
{
|
|
|
|
// we're omitting the .xcf files - they're development only
|
|
|
|
exclude '**/*.xcf'
|
|
|
|
// we only want to do search/replace stuff in mcmod.info, nothing else
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include 'mcmod.info'
|
|
|
|
|
|
|
|
// replace version and mcversion
|
|
|
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
|
|
|
}
|
|
|
|
|
|
|
|
// copy everything else, thats not the mcmod.info
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
|
|
|
|
|
|
|
// generate version.properties file from the git version data earlier
|
|
|
|
doLast {
|
|
|
|
def propsFile = new File(destinationDir, 'version.properties')
|
|
|
|
def properties = new Properties()
|
|
|
|
properties.putAll(versionInfo)
|
|
|
|
properties['IronChest.build.mcversion'] = project.minecraft.version
|
|
|
|
properties.store(propsFile.newWriter(), null)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
// Configure an upload task. this is setup for uploading to files.minecraftforge.net. There are other examples around
|
|
|
|
uploadArchives {
|
|
|
|
repositories.mavenDeployer {
|
2014-09-24 14:32:58 +02:00
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
dependsOn 'build'
|
2014-09-24 14:32:58 +02:00
|
|
|
|
2016-01-13 04:48:43 +01:00
|
|
|
if (project.hasProperty('forgeMavenPassword'))
|
2015-11-23 05:59:04 +01:00
|
|
|
{
|
|
|
|
repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
|
2016-01-12 23:27:56 +01:00
|
|
|
authentication(userName: project.getProperty('forgeMavenUser'), password: project.getProperty('forgeMavenPassword')) // the elvis operator. look it up.
|
2015-11-23 05:59:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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())
|
|
|
|
}
|
|
|
|
// This is just the pom data for the maven repo
|
|
|
|
pom {
|
|
|
|
groupId = project.group
|
|
|
|
// Force the maven upload to use the <mcversion>-<version> syntax preferred at files
|
2016-01-19 07:21:35 +01:00
|
|
|
version = "${project.version}"
|
2015-11-23 05:59:04 +01:00
|
|
|
artifactId = project.archivesBaseName
|
|
|
|
project {
|
|
|
|
name project.archivesBaseName
|
|
|
|
packaging 'jar'
|
|
|
|
description 'IronChest'
|
2016-01-12 23:27:56 +01:00
|
|
|
url 'https://github.com/progwml6/IronChest'
|
2015-11-23 05:59:04 +01:00
|
|
|
|
|
|
|
scm {
|
|
|
|
url 'https://github.com/progwml6/IronChest'
|
|
|
|
connection 'scm:git:git://github.com/progwml6/IronChest.git'
|
|
|
|
developerConnection 'scm:git:git@github.com:progwml6/IronChest.git'
|
|
|
|
}
|
2014-09-24 14:32:58 +02:00
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
issueManagement {
|
|
|
|
system 'github'
|
|
|
|
url 'https://github.com/progwml6/IronChest/issues'
|
|
|
|
}
|
2014-09-24 14:32:58 +02:00
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'GNU Public License (GPL), Version 3.0'
|
|
|
|
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
|
2015-11-23 05:59:04 +01:00
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id 'cpw'
|
|
|
|
name 'cpw'
|
|
|
|
roles { role 'developer' }
|
2014-09-24 14:32:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is a special task for pulling the version information from git and the environment (for BUILD_NUMBER)
|
|
|
|
def getGitVersion()
|
|
|
|
{
|
|
|
|
def out = [:]
|
|
|
|
|
|
|
|
// call git command.
|
|
|
|
def outStream = new ByteArrayOutputStream()
|
|
|
|
def result = exec {
|
|
|
|
executable = 'git'
|
|
|
|
args = [ 'describe', '--long', "--match=[^(jenkins)]*"]
|
|
|
|
standardOutput = outStream
|
|
|
|
}
|
|
|
|
|
|
|
|
def fullVersion = outStream.toString().trim()
|
|
|
|
def matcher = fullVersion =~ /(\d+).(\d+)-(\d+)-(.*)/
|
|
|
|
|
|
|
|
def maj = matcher[0][1]
|
|
|
|
def min = matcher[0][2]
|
|
|
|
def rev = matcher[0][3]
|
2016-01-12 23:27:56 +01:00
|
|
|
def bn = System.getenv("PROMOTED_NUMBER") ?: System.getenv("BUILD_NUMBER") ?: "1"
|
2014-09-24 14:32:58 +02:00
|
|
|
|
|
|
|
out['IronChest.build.major.number'] = maj.toString()
|
|
|
|
out['IronChest.build.minor.number'] = min.toString()
|
|
|
|
out['IronChest.build.revision.number'] = rev.toString()
|
|
|
|
out['IronChest.build.githash'] = matcher[0][4].toString()
|
|
|
|
out['IronChest.build.number' ] = bn.toString()
|
|
|
|
out['IronChest.version' ] = "${maj}.${min}.${rev}.${bn}".toString()
|
|
|
|
|
|
|
|
return out
|
|
|
|
}
|