我想在gradle gui中显示特定的环境设置
使用description
属性。
例如,任务uploadArchives
应该显示上传到的网址:
Upload to maven repository 'file:D:/path/to/my/local/repository'
我这样做了:
// Top-level build.gradle
ext {
// default value if gradle.properties has no value
if (!hasProperty("mavenUpload_serverUrl")) mavenUpload_serverUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
}
task uploadArchives {
description = "Upload to maven repository '${mavenUpload_serverUrl}'."
print "Uploading to maven repository '${mavenUpload_serverUrl}'. \n"
dependsOn { subprojects.uploadArchives }
}
这是我当地的gradle.properties
# gradle.properties
mavenUpload_serverUrl=file:D:/path/to/my/local/repository
我希望看到
Upload to maven repository 'file:D:/path/to/my/local/repository'
在gradle gui中(以gradle --gui
开头)
但我得到了
Upload to maven repository 'https://oss.sonatype.org/content/repositories/snapshots/'
当构建gradle gui时gradle.properties
未被评估。
当我执行任务时,使用来自gradle.properties
的正确值。
Uploading to maven repository 'file:D:/path/to/my/local/repository'
知道如何在gradle gui中显示当前值吗?
我正在使用gradle 2.13