Upgrade to Kotlin 1.1.0-beta-38
This commit is contained in:
@@ -6,7 +6,7 @@ buildscript {
|
||||
dependencies {
|
||||
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
|
||||
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-beta-17")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-beta-38")
|
||||
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
|
||||
classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT")
|
||||
}
|
||||
@@ -71,7 +71,7 @@ configure(allprojects) { project ->
|
||||
ext.junitVersion = "4.12"
|
||||
ext.junitJupiterVersion = '5.0.0-M3'
|
||||
ext.junitPlatformVersion = '1.0.0-M3'
|
||||
ext.kotlinVersion = "1.1.0-beta-17" // also change kotlin-gradle-plugin version when upgrading
|
||||
ext.kotlinVersion = "1.1.0-beta-38" // also change kotlin-gradle-plugin version when upgrading
|
||||
ext.log4jVersion = '2.8'
|
||||
ext.nettyVersion = "4.1.8.Final"
|
||||
ext.okhttpVersion = "2.7.5"
|
||||
|
||||
@@ -3,7 +3,6 @@ import org.springframework.web.reactive.result.view.script.RenderingContext
|
||||
import org.springframework.context.support.ResourceBundleMessageSource
|
||||
import org.springframework.beans.factory.getBean
|
||||
|
||||
// TODO Use engine.eval(String, Bindings) when https://youtrack.jetbrains.com/issue/KT-15450 will be fixed
|
||||
fun render(template: String, model: Map<String, Any>, renderingContext: RenderingContext): String {
|
||||
val engine = ScriptEngineManager().getEngineByName("kotlin")
|
||||
val bindings = SimpleBindings()
|
||||
@@ -11,7 +10,6 @@ fun render(template: String, model: Map<String, Any>, renderingContext: Renderin
|
||||
var messageSource = renderingContext.applicationContext.getBean<ResourceBundleMessageSource>()
|
||||
bindings.put("i18n", { code: String -> messageSource.getMessage(code, null, renderingContext.locale) })
|
||||
bindings.put("include", { path: String -> renderingContext.templateLoader.apply("org/springframework/web/reactive/result/view/script/kotlin/$path.html") })
|
||||
engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE)
|
||||
return engine.eval(template) as String
|
||||
return engine.eval(template, bindings) as String
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import org.springframework.web.servlet.view.script.RenderingContext
|
||||
import org.springframework.context.support.ResourceBundleMessageSource
|
||||
import org.springframework.beans.factory.getBean
|
||||
|
||||
// TODO Use engine.eval(String, Bindings) when https://youtrack.jetbrains.com/issue/KT-15450 will be fixed
|
||||
fun render(template: String, model: Map<String, Any>, renderingContext: RenderingContext): String {
|
||||
val engine = ScriptEngineManager().getEngineByName("kotlin")
|
||||
val bindings = SimpleBindings()
|
||||
@@ -11,7 +10,6 @@ fun render(template: String, model: Map<String, Any>, renderingContext: Renderin
|
||||
var messageSource = renderingContext.applicationContext.getBean<ResourceBundleMessageSource>()
|
||||
bindings.put("i18n", { code: String -> messageSource.getMessage(code, null, renderingContext.locale) })
|
||||
bindings.put("include", { path: String -> renderingContext.templateLoader.apply("org/springframework/web/servlet/view/script/kotlin/$path.html") })
|
||||
engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE)
|
||||
return engine.eval(template) as String
|
||||
return engine.eval(template, bindings) as String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user