gpt4 book ai didi

gradle - gradle插件DSL中的引用版本变量?

转载 作者:行者123 更新时间:2023-12-03 05:10:41 27 4
gpt4 key购买 nike

我有以下文件:

buildscript {
ext {
kotlinVersion = '1.2.10'
springBootVersion = '2.0.0.M7'
}
...

plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.10"

我想在 kotlinVersion声明内的 ext块中使用 plugins。我该如何实现?

当我尝试直接进行操作时,我得到: argument list must be exactly 1 literal non empty string

最佳答案

您无法在插件DSL中引用变量,

Plugin docs引用如下:

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.

关于gradle - gradle插件DSL中的引用版本变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48010964/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com