Gradle, filter resource one way for tests, another way when packaging artifact
0
I have a gradle project, with some database migration scripts. The migration files have a variable which I replace using resource filtering. This works fine and is accomplished like this: processResources { filter ReplaceTokens, tokens: [ "index.refresh.period": project.property("index.refresh.period") ] } Now I have written a unit test that starts up an embedded database and apply the same migration scripts. However, for testing I need to substitute another value. How can I accomplish this? I have tried a number of different things but nothing seems to work. I should mention that I am new to Gradle so it's a trial and error approach. Attempt #1: test { project.ext.setProperty('index.refresh.period', '1') processResources } ...