It doesn't work. I get the same output with "outputs.upToDateWhen { false }".

Also i met another problem: i can't set environment variable for jettyRun.
According to documentation this task doesn't have environment
property. And code like:
jettyRunWar.doFirst {
  System.setProperty("run.mode", "test")
}
doesn't affect an application environment. May be someone know another
solution for this issue?

2011/1/21 Rene Groeschke <[email protected]>:
> Hi Alexey,
>
> Am Fr, 21.01.2011, 10:32, schrieb Alexey Zlobin:
>> Hi all,
>>
>>
>> I've met some problems with customisation of resource processing in my
>> project. I need to replace some token in property file on every build (main
>> idea is to have new DB created for every integration test executed). I
>> used intTest example from User Guide
>> (http://gradle.org/0.9.1/docs/userguide/java_plugin.html#sec:source_sets)
>> .
>>
>>
>> Now i have two problems:
>> 1. Main resources appear in the intTest classpath. So my application
>> use production configuration instead of test and i can't use ordinal
>> process<source set>Resources task. I avoid this problem by the following
>> task:
>> processResources.doFirst { if (gradle.taskGraph.hasTask(intTest)) {
>> processResources.from(sourceSets.intTest.resources.srcDirs) { timestamp =
>> System.currentTimeMillis().toString()
>> filter(ReplaceTokens, tokens:[runid: timestamp]) }
>> }
>> }
>> Which processes resources from the main source set. But this is very
>> tricky and error-prone because may cause test configuration to be deployed
>> in production.
>>
>> 2. All resource processing tasks work with modification check. On
>> repeated execution of build without 'clean' gradle decide that resource is
>> 'UP-TO-DATE' and do not produce resources with updated
>> timestamp.
>>
>> So my questions are:
>> 1. Is it bug that resources from one source set appear in another? If
>> no, how can i exclude them from my task classpath? 2. Is there any way to
>> force resource processing with no regard to file mo dification?
>
> First of all, I think your build should produce one production ready
> artifact. You shouldn't need to modify the production artifact to run
> integration tests.
>
> I think you could force the processResource task to be executed by adding
>
> processResources {
>        outputs.upToDateWhen { false }
> }
>
> to your build script.
>
> regards,
> René
>
>
>>
>> --
>> Alexey Zlobin
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



-- 
С уважением,
Алексей Злобин.

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

    http://xircles.codehaus.org/manage_email


Reply via email to