What is the gradle way to filter a subset of files in src/main/webapp?

后端 未结 1 1337
余生分开走
余生分开走 2021-02-19 22:14

I\'m doing a maven conversion to gradle and want to see the opinions on the best way to perform the following. I currently have multiple files under src/main/webapp. Some need f

1条回答
  •  太阳男子
    2021-02-19 22:27

    If I understand the question correctly, you can use filesMatching. Also, I would do it as part of the processResources task, as opposed to the war task. It would look something like this:

    processResources {
        filesMatching('foo/*.html') {
            filter(ReplaceTokens, tokens: [key: 'value'])
        }
    }
    

    I realize the initial question was asked 2 years ago, so this probably won't help the asker, but perhaps it could help someone else in the future.

    0 讨论(0)
提交回复
热议问题