Gradle task buildWar and change line in file


I would like to create a buildWarTest task type: CubaWarBuilding that before doing the normal build stuff temporarily changes a line in a file. What I need to do is buildWar for the test/training server, in the test server I want the application to have a yellow background so that users know they are in test/training server. It would be easier if I could change the css file automatically using gradle.

Thank you

Hi George

It should be something like this:

task prepareTestBuild {
    doLast {
        // do something

task buildTestWar(type: CubaWarBuilding, dependsOn: [prepareTestBuild]) {
    // usual WAR params