TechReborn/build.gradle
2016-11-05 16:30:22 +00:00

275 lines
No EOL
7.4 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name = "Modmuss50"
url = "http://maven.modmuss50.me/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven {
name = "Modmuss50"
url = "http://maven.modmuss50.me/"
}
maven {
name "TiC"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "Amadornes"
url "http://maven.amadornes.com/"
}
ivy {
name "CraftTweaker3"
artifactPattern "http://www.blamejared.com/content/[module]-[classifier]-Full-[revision].[ext]"
}
maven {
url 'http://maven.epoxide.xyz'
}
maven {
url "http://maven.tterrag.com/"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
}
configurations {
shade
compile.extendsFrom shade
}
version = "1.4.9"
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {
version = version + "." + "${System.getenv().BUILD_NUMBER}"
}
minecraft {
version = "1.10.2-12.18.2.2121"
mappings = "snapshot_20161105"
replace "@MODVERSION@", project.version
// makeObfSourceJar = false
useDepAts = true
runDir = "run"
}
group = 'TechReborn'
def grabDep(name, url){
ant.get(src: url, dest: 'dep')
file("dep/" + url.substring(url.lastIndexOf("/"))).renameTo(file("dep/" + name + ".jar"))
}
dependencies {
def f = new File('dep/')
if(f.exists()){
f.delete()
}
f.mkdirs()
if(!f.exists()){
f.mkdir()
}
deobfCompile 'RebornCore:RebornCore-1.10.2:+:universal'
deobfCompile "mezz.jei:jei_1.10.2:+"
// compile "net.darkhax.tesla:Tesla:1.9.4-1.1.0.24:deobf"
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.9.4-1.0.4-14"
deobfCompile 'net.industrial-craft:industrialcraft-2:2.6.58-ex110:dev'
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// 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'
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
exclude "**/*.psd"
classifier = 'dev'
}
jar {
exclude "**/*.psd"
classifier = 'universal'
// configurations.shade.each { dep ->
// from(project.zipTree(dep)){
// include 'ic2/api/'
// include 'forestry/api/fuels/'
// exclude 'META-INF', 'META-INF/**', '**/*.java'
// }
// }
}
task apiJar(type: Jar) {
from sourceSets.main.allSource
from sourceSets.main.output
include 'techreborn/api/**/*'
classifier = "api"
}
apiJar.mustRunAfter deobfJar
artifacts {
archives deobfJar
archives apiJar
}
build.dependsOn deobfJar, apiJar
uploadArchives {
repositories {
mavenDeployer {
//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
{
//this is when the build is executed on the master node
println 'Uploading to local Maven Repo'
repository(url: "file:///var/www/maven/")
}
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'
url 'https://raw.githubusercontent.com/TechReborn/TechReborn/master/LICENSE.md'
distribution 'repo'
}
}
developers {
developer {
id 'modmuss50'
name 'modmuss50'
roles { role 'developer' }
}
developer {
id 'Gigabit101'
name 'Gigabit101'
roles { role 'developer' }
}
}
}
}
}
}
}
task wrapper(type: Wrapper) {
//To update the wrapper change the version bellow then run: gradle wrapper
gradleVersion = '2.13'
}
//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" }
}
}
}
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 0, "seconds"
cacheChangingModulesFor 0, "seconds"
}
}
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'