The first point in time where you can tell with absolute certainty whether
the war task will get executed is when you receive the taskGraph.whenReady()
callback. It follows that you have to defer the encryption, and hence also
the filter configuration, to this point or later. A simple solution is:

war { 
       
war.setArchiveName("${contextName}-${targetEnv}-${config.version}.war" 
        classpath("config/props/$targetEnv") 
        webInf.from 'config/WEB-INF'
}

war.doFirst {
     // war task is getting executed, so complete the configuration now

    webInf.filter(ReplaceTokens, tokens: [ 
         token1 : config.variable1, 
         token2 : encrypt(config.variable2), 
         .... several tokens.... 
         tokenX : config.variableX, 
     ]) 
}

I think this should work. 

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Founder, Spock Framework
http://spockframework.org 
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/Is-there-a-variable-list-with-all-task-names-that-will-be-executed-tp3369891p3372161.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to