我在build.gradle中有以下内容
PlatformUmbrella platformUmbrella = PlatformUmbrella.create(System.properties['module.status'])
task setClBeforePublish << platformUmbrella.beforePublish
project.tasks.publish.doLast platformUmbrella.afterPublishgradle.properties具有module.status = snapshot``gradlew properties输出:
module.status: snapshot但是,当检索System.properties['module.status']或gradle.properties['module.status']时,会返回null (大概是因为属性尚未处理)。在gradle.properties['module.status']闭包中访问gradle.taskGraph.whenReady也会返回null。访问“module.status”设置的正确方法是什么?
发布于 2013-10-30 00:26:14
gradle.properties的内容将自动加载到项目的“额外”属性扩展中,通过project.ext访问。
在您的情况下,可以尝试使用project.ext["module.status"]。
https://stackoverflow.com/questions/19671592
复制相似问题