copy tree with gradle and change structure?

前端 未结 3 1267
终归单人心
终归单人心 2021-02-05 14:51

Can gradle alter the structure of the tree while copying?

original

  • mod/a/src
  • mod/b/src

desired

3条回答
  •  长情又很酷
    2021-02-05 15:21

    The following works, but is there a more gradle-ish way to do this?

        ant.copy(todir: destDir) {
          fileset( dir: "${srcDir}/module", includes: '**/src/**')
          regexpmapper(from: '^(.*)/src/(.*)$', to: /module-\1\/src\/\2/)
        }
    

提交回复
热议问题