我正在尝试使用最新版本的gradle编译现有代码库。 由于模块build.gradle文件中的以下行,构建失败:
project.setProperty("doNow", true)有这个错误:
No such property: doNow for class: org.gradle.api.internal.project.DefaultProject_Decorated我是否需要在导致错误的行之前在build.gradle中声明此属性?
来自setProperty gradle文档:
设置此项目的属性。 此方法在以下位置搜索具有给定名称的属性,并在找到该属性的第一个位置设置该属性。
I am trying to compile an existing codebase using the newest version of gradle. The build fails due to the following line in the modules build.gradle file:
project.setProperty("doNow", true)with this error:
No such property: doNow for class: org.gradle.api.internal.project.DefaultProject_DecoratedDo I need to declare this property within build.gradle before the line causing an error?
From gradle docs for setProperty:
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'
Try: project.ext.doNow = 'lol'
更多推荐
发布评论