2123 - Gradle setup
This commit is contained in:
parent
4422fc7dc0
commit
368e2d48df
5 changed files with 65 additions and 129 deletions
|
@ -1,5 +1,5 @@
|
||||||
minecraftVersion="1.12,1.12.1,1.12.2"
|
minecraftVersion="1.13"
|
||||||
name="TechReborn-1.12.2"
|
name="TechReborn-1.13"
|
||||||
curseID="233564"
|
curseID="233564"
|
||||||
child-project="reborncore"
|
child-project="reborncore"
|
||||||
child-type="requiredLibrary"
|
child-type="requiredLibrary"
|
||||||
|
|
185
build.gradle
185
build.gradle
|
@ -19,19 +19,20 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
||||||
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
||||||
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
||||||
classpath 'net.covers1624:GradleStuff:1.0-SNAPSHOT'
|
//classpath 'net.covers1624:GradleStuff:1.0-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: net.minecrell.gradle.licenser.Licenser
|
apply plugin: net.minecrell.gradle.licenser.Licenser
|
||||||
apply plugin: 'de.undercouch.download'
|
apply plugin: 'de.undercouch.download'
|
||||||
apply plugin: 'net.covers1624.contained-deps'
|
apply plugin: 'idea'
|
||||||
|
//apply plugin: 'net.covers1624.contained-deps'
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
@ -63,11 +64,17 @@ if (ENV.BUILD_NUMBER) {
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12.2-14.23.5.2768"
|
mappings channel: 'snapshot', version: '20180921-1.13'
|
||||||
mappings = "snapshot_20180720"
|
|
||||||
replace "@MODVERSION@", project.version
|
runs {
|
||||||
useDepAts = true
|
client = {
|
||||||
runDir = "run"
|
workingDirectory project.file('run').canonicalPath
|
||||||
|
source sourceSets.main
|
||||||
|
}
|
||||||
|
server = {
|
||||||
|
workingDirectory project.file('run').canonicalPath
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
license {
|
license {
|
||||||
|
@ -79,73 +86,53 @@ license {
|
||||||
group = 'TechReborn'
|
group = 'TechReborn'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile('RebornCore:RebornCore-1.12.2:+:universal') {
|
minecraft 'net.minecraftforge.test:forge:1.13-24.0.76-1.13-pre'
|
||||||
transitive = false
|
compile 'RebornCore:RebornCore-1.13:4.0.0.5:dev'
|
||||||
}
|
|
||||||
deobfCompile "mezz.jei:jei_1.12.2:+"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources
|
processResources{
|
||||||
{
|
inputs.property 'version', project.version
|
||||||
// this will ensure that this task is redone when the versions change.
|
inputs.property 'mcversion', '1.13'
|
||||||
inputs.property "version", project.version
|
|
||||||
inputs.property "mcversion", project.minecraft.version
|
|
||||||
|
|
||||||
// replace stuff in mcmod.info, nothing else
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
include 'META_INF/mods.toml'
|
||||||
include 'mcmod.info'
|
expand 'version':project.version, 'mcversion': '1.13'
|
||||||
|
}
|
||||||
|
|
||||||
// replace version and mcversion
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
expand 'version': project.version, 'mcversion': project.minecraft.version
|
exclude 'META_INF/mods.toml'
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy everything else, thats not the mcmod.info
|
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude 'mcmod.info'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Move access transformers to META-INF
|
|
||||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
|
||||||
from sourceSets.main.output
|
|
||||||
exclude "**/*.psd"
|
|
||||||
classifier = 'dev'
|
|
||||||
manifest {
|
|
||||||
attributes 'FMLAT': 'techreborn_at.cfg'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
containedDeps {
|
// task deobfJar(type: Jar) {
|
||||||
configuration = "shade"
|
// from sourceSets.main.output
|
||||||
tasks = "jar"
|
// exclude "**/*.psd"
|
||||||
}
|
// classifier = 'dev'
|
||||||
|
// manifest {
|
||||||
|
// attributes 'FMLAT': 'techreborn_at.cfg'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// containedDeps {
|
||||||
|
// configuration = "shade"
|
||||||
|
// tasks = "jar"
|
||||||
|
// }
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
exclude "**/*.psd"
|
exclude "**/*.psd"
|
||||||
classifier = 'universal'
|
classifier = 'universal'
|
||||||
manifest {
|
// manifest {
|
||||||
attributes 'FMLAT': 'techreborn_at.cfg'
|
// attributes 'FMLAT': 'techreborn_at.cfg'
|
||||||
}
|
// }
|
||||||
|
|
||||||
from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.lang"} : null}
|
from { crowdin.getDidWork() ? fileTree('build/translations').matching{exclude "**/en_US.lang"} : null}
|
||||||
dependsOn 'renameCrowdin'
|
dependsOn 'renameCrowdin'
|
||||||
}
|
}
|
||||||
|
|
||||||
task apiJar(type: Jar) {
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
from sourceSets.main.output
|
|
||||||
include 'techreborn/api/**/*'
|
|
||||||
|
|
||||||
classifier = "api"
|
|
||||||
}
|
|
||||||
|
|
||||||
apiJar.mustRunAfter deobfJar
|
|
||||||
|
|
||||||
build.dependsOn deobfJar, apiJar
|
|
||||||
|
|
||||||
//Triggers crowdin to export the latest translations
|
//Triggers crowdin to export the latest translations
|
||||||
task crowdinExport() {
|
task crowdinExport() {
|
||||||
|
@ -190,18 +177,6 @@ publishing {
|
||||||
version project.version
|
version project.version
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
artifact apiJar {
|
|
||||||
classifier "api"
|
|
||||||
}
|
|
||||||
|
|
||||||
artifact deobfJar {
|
|
||||||
classifier "dev"
|
|
||||||
}
|
|
||||||
|
|
||||||
artifact sourceJar {
|
|
||||||
classifier "sources"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -218,63 +193,25 @@ publishing {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Thanks Matthew from #ForgeGradle https://gist.github.com/matthewprenger/108265e3efc83181bd2cc2d2fc31a853
|
// task signJar(type: SignJar, dependsOn: reobfJar) {
|
||||||
task updateMappings(dependsOn: sourceJar) {
|
// onlyIf {
|
||||||
|
// project.hasProperty('keyStore')
|
||||||
|
// }
|
||||||
|
|
||||||
def remapped = file('src_remapped/main/java')
|
// if (project.hasProperty('keyStore')) {
|
||||||
def methods = file('methods.csv')
|
// keyStore = project.keyStore
|
||||||
def fields = file('fields.csv')
|
// alias = project.keyStoreAlias
|
||||||
|
// storePass = project.keyStorePass
|
||||||
|
// keyPass = project.keyStoreKeyPass
|
||||||
|
// inputFile = jar.archivePath
|
||||||
|
// outputFile = jar.archivePath
|
||||||
|
// }
|
||||||
|
|
||||||
doLast {
|
// }
|
||||||
|
|
||||||
Map<String, String> map = new HashMap<>()
|
// build.dependsOn signJar
|
||||||
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 {
|
// apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
|
||||||
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"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
task signJar(type: SignJar, dependsOn: reobfJar) {
|
|
||||||
onlyIf {
|
|
||||||
project.hasProperty('keyStore')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project.hasProperty('keyStore')) {
|
|
||||||
keyStore = project.keyStore
|
|
||||||
alias = project.keyStoreAlias
|
|
||||||
storePass = project.keyStorePass
|
|
||||||
keyPass = project.keyStoreKeyPass
|
|
||||||
inputFile = jar.archivePath
|
|
||||||
outputFile = jar.archivePath
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
build.dependsOn signJar
|
|
||||||
|
|
||||||
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
|
|
||||||
|
|
||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
import groovy.util.XmlSlurper
|
import groovy.util.XmlSlurper
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,5 @@
|
||||||
#Mon Feb 19 13:23:28 GMT 2018
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
rootProject.name = "TechReborn-1.12.2"
|
rootProject.name = "TechReborn-1.13"
|
Loading…
Reference in a new issue