Я работаю над сборкой нескольких проектов, используя gradle.
У меня есть требование выбора зависимости от состояния свойства, введенного в командной строке.
Сценарий-1:
dependencies {
if( ! project.hasProperty("withsources")){
compile 'com.xx.yy:x-u:1.0.2'
}else{
println " with sources"
compile project (':x-u')
}
}
1.Когда я выполняю Gradle Run -Pwssources
it is printing "withsources"
2. Но для пробежки по грейдеру
it is printing "withsources"
Сценарий-2:
dependencies {
if( project.hasProperty("withsources")){
compile 'com.xx.yy:x-u:1.0.2'
}else{
println " with sources"
compile project (':x-u')
}
}
1.Когда я выполняю Gradle Run -Pwssources
it is not printing "withsources"
2. Но для пробежки по грейдеру
it is not printing "withsources"
Я не знаю, это всегда идет в другой цикл. Любой может помочь здесь.