Skip to content

Commit

Permalink
Fix build by temporarily not using Java toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Aug 15, 2021
1 parent fa63f3a commit 3eba1dc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
maven { url = "https://maven.google.com/" }
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
url = "https://maven.minecraftforge.net/"
}
maven {
name = "sonatype"
Expand All @@ -16,7 +16,7 @@ buildscript {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
changing = true
}
classpath 'com.guardsquare:proguard-gradle:7.0.1'
classpath 'com.guardsquare:proguard-gradle:7.1.1'
}
}

Expand All @@ -34,18 +34,23 @@ tasks.withType(AbstractArchiveTask) {
apply plugin: 'java'
apply plugin: 'forge'

// TODO Re-add compilation with the Java 6 toolchain, removed due to build issues

/*
// To use Java toolchains, sourceCompatibility & targetCompatibility need to be not set.
// ForgeGradle sets these previously to build some Forge internals, as it targets Gradle 4.X and above.
// This workaround sets them back to null. As this is a hack, any issues caused by this are my fault.
sourceCompatibility = null
targetCompatibility = null
*/

// Defines a Java 6 compatible JDK. This is used to get properties requiring a reference to a JDK (rt.jar etc).
// Unofficially, the codebase of MoreBows attempts to retain Java 5 compatibility, for ease of backports in the future, but Gradle doesn't support building with Java 5 in toolchains yet. I should make a bug report about it at some point...
def compiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(6)
}

/*
// Tells Gradle to use the previously defined Java 6 compatible JDK.
java {
toolchain {
Expand All @@ -57,6 +62,12 @@ java {
tasks.withType(JavaCompile).configureEach {
javaCompiler = compiler
}
*/

// TODO Remove once the above is fixed

sourceCompatibility = 5
targetCompatibility = 5

import groovy.json.JsonSlurper
import groovy.json.JsonOutput
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand Down

0 comments on commit 3eba1dc

Please sign in to comment.