Gradle如何有条件地包含文件?

时间:2017-07-03 16:21:14

标签: if-statement gradle include

Gradle:如何有条件地包含不同的文件?

例如,

file1.js
file2.js

file3.js
file4.js

from (zipTree("/foo/bar.jar")) {
   include {
       if (project.hasProperty("debug"))
          //file1.js, file2.js
       else
          //file3.js, file4.js
   }


}

1 个答案:

答案 0 :(得分:0)

例如

bg

或喜欢

from(zipTree('/foo/bar.jar')) {
    if (project.hasProperty('debug'))
        include 'file1.js', 'file2.js'
    else
        include 'file3.js', 'file4.js'
}