我正在尝试使用最新版本的 gradle
编译现有代码库。由于模块 build.gradle
文件中的以下行,构建失败:
project.setProperty("doNow", true)
出现此错误:
No such property: doNow for class: org.gradle.api.internal.project.DefaultProject_Decorated
我是否需要在导致错误的行之前在 build.gradle 中声明此属性?
来自 setProperty
的 gradle 文档:
Sets a property of this project. This method searches for a property with the given name in the following locations, and sets the property on the first location where it finds the property.
最佳答案
尝试:project.ext.doNow = 'lol'
关于java - Gradle:类没有这样的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33782426/