Reputation: 26441
I have following file:
buildscript {
ext {
kotlinVersion = '1.2.10'
springBootVersion = '2.0.0.M7'
}
...
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.10"
I would like to use kotlinVersion
from ext
block inside plugins
declaration. How I can achieve that?
When I try to do it directly I get:
argument list must be exactly 1 literal non empty string
Upvotes: 1
Views: 1013
Reputation: 1384
Use the pluginManagement
block.
https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_version_management
Upvotes: 3
Reputation: 9866
You cannot reference variable in Plugin DSL,
Plugin docs reference below:
Where «plugin version» and «plugin id» must be constant, literal, strings and the apply statement with a boolean can be used to disable the default behavior of applying the plugin immediately (e.g. you want to apply it only in subprojects). No other statements are allowed; their presence will cause a compilation error.
Upvotes: 1