Add Jabel to compile for java 8 but using newer features, fix the ClickBox colors and update gradle
This commit is contained in:
parent
ce9f1c83dd
commit
4805e81dbe
@ -87,7 +87,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val javaVer: String = "11"
|
val javaVer: String = "8"
|
||||||
val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0"
|
val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0"
|
||||||
val mcBase: String = rootProject.architectury.minecraft.dropLast(2)
|
val mcBase: String = rootProject.architectury.minecraft.dropLast(2)
|
||||||
allprojects {
|
allprojects {
|
||||||
@ -103,9 +103,13 @@ allprojects {
|
|||||||
**/
|
**/
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
apply(plugin = "architectury-plugin")
|
apply(plugin = "architectury-plugin")
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk8", kotlinVer))
|
implementation(kotlin("stdlib-jdk8", kotlinVer))
|
||||||
implementation(kotlin("reflect", kotlinVer))
|
implementation(kotlin("reflect", kotlinVer))
|
||||||
|
annotationProcessor("com.github.bsideup.jabel:jabel-javac-plugin:0.3.0")
|
||||||
}
|
}
|
||||||
tasks {
|
tasks {
|
||||||
withType(ShadowJar::class) {
|
withType(ShadowJar::class) {
|
||||||
@ -126,7 +130,7 @@ allprojects {
|
|||||||
withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
|
withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
|
||||||
with(kotlinOptions) {
|
with(kotlinOptions) {
|
||||||
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy")
|
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy")
|
||||||
jvmTarget = javaVer
|
jvmTarget = if (javaVer.toInt() < 10) "1.$javaVer" else javaVer
|
||||||
languageVersion = "1.5"
|
languageVersion = "1.5"
|
||||||
apiVersion = rootProject.property("kotlin_stdlib_version").toString()
|
apiVersion = rootProject.property("kotlin_stdlib_version").toString()
|
||||||
}
|
}
|
||||||
@ -134,7 +138,9 @@ allprojects {
|
|||||||
withType(JavaCompile::class) {
|
withType(JavaCompile::class) {
|
||||||
with(options) {
|
with(options) {
|
||||||
encoding = "UTF-8"
|
encoding = "UTF-8"
|
||||||
release.set(javaVer.toInt()); isFork = true
|
isFork = true
|
||||||
|
// The following lines are required for Jabel:
|
||||||
|
compilerArgs.addAll(listOf("-Xplugin:jabel", "--release", javaVer))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
withType(net.fabricmc.loom.task.RemapJarTask::class) {
|
withType(net.fabricmc.loom.task.RemapJarTask::class) {
|
||||||
|
@ -20,5 +20,5 @@ annotation class ButtonInfo(
|
|||||||
}; enum class Category(val translationKey: String, val categoryColor: Colors) {
|
}; enum class Category(val translationKey: String, val categoryColor: Colors) {
|
||||||
MISC("snowy.clickbox.misc", Colors.BLUE),
|
MISC("snowy.clickbox.misc", Colors.BLUE),
|
||||||
RISKY("snowy.clickbox.risky", Colors.RED);
|
RISKY("snowy.clickbox.risky", Colors.RED);
|
||||||
init { ClickGui.components.add(ClickBox(y = 0.0, name = TranslatableComponent(translationKey))) }
|
init { ClickGui.components.add(ClickBox(y = 0.0, name = TranslatableComponent(translationKey), color = categoryColor)) }
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "fr.username404.snowygui.mixins",
|
"package": "fr.username404.snowygui.mixins",
|
||||||
"compatibilityLevel": "JAVA_11",
|
"compatibilityLevel": "JAVA_8",
|
||||||
"client": [
|
"client": [
|
||||||
"KeysAccessor",
|
"KeysAccessor",
|
||||||
"KeyMappings",
|
"KeyMappings",
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
Loading…
Reference in New Issue
Block a user