Update to Kotlin 1.60 and Gradle 4.9

Removes the dependency on legacy script compilation and now relies on script
discovery.  In addition, the Gradle build scripts were refactored and updated
to be compatible with Gradle 5.0 and make use of the new java-library
configurations.
This commit is contained in:
Gary Tierney
2018-08-19 19:26:51 +01:00
parent 7fee8277ab
commit 0651d535fa
20 changed files with 171 additions and 181 deletions
@@ -3,7 +3,6 @@ package org.apollo.game.model.entity.attr;
import java.util.HashMap;
import java.util.Map;
import org.jruby.RubySymbol;
import com.google.common.base.Preconditions;
@@ -118,8 +117,6 @@ public final class AttributeMap {
return new NumericalAttribute((Double) value);
case STRING:
return new StringAttribute((String) value);
case SYMBOL:
return new StringAttribute(((RubySymbol) value).asJavaString(), true);
case BOOLEAN:
return new BooleanAttribute((Boolean) value);
}
@@ -13,11 +13,11 @@ import org.apollo.game.model.event.PlayerEvent
import org.apollo.game.plugin.PluginContext
import org.apollo.net.message.Message
import kotlin.reflect.KClass
import kotlin.script.templates.ScriptTemplateDefinition
import kotlin.script.experimental.annotations.KotlinScript
import kotlin.script.experimental.annotations.KotlinScriptFileExtension
@ScriptTemplateDefinition(
scriptFilePattern = ".*\\.plugin\\.kts"
)
@KotlinScript("Apollo Plugin Script")
@KotlinScriptFileExtension("plugin.kts")
abstract class KotlinPluginScript(private var world: World, val context: PluginContext) {
var startListener: (World) -> Unit = { _ -> }
var stopListener: (World) -> Unit = { _ -> }