mirror of
https://github.com/LegacyModdingMC/UniMixins.git
synced 2026-11-12 16:37:51 +00:00
RFG's performance is unsuitable for this project, see https://github.com/GTNewHorizons/RetroFuturaGradle/issues/49 Reverts the following commits:ba1f02dBegin RFG move. Common module compilesb589106Mixin module works now I think46a5c6dUse VERSION tag in Mixin module2409b24Mixingasm seems to work nowf0b355cSources jar get23e833fRemove redundant calls2e78938Update gradle in hopes that it will magically fix all my problems80e0723Port all the modules28e98d5Port All module (not the same thing)3a09260Fix common module build failing1088934Get rid of bloat from buildscript templatebff36c3Porting is done now maybe27e3058Fix what I brokebbc0b48zulu?9b4bde7I guess I need Java 17 tooc3af516RFG needs alot of ram apparently But keeps these:9152c1aDon't build alternate flavors by default24f6c06Move compat module's MixinExtras temp jar to temp dir
152 lines
3.5 KiB
Groovy
152 lines
3.5 KiB
Groovy
/** Common code for Forge 1.7.10 builds */
|
|
|
|
apply plugin: 'forge'
|
|
|
|
ext.publishDir = project.multiproject_structure.toBoolean() ? "${projectDir}/../publish" : "${rootDir}/publish"
|
|
|
|
def runCommand(cmd) {
|
|
def commitHashProc = cmd.execute(null, file("${projectDir}"))
|
|
commitHashProc.waitFor()
|
|
if(commitHashProc.exitValue() == 0){
|
|
def commitHash = commitHashProc.text.trim()
|
|
|
|
return commitHash
|
|
} else {
|
|
println commitHashProc.err.text
|
|
println(cmd + " exited with non-zero return value")
|
|
return null
|
|
}
|
|
}
|
|
|
|
def getCommitVersion() {
|
|
def ver = null
|
|
|
|
def versionPath = publishDir + "/version.txt"
|
|
if(file(versionPath).isFile()) {
|
|
ver = file(versionPath).text
|
|
} else {
|
|
|
|
try {
|
|
ver = runCommand("git describe --tags --dirty") ?: "UNKNOWN-" + runCommand("git describe --always --dirty") ?: "UNKNOWN"
|
|
} catch(Exception e){
|
|
println "Failed to run " + cmd + ": " + e.getMessage()
|
|
ver = "UNKNOWN"
|
|
}
|
|
}
|
|
|
|
ver = ver.trim()
|
|
if(ver.charAt(0) == 'v') {
|
|
ver = ver.substring(1)
|
|
}
|
|
|
|
return ver
|
|
}
|
|
|
|
project.version = getCommitVersion()
|
|
|
|
group = project.group
|
|
archivesBaseName = "${project.archives_base}-${project.minecraft_version}"
|
|
|
|
minecraft {
|
|
version = "${project.minecraft_version}-${project.forge_version}"
|
|
runDir = "run"
|
|
replace '@VERSION@', project.version
|
|
}
|
|
|
|
// These settings allow you to choose what version of Java you want to be compatible with. Forge 1.7.10 runs on Java 6 to 8.
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
repositories {
|
|
maven {
|
|
name = "chickenbones"
|
|
url = "http://chickenbones.net/maven/"
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
embed
|
|
compile.extendsFrom(embed)
|
|
shade
|
|
compile.extendsFrom(shade)
|
|
}
|
|
|
|
if(project.enable_mixin.toBoolean()) {
|
|
apply from: "buildscript/forge-1.7-mixin.gradle"
|
|
}
|
|
|
|
project.ext.override_dependencies = false
|
|
|
|
if(file("project.gradle").exists()){
|
|
apply from: "project.gradle"
|
|
}
|
|
|
|
if(!project.ext.override_dependencies) {
|
|
dependencies {
|
|
runtimeOnly "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
|
|
runtimeOnly "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
|
|
}
|
|
}
|
|
|
|
jar {
|
|
from(sourceSets.main.output);
|
|
|
|
// embed libraries in jar
|
|
from configurations.embed.collect {
|
|
exclude '**/LICENSE', '**/LICENSE.txt'
|
|
it.isDirectory() ? it : zipTree(it)
|
|
}
|
|
|
|
configurations.shade.each { dep ->
|
|
from(project.zipTree(dep)){
|
|
exclude '**/LICENSE', '**/LICENSE.txt', 'META-INF', 'META-INF/**'
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
// This will ensure that this task is redone when the versions or any
|
|
// user-defined properties change.
|
|
inputs.property "version", version
|
|
inputs.property "mcversion", project.minecraft.version
|
|
inputs.properties project.ext.getProperties()
|
|
|
|
filesMatching('*.info') {
|
|
expand project.properties
|
|
}
|
|
}
|
|
|
|
// Ensures that the encoding of source files is set to UTF-8, see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
// Add git commit hash to MANIFEST.MF
|
|
|
|
def getCommitHash(){
|
|
try {
|
|
def commitHashProc = "git describe --always --dirty".execute()
|
|
commitHashProc.waitFor()
|
|
if(commitHashProc.exitValue() == 0){
|
|
def commitHash = commitHashProc.text.trim()
|
|
|
|
return commitHash
|
|
} else {
|
|
println commitHashProc.err.text
|
|
throw new Exception("git describe exited with non-zero return value")
|
|
}
|
|
} catch(Exception e){
|
|
println "Failed to get commit version: " + e.getMessage()
|
|
}
|
|
return "UNKNOWN" // fallback
|
|
}
|
|
|
|
|
|
jar {
|
|
manifest {
|
|
attributes (
|
|
'Commit-ID': getCommitHash(),
|
|
)
|
|
}
|
|
}
|