2015-04-10 00:17:30 +02:00
|
|
|
buildscript {
|
2017-04-14 21:35:09 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2017-02-23 13:29:43 +01:00
|
|
|
maven {
|
2019-08-21 20:48:59 +02:00
|
|
|
name = "Modmuss50"
|
|
|
|
url = "https://maven.modmuss50.me/"
|
2017-04-14 21:35:09 +02:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
url "https://plugins.gradle.org/m2/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
2019-12-11 15:28:39 +01:00
|
|
|
classpath "net.fabricmc:fabric-loom:0.2.7-SNAPSHOT"
|
2017-04-14 21:35:09 +02:00
|
|
|
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
2018-09-02 14:57:41 +02:00
|
|
|
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
2019-12-11 15:28:39 +01:00
|
|
|
classpath "com.wynprice.cursemaven:CurseMaven:2.1.1"
|
2017-04-14 21:35:09 +02:00
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2019-05-26 13:37:59 +02:00
|
|
|
apply plugin: net.fabricmc.loom.LoomGradlePlugin
|
2015-04-10 00:17:30 +02:00
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'maven-publish'
|
2017-02-23 13:29:43 +01:00
|
|
|
apply plugin: net.minecrell.gradle.licenser.Licenser
|
2018-09-02 14:57:41 +02:00
|
|
|
apply plugin: 'de.undercouch.download'
|
2019-01-12 20:56:42 +01:00
|
|
|
apply plugin: 'idea'
|
2019-02-20 21:12:36 +01:00
|
|
|
apply plugin: 'eclipse'
|
2019-09-22 15:17:46 +02:00
|
|
|
apply plugin: "com.wynprice.cursemaven"
|
2015-04-10 00:17:30 +02:00
|
|
|
|
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 {
|
2017-04-14 21:35:09 +02:00
|
|
|
maven {
|
|
|
|
name = "Modmuss50"
|
2019-08-21 20:48:59 +02:00
|
|
|
url = "https://maven.modmuss50.me/"
|
2017-04-14 21:35:09 +02:00
|
|
|
}
|
2019-10-11 22:30:26 +02:00
|
|
|
maven {
|
2019-11-01 14:47:23 +01:00
|
|
|
// LibCD
|
2019-10-11 22:30:26 +02:00
|
|
|
url 'http://server.bbkr.space:8081/artifactory/libs-release'
|
|
|
|
}
|
2015-08-27 17:29:13 +02:00
|
|
|
}
|
|
|
|
|
2020-01-11 00:34:47 +01:00
|
|
|
version = "3.2.2"
|
2015-12-30 18:23:45 +01:00
|
|
|
|
2015-08-27 17:29:13 +02:00
|
|
|
configurations {
|
2017-04-14 21:35:09 +02:00
|
|
|
shade
|
|
|
|
compile.extendsFrom shade
|
2015-08-27 17:29:13 +02:00
|
|
|
}
|
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
def ENV = System.getenv()
|
2019-09-15 14:43:04 +02:00
|
|
|
def build_number = ENV.BUILD_NUMBER ?: "local"
|
|
|
|
version = "${version}+build.$build_number"
|
2015-04-10 00:17:30 +02:00
|
|
|
|
2017-02-23 13:29:43 +01:00
|
|
|
license {
|
2017-04-14 21:35:09 +02:00
|
|
|
header file('HEADER')
|
|
|
|
include '**/*.java'
|
|
|
|
ignoreFailures = true //Stops the build from failing if a file does not have a license header
|
2017-02-23 13:29:43 +01:00
|
|
|
}
|
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
group = 'TechReborn'
|
|
|
|
|
|
|
|
dependencies {
|
2020-01-03 23:46:07 +01:00
|
|
|
minecraft "com.mojang:minecraft:1.15.1"
|
|
|
|
mappings "net.fabricmc:yarn:1.15.1+build.24:v2"
|
|
|
|
modImplementation "net.fabricmc:fabric-loader:0.7.3+build.176"
|
2019-05-27 23:21:58 +02:00
|
|
|
|
2019-07-01 01:24:12 +02:00
|
|
|
//Fabric api
|
2020-01-03 23:46:07 +01:00
|
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:0.4.27+build.286-1.15"
|
2019-05-27 23:21:58 +02:00
|
|
|
|
2019-12-26 13:07:34 +01:00
|
|
|
optionalDependency ("me.shedaniel:RoughlyEnoughItems:3.2.31")
|
2019-12-16 19:56:19 +01:00
|
|
|
optionalDependency ('io.github.cottonmc:LibCD:2.0.1+1.15')
|
2019-05-27 23:21:58 +02:00
|
|
|
|
2019-11-14 20:09:32 +01:00
|
|
|
def rcVersion = 'RebornCore:RebornCore-1.15:+'
|
2019-12-16 19:56:19 +01:00
|
|
|
modApi (rcVersion) {
|
|
|
|
exclude group: "net.fabricmc"
|
2019-07-25 15:16:30 +02:00
|
|
|
}
|
2019-09-15 14:43:04 +02:00
|
|
|
include rcVersion
|
2019-08-28 00:58:42 +02:00
|
|
|
|
2019-12-13 11:00:59 +01:00
|
|
|
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
|
2019-12-16 16:34:18 +01:00
|
|
|
modCompileOnly ('curse.maven:towelette:2842017') {
|
2019-08-13 17:24:24 +02:00
|
|
|
transitive = false
|
|
|
|
}
|
2019-12-16 19:56:19 +01:00
|
|
|
}
|
2019-09-10 15:09:15 +02:00
|
|
|
|
2019-12-16 19:56:19 +01:00
|
|
|
def optionalDependency(String dep) {
|
|
|
|
dependencies.modRuntime (dep) {
|
|
|
|
exclude group: "net.fabricmc"
|
|
|
|
exclude module: "nbt-crafting"
|
|
|
|
}
|
|
|
|
dependencies.modCompileOnly (dep) {
|
|
|
|
exclude group: "net.fabricmc"
|
|
|
|
exclude module: "nbt-crafting"
|
|
|
|
}
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 00:42:25 +02:00
|
|
|
processResources {
|
|
|
|
inputs.property "version", project.version
|
2017-04-14 21:35:09 +02:00
|
|
|
|
2019-08-07 00:42:25 +02:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include "fabric.mod.json"
|
|
|
|
expand "version": project.version
|
|
|
|
}
|
2017-06-20 19:54:45 +02:00
|
|
|
|
2019-08-07 00:42:25 +02:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude "fabric.mod.json"
|
|
|
|
}
|
2019-01-12 20:56:42 +01:00
|
|
|
}
|
2015-07-01 17:53:03 +02:00
|
|
|
|
2015-04-10 00:17:30 +02:00
|
|
|
jar {
|
2017-04-14 21:35:09 +02:00
|
|
|
exclude "**/*.psd"
|
|
|
|
classifier = 'universal'
|
2018-08-30 23:47:25 +02:00
|
|
|
|
2019-09-20 21:53:28 +02:00
|
|
|
from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.json"} : null}
|
2019-12-08 23:40:29 +01:00
|
|
|
dependsOn 'fixTranslations'
|
2015-04-10 00:17:30 +02:00
|
|
|
}
|
|
|
|
|
2015-11-22 17:24:50 +01:00
|
|
|
|
2018-08-31 16:29:59 +02:00
|
|
|
//Triggers crowdin to export the latest translations
|
|
|
|
task crowdinExport() {
|
|
|
|
onlyIf {
|
2018-08-31 17:00:31 +02:00
|
|
|
project.hasProperty('crowdinKey')
|
2018-08-31 16:29:59 +02:00
|
|
|
}
|
|
|
|
doLast{
|
|
|
|
def apiKey = project.crowdinKey
|
|
|
|
def projectId = 'techreborn'
|
2018-08-31 17:00:31 +02:00
|
|
|
def response = new URL(sprintf('https://api.crowdin.com/api/project/%1$s/export?key=%2$s', [projectId, apiKey])).text
|
|
|
|
def metadata = new XmlParser().parseText(response)
|
|
|
|
project.logger.lifecycle("crowdin export status: " + metadata.@status)
|
2018-08-31 16:29:59 +02:00
|
|
|
}
|
|
|
|
}
|
2018-08-30 23:47:25 +02:00
|
|
|
|
2018-09-02 14:57:41 +02:00
|
|
|
|
|
|
|
task crowdin(type: Download, dependsOn: 'crowdinExport'){
|
|
|
|
src 'https://crowdin.com/backend/download/project/techreborn.zip'
|
|
|
|
dest file("build/translations.zip")
|
|
|
|
overwrite true
|
|
|
|
}
|
|
|
|
|
|
|
|
task cleanCrowdin(type: Delete){
|
|
|
|
delete 'build/translations'
|
2018-08-30 23:47:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//Renames the translation files to be all lower case
|
2018-09-02 14:57:41 +02:00
|
|
|
task renameCrowdin(type: Copy, dependsOn: ['crowdin', 'cleanCrowdin']){
|
2018-08-30 23:47:25 +02:00
|
|
|
mustRunAfter 'crowdin'
|
2018-09-02 14:57:41 +02:00
|
|
|
from zipTree(file("build/translations.zip"))
|
|
|
|
into file('build/translations')
|
2018-08-30 23:47:25 +02:00
|
|
|
rename {
|
|
|
|
String filename -> return filename.toLowerCase()
|
|
|
|
}
|
2019-12-08 23:40:29 +01:00
|
|
|
doFirst {
|
|
|
|
file('build/translations').deleteDir()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import groovy.json.JsonSlurper
|
|
|
|
import groovy.json.JsonOutput
|
|
|
|
|
|
|
|
//Remove all translations that do not have an entry, ensures that minecraft falls back to EN_US over writing out an empty string.
|
|
|
|
task fixTranslations(dependsOn: ['renameCrowdin']) {
|
|
|
|
def jsonSlurper = new JsonSlurper()
|
|
|
|
doLast {
|
|
|
|
file('build/translations').eachFileRecurse(groovy.io.FileType.FILES) {
|
|
|
|
if(it.name.endsWith(".json")) {
|
|
|
|
def lang = jsonSlurper.parseText(it.text)
|
|
|
|
lang.values().removeIf { val -> val.empty}
|
|
|
|
it.text = JsonOutput.prettyPrint(JsonOutput.toJson(lang))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-30 23:47:25 +02:00
|
|
|
}
|
|
|
|
|
2019-07-25 15:16:30 +02:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = "sources"
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
2019-03-01 22:24:26 +01:00
|
|
|
|
2018-02-19 15:12:08 +01:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
groupId 'TechReborn'
|
|
|
|
artifactId project.archivesBaseName
|
|
|
|
version project.version
|
2016-05-26 18:31:02 +02:00
|
|
|
|
2019-07-25 15:16:30 +02:00
|
|
|
artifact(remapJar) {
|
|
|
|
builtBy remapJar
|
|
|
|
}
|
|
|
|
artifact(sourcesJar) {
|
|
|
|
builtBy remapSourcesJar
|
|
|
|
}
|
2018-02-19 15:12:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url "http://mavenupload.modmuss50.me/"
|
2018-02-19 16:01:37 +01:00
|
|
|
if (project.hasProperty('mavenPass')) {
|
|
|
|
credentials {
|
|
|
|
username 'buildslave'
|
|
|
|
password project.getProperty('mavenPass')
|
|
|
|
}
|
2017-04-14 21:35:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-12 11:56:23 +02:00
|
|
|
}
|
|
|
|
|
2019-01-12 20:56:42 +01:00
|
|
|
// apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2018-04-02 11:42:02 +02:00
|
|
|
import com.google.gson.JsonArray
|
2017-04-14 21:35:09 +02:00
|
|
|
import groovy.util.XmlSlurper
|
|
|
|
import org.apache.commons.io.FileUtils
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2019-05-26 13:37:59 +02:00
|
|
|
import java.util.function.Consumer
|
|
|
|
|
2017-04-11 00:39:09 +02:00
|
|
|
task curseTools {
|
2017-04-11 01:21:30 +02:00
|
|
|
doLast {
|
2017-04-14 21:35:09 +02:00
|
|
|
def cacheFiles = new File(".gradle/curseTools")
|
|
|
|
if (!cacheFiles.exists()) {
|
|
|
|
cacheFiles.mkdirs()
|
|
|
|
}
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
def mavenMetadata = new File(cacheFiles, "maven-metadata.xml")
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
logger.lifecycle(":downloading curseTools metadata")
|
|
|
|
FileUtils.copyURLToFile(new URL("http://maven.modmuss50.me/CurseTools/CurseTools/maven-metadata.xml"), mavenMetadata)
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
def metadata = new XmlSlurper().parseText(FileUtils.readFileToString(mavenMetadata))
|
|
|
|
def curseToolsVersion = metadata.versioning.release
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
def curseTools = new File(cacheFiles, "${curseToolsVersion}.jar")
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
logger.lifecycle(":downloading CurseTools")
|
|
|
|
FileUtils.copyURLToFile(new URL("http://maven.modmuss50.me/CurseTools/CurseTools/${curseToolsVersion}/CurseTools-${curseToolsVersion}.jar"), curseTools)
|
2016-11-26 20:05:10 +01:00
|
|
|
|
2017-04-14 21:35:09 +02:00
|
|
|
logger.lifecycle(":launching CurseTools")
|
|
|
|
ant.java(jar: curseTools.getAbsolutePath(), fork: true, spawn: false) {
|
2019-07-25 15:16:30 +02:00
|
|
|
arg(value: remapJar.archivePath.getAbsolutePath())
|
2017-04-14 21:35:09 +02:00
|
|
|
}
|
2017-04-11 01:21:30 +02:00
|
|
|
}
|
2017-01-15 16:14:05 +01:00
|
|
|
}
|