在我的BuildConfig.groovy上,我有:
grails.plugin.location.plugin1 = "../plugin1"
grails.plugin.location.plugin2 = "../plugin2"
environments {
qa2-bamboo {
grails.plugin.location.plugin1 = "../AGP-CON-PLUG/plugin1"
grails.plugin.location.plugin2 = "../AGP-CON-PLUG/plugin2"
}
}
当我在qa2-bamboo
时。是grails.plugin.location.plugin1 == "../AGP-CON-PLUG/plugin1"
吗?
答案 0 :(得分:1)
不,这不受支持,但可能应该是为了保持一致性。您可以访问当前环境值,因此可以使用if检查
来执行此操作import grails.util.Environment
if (Environment.current == Environment.DEVELOPMENT || Environment.isDevelopmentMode()) {
...
}
或开关栏:
switch (Environment.current) {
case Environment.DEVELOPMENT:
...
break
case ...
default:
...
}