Dear, I currently face some problem to recover the value of the fixed assets in a foreach loop . Maybe some of you can help me ...
The purpose of this is that a file in that folder has been modified because this jar has been created. In this way I know that I have to generate a jar again, what do I do, go into a folder with a foreshop loop, and if a file matches my test, set one property to true.
The problem is that my variable does not exist after my loop. Here is a simplified code example that has the same problem:
& Lt; Foreach target = "setVar" param = "var" list = "A, b" /> & Lt; Echo & gt; Goals in goal: $ {env.myreturn} & lt; / Echo & gt; & Lt; Property Name = "env.myreturn" value = "c" /> In the second & lt; Echo & gt; Marine: $ {env.myreturn} & lt; / Echo & gt; & Lt; / Target & gt; & Lt; Goal name = "Set-up" & gt; & Lt; Property Name = "env.myreturn" value = "$ {var}" /> & Lt; Echo & gt; In Meriton Setter: $ {env.myreturn} & lt; / Echo & gt; & Lt; / Target & gt; The result of this code is:
target: setVar: [echo] set in myreturn: a setVar: [echo] set in myreturn: b [ Echo] in target: $ {env.myreturn} [echo] II: My building successfully It seems that the variable is set correctly because it is calling "SetVar" but calling There is no way to get value from the target.
I also know that it is not possible to assign the value twice for the property. But the problem does not happen ... when this matter will happen then I can add an investigation to the value of the property before specifying that it is not already initialized ...
Do you have any clue on which I can solve my problem ???
Many thanks in advance for your help :)
Try task ant macro feature Takes advantage of what came later.It works faster and is more flexible than old work >> When you are using the same project context, this means the properties set in the loop will appear outside of the loop. The general rules apply to doubt, properties ... you only want to set it once ... unless you set the before it can be revoked Use the properties to overwrite or unset. The happiness of hacking.
Comments
Post a Comment