Merge branch 'kotlinization#421'

This commit is contained in:
Bella 2020-04-24 11:31:25 -04:00
commit f1501b6f77
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
4 changed files with 66 additions and 18 deletions

View File

@ -1,7 +1,6 @@
// forge's stuff
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
jcenter()
maven {
@ -17,18 +16,28 @@ buildscript {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: "${kotlin_version}" }
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'
version project.modVersion
group project.modGroup // http://maven.apache.org/guides/mini/guide-naming-conventions.html
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
@ -59,6 +68,10 @@ repositories {
name = "jitpack.io"
url = "https://jitpack.io"
}
maven {
name = "forgelin-repo"
url "http://maven.shadowfacts.net/"
}
mavenCentral()
jcenter()
}
@ -80,7 +93,14 @@ dependencies {
compile 'club.minnced:java-discord-rpc:2.0.2'
compile 'com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT'
compile 'com.github.kevinsawicki:http-request:http-request-6.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile group: "net.shadowfacts", name: "Forgelin", version: "1.8.4"
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk7", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: kotlin_version
compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: kotlin_version
compile group: "org.jetbrains", name: "annotations", version: annotations_version
compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: coroutines_version
compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-jdk8", version: coroutines_version
}
processResources {
@ -116,7 +136,14 @@ shadowJar {
include(dependency('org.javassist:javassist'))
include(dependency('com.github.MrPowerGamerBR:TemmieWebhook'))
include(dependency('com.github.kevinsawicki:http-request'))
include(dependency('org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version'))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"))
include(dependency("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"))
include(dependency("org.jetbrains:annotations:${annotations_version}"))
include(dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutines_version}"))
include(dependency("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${coroutines_version}"))
include(dependency('net.shadowfacts:Forgelin'))
}
exclude 'dummyThing' // can someone explain why this is here
classifier = 'release'
@ -149,13 +176,3 @@ jar {
}
build.dependsOn(shadowJar)
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

View File

@ -3,4 +3,7 @@ modGroup=me.zeroeightsix
modVersion=1.1.4-beta
modBaseName=kamiblue
forgeVersion=1.12.2-14.23.5.2847
mcpVersion=stable_39
mcpVersion=stable_39
kotlin_version=1.3.50
annotations_version=16.0.3
coroutines_version=1.3.1

View File

@ -35,7 +35,7 @@ public class MixinLoaderForge implements IFMLLoadingPlugin {
@Override
public String getSetupClass() {
return null;
return "net.shadowfacts.forgelin.preloader.ForgelinSetup";
}
@Override

View File

@ -0,0 +1,28 @@
package net.shadowfacts.forgelin.preloader;
import net.minecraftforge.fml.relauncher.IFMLCallHook;
import java.util.Map;
/**
* @author shadowfacts
*/
public class ForgelinSetup implements IFMLCallHook {
@Override
public void injectData(Map<String, Object> data) {
ClassLoader loader = (ClassLoader)data.get("classLoader");
try {
loader.loadClass("net.shadowfacts.forgelin.KotlinAdapter");
} catch (ClassNotFoundException e) {
// this should never happen
throw new RuntimeException("Couldn't find Forgelin langague adapter, this shouldn't be happening", e);
}
}
@Override
public Void call() throws Exception {
return null;
}
}