2015-04-10 00:17:30 +02:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "forge"
|
|
|
|
url = "http://files.minecraftforge.net/maven"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "sonatype"
|
|
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
2016-05-26 18:31:02 +02:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "Modmuss50"
|
|
|
|
url = "http://maven.modmuss50.me/"
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
2016-05-18 17:53:54 +02:00
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-23 15:37:18 +01:00
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
2015-04-10 00:17:30 +02:00
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
|
2016-02-28 18:00:27 +01:00
|
|
|
sourceCompatibility = 1.8
|
|
|
|
targetCompatibility = 1.8
|
2015-11-24 20:37:15 +01:00
|
|
|
|
2015-04-10 10:43:45 +02:00
|
|
|
|
|
|
|
repositories {
|
2015-04-20 21:08:14 +02:00
|
|
|
maven {
|
|
|
|
name = "Modmuss50"
|
2016-07-01 16:55:37 +02:00
|
|
|
url = "http://maven.modmuss50.me/"
|
2015-04-20 21:08:14 +02:00
|
|
|
}
|
2015-06-10 20:54:50 +02:00
|
|
|
maven {
|
|
|
|
name "TiC"
|
|
|
|
url "http://dvs1.progwml6.com/files/maven"
|
|
|
|
}
|
2016-02-29 12:20:40 +01:00
|
|
|
maven {
|
|
|
|
name = "Amadornes"
|
|
|
|
url "http://maven.amadornes.com/"
|
|
|
|
}
|
2016-04-13 14:47:02 +02:00
|
|
|
ivy {
|
|
|
|
name "CraftTweaker3"
|
|
|
|
artifactPattern "http://www.blamejared.com/content/[module]-[classifier]-Full-[revision].[ext]"
|
|
|
|
}
|
2016-05-06 20:49:23 +02:00
|
|
|
maven {
|
2016-05-28 11:06:54 +02:00
|
|
|
url 'http://maven.epoxide.xyz'
|
2016-05-06 20:49:23 +02:00
|
|
|
}
|
2016-06-04 15:53:16 +02:00
|
|
|
maven {
|
|
|
|
url "http://maven.tterrag.com/"
|
|
|
|
}
|
2016-06-04 19:04:30 +02:00
|
|
|
maven {
|
|
|
|
name = "ic2"
|
|
|
|
url = "http://maven.ic2.player.to/"
|
|
|
|
}
|
2016-12-07 14:52:48 +01:00
|
|
|
|
2016-11-26 23:34:54 +01:00
|
|
|
maven {// HWYLA
|
|
|
|
name "TehNut"
|
|
|
|
url "http://tehnut.info/maven/"
|
|
|
|
}
|
2015-04-10 10:43:45 +02:00
|
|
|
}
|
|
|
|
|
2015-08-27 17:29:13 +02:00
|
|
|
configurations {
|
|
|
|
shade
|
|
|
|
compile.extendsFrom shade
|
|
|
|
}
|
|
|
|
|
2016-04-16 21:28:11 +02:00
|
|
|
|
2017-01-18 18:13:34 +01:00
|
|
|
version = "2.1.1"
|
2015-12-30 18:23:45 +01:00
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
def ENV = System.getenv()
|
|
|
|
if (ENV.BUILD_NUMBER) {
|
2016-03-23 20:03:23 +01:00
|
|
|
version = version + "." + "${System.getenv().BUILD_NUMBER}"
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
minecraft {
|
2016-12-27 20:47:54 +01:00
|
|
|
version = "1.11.2-13.20.0.2201"
|
2016-11-19 13:50:08 +01:00
|
|
|
mappings = "snapshot_20161118"
|
2015-04-10 00:17:30 +02:00
|
|
|
replace "@MODVERSION@", project.version
|
2016-03-16 21:50:37 +01:00
|
|
|
// makeObfSourceJar = false
|
2016-03-22 12:38:41 +01:00
|
|
|
useDepAts = true
|
2015-11-29 11:42:34 +01:00
|
|
|
runDir = "run"
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
group = 'TechReborn'
|
|
|
|
|
2016-02-29 12:20:40 +01:00
|
|
|
def grabDep(name, url){
|
|
|
|
ant.get(src: url, dest: 'dep')
|
|
|
|
file("dep/" + url.substring(url.lastIndexOf("/"))).renameTo(file("dep/" + name + ".jar"))
|
|
|
|
}
|
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
dependencies {
|
2016-02-29 12:20:40 +01:00
|
|
|
def f = new File('dep/')
|
|
|
|
if(f.exists()){
|
|
|
|
f.delete()
|
|
|
|
}
|
|
|
|
f.mkdirs()
|
|
|
|
if(!f.exists()){
|
|
|
|
f.mkdir()
|
|
|
|
}
|
2016-12-27 21:08:28 +01:00
|
|
|
deobfCompile 'RebornCore:RebornCore-1.11.2:+:universal'
|
2016-11-26 23:34:54 +01:00
|
|
|
deobfCompile "mezz.jei:jei_1.11:+"
|
|
|
|
compile "mcp.mobius.waila:Hwyla:+"
|
2016-11-27 02:15:59 +01:00
|
|
|
compile "net.darkhax.tesla:Tesla:1.11-1.3.0.51:deobf"
|
|
|
|
|
2016-11-26 23:34:54 +01:00
|
|
|
//1.11 updates
|
|
|
|
//deobfCompile "slimeknights:TConstruct:1.10.2-2.5.3.jenkins384"
|
|
|
|
//deobfCompile "slimeknights.mantle:Mantle:1.10.2-1.0.0.jenkins170"
|
|
|
|
deobfCompile "mcjty.theoneprobe:TheOneProbe:1.11-1.3.3-46"
|
2016-11-27 02:15:59 +01:00
|
|
|
|
2016-12-14 10:28:05 +01:00
|
|
|
compileOnly 'net.industrial-craft:industrialcraft-2:2.6.129-ex110'
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2015-06-24 00:41:03 +02:00
|
|
|
|
|
|
|
processResources
|
|
|
|
{
|
2015-11-26 21:43:56 +01:00
|
|
|
// this will ensure that this task is redone when the versions change.
|
|
|
|
inputs.property "version", project.version
|
|
|
|
inputs.property "mcversion", project.minecraft.version
|
|
|
|
|
2015-06-24 00:41:03 +02:00
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include 'mcmod.info'
|
|
|
|
|
|
|
|
// replace version and mcversion
|
2015-07-01 17:53:03 +02:00
|
|
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
2015-06-24 00:41:03 +02:00
|
|
|
}
|
|
|
|
|
2015-11-26 21:43:56 +01:00
|
|
|
// copy everything else, thats not the mcmod.info
|
2015-06-24 00:41:03 +02:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
|
|
|
}
|
2015-07-01 17:53:03 +02:00
|
|
|
|
2015-11-26 21:43:56 +01:00
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
task deobfJar(type: Jar) {
|
|
|
|
from sourceSets.main.output
|
|
|
|
exclude "**/*.psd"
|
|
|
|
classifier = 'dev'
|
2016-04-16 10:02:33 +02:00
|
|
|
}
|
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
|
|
|
|
jar {
|
|
|
|
exclude "**/*.psd"
|
|
|
|
classifier = 'universal'
|
2015-11-24 20:44:24 +01:00
|
|
|
// configurations.shade.each { dep ->
|
|
|
|
// from(project.zipTree(dep)){
|
|
|
|
// include 'ic2/api/'
|
|
|
|
// include 'forestry/api/fuels/'
|
|
|
|
// exclude 'META-INF', 'META-INF/**', '**/*.java'
|
|
|
|
// }
|
|
|
|
// }
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 10:07:59 +02:00
|
|
|
task apiJar(type: Jar) {
|
2015-06-22 22:32:46 +02:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
from sourceSets.main.output
|
|
|
|
include 'techreborn/api/**/*'
|
|
|
|
|
|
|
|
classifier = "api"
|
2015-04-12 11:36:12 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 10:07:59 +02:00
|
|
|
apiJar.mustRunAfter deobfJar
|
2015-04-12 11:36:12 +02:00
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
artifacts {
|
|
|
|
archives deobfJar
|
2015-04-26 10:07:59 +02:00
|
|
|
archives apiJar
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2016-04-17 12:59:18 +02:00
|
|
|
build.dependsOn deobfJar, apiJar
|
2015-11-22 17:24:50 +01:00
|
|
|
|
2016-05-26 18:31:02 +02:00
|
|
|
|
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
uploadArchives {
|
|
|
|
repositories {
|
|
|
|
mavenDeployer {
|
2016-02-23 22:59:06 +01:00
|
|
|
//This is used when the build is done on a slave node
|
|
|
|
if (project.hasProperty('mavenPass'))
|
|
|
|
{
|
|
|
|
println 'Uploading to remote Maven Repo'
|
|
|
|
repository(url: "http://mavenupload.modmuss50.me/") {
|
|
|
|
authentication(userName: "buildslave", password: project.getProperty('mavenPass'))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2016-12-13 17:24:38 +01:00
|
|
|
{
|
2016-02-23 22:59:06 +01:00
|
|
|
//this is when the build is executed on the master node
|
|
|
|
println 'Uploading to local Maven Repo'
|
|
|
|
repository(url: "file:///var/www/maven/")
|
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
pom {
|
|
|
|
groupId = "TechReborn"
|
|
|
|
version = project.version
|
|
|
|
artifactId = project.archivesBaseName
|
|
|
|
project {
|
|
|
|
name project.archivesBaseName
|
|
|
|
packaging 'jar'
|
|
|
|
description 'TechReborn'
|
|
|
|
url 'https://github.com/TechReborn/TechReborn'
|
|
|
|
scm {
|
|
|
|
url 'https://github.com/TechReborn/TechReborn'
|
|
|
|
connection 'scm:git:git@github.com:TechReborn/TechReborn.git'
|
|
|
|
developerConnection 'scm:git:git@github.com:TechReborn/TechReborn.git'
|
|
|
|
}
|
|
|
|
issueManagement {
|
|
|
|
system 'github'
|
|
|
|
url 'https://github.com/TechReborn/TechReborn/issues'
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'License'
|
2015-04-12 11:36:12 +02:00
|
|
|
url 'https://raw.githubusercontent.com/TechReborn/TechReborn/master/LICENSE.md'
|
2015-04-10 00:17:30 +02:00
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id 'modmuss50'
|
|
|
|
name 'modmuss50'
|
|
|
|
roles { role 'developer' }
|
|
|
|
}
|
2015-04-12 11:36:12 +02:00
|
|
|
developer {
|
|
|
|
id 'Gigabit101'
|
|
|
|
name 'Gigabit101'
|
2015-10-03 15:12:30 +02:00
|
|
|
roles { role 'developer' }
|
2015-04-12 11:36:12 +02:00
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-12 11:56:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
|
|
|
//To update the wrapper change the version bellow then run: gradle wrapper
|
2016-05-25 17:14:21 +02:00
|
|
|
gradleVersion = '2.13'
|
2015-10-02 08:48:44 +02:00
|
|
|
}
|
2016-05-06 23:13:24 +02:00
|
|
|
|
|
|
|
//Thanks Matthew from #ForgeGradle https://gist.github.com/matthewprenger/108265e3efc83181bd2cc2d2fc31a853
|
|
|
|
task updateMappings(dependsOn: sourceJar) {
|
|
|
|
|
|
|
|
def remapped = file('src_remapped/main/java')
|
|
|
|
def methods = file('methods.csv')
|
|
|
|
def fields = file('fields.csv')
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
|
|
|
|
Map<String, String> map = new HashMap<>()
|
|
|
|
methods.eachLine {line ->
|
|
|
|
String[] pts = line.split(",")
|
|
|
|
map.put(pts[0], pts[1])
|
|
|
|
}
|
|
|
|
fields.eachLine {line ->
|
|
|
|
String[] pts = line.split(",")
|
|
|
|
map.put(pts[0], pts[1])
|
|
|
|
}
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from zipTree(sourceJar.archivePath)
|
|
|
|
into remapped
|
|
|
|
include '**/*.java'
|
|
|
|
|
|
|
|
filter { javaLine ->
|
|
|
|
map.entrySet().each { entry ->
|
|
|
|
javaLine = javaLine.replace(entry.getKey(), entry.getValue())
|
|
|
|
}
|
|
|
|
return javaLine
|
|
|
|
}
|
|
|
|
|
|
|
|
includeEmptyDirs = false
|
|
|
|
eachFile { println "Processing: $it.name" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-11-04 21:03:05 +01:00
|
|
|
|
2016-11-26 20:05:10 +01:00
|
|
|
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
|
|
|
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
import groovy.util.XmlSlurper;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
task curseTools << {
|
|
|
|
def cacheFiles = new File(".gradle/curseTools")
|
|
|
|
if (!cacheFiles.exists()) cacheFiles.mkdirs()
|
|
|
|
|
|
|
|
def mavenMetadata = new File(cacheFiles, "maven-metadata.xml")
|
|
|
|
|
|
|
|
logger.lifecycle(":downloading curseTools metadata")
|
|
|
|
FileUtils.copyURLToFile(new URL("http://maven.modmuss50.me/CurseTools/CurseTools/maven-metadata.xml"), mavenMetadata)
|
|
|
|
|
|
|
|
def metadata = new XmlSlurper().parseText(FileUtils.readFileToString(mavenMetadata))
|
|
|
|
def curseToolsVersion = metadata.versioning.release
|
|
|
|
|
|
|
|
def curseTools = new File(cacheFiles, "${curseToolsVersion}.jar")
|
|
|
|
|
|
|
|
logger.lifecycle(":downloading CurseTools")
|
|
|
|
FileUtils.copyURLToFile(new URL("http://maven.modmuss50.me/CurseTools/CurseTools/${curseToolsVersion}/CurseTools-${curseToolsVersion}.jar"), curseTools)
|
|
|
|
|
|
|
|
logger.lifecycle(":launching CurseTools")
|
|
|
|
ant.java(jar: curseTools.getAbsolutePath(), fork: true, spawn: false) {
|
|
|
|
arg(value: jar.archivePath.getAbsolutePath())
|
|
|
|
arg(value: deobfJar.archivePath.getAbsolutePath())
|
|
|
|
arg(value: apiJar.archivePath.getAbsolutePath())
|
|
|
|
}
|
2017-01-15 16:14:05 +01:00
|
|
|
}
|