我正在使用play-application
插件,它又使用基于 gradle 规则的模型配置。build.gradle.kts
看起来像这样:
plugins {
`play-application`
}
/* the snippet does not work
model {
components {
play {
platform play: playVersion, scala: scalaVersion, java: javaVersion
injectedRoutesGenerator = true
}
}
}
*/
// this works instead
apply(from = "play_setup.gradle")
val setup: groovy.lang.Closure<Any?> by extra
setup(project, jVersion, scalaVersion, playVersion)
其中 play_setup.gradle 是:
ext.setup = { project, javaVersion, scalaVersion, playVersion ->
model {
components {
play {
platform play: playVersion, scala: scalaVersion, java: javaVersion
injectedRoutesGenerator = true
}
}
}
}
有没有办法停止对使用基于规则的模型制作的插件使用 groovy 并直接通过 kotlin-DSL 配置它们?