gradle: Exclude all - except one file

2019-07-14 23:36发布

In a gradle build I would like to exclude all files except one. I tried to do it like this:

processResources {

    // exclude everything
    exclude '*.*'

    // except this file
    include 'fileA.xml'
}

..but it does not seem to work - all files are excluded. Is this possible in some way?

Thanks for your help and input.

1条回答
时光不老,我们不散
2楼-- · 2019-07-14 23:57

Remove the 'exclude' part, because when you use 'include', you don't have to use 'exclude' patterns - gradle automatically excludes all others.

查看更多
登录 后发表回答