I’m facing a very simple problem with ANT script. I have a script that loads and sets many properties loaded from several property files in file system. This properties are used to preconfigure a new project.
The question is: can I write a new property file persisting all the properties that starts with a given prefix (for example “ref.proj.*”)?
The number and the name of the properties is variable and so I cannot use the
<propertyfile file="my.properties">
<entry key="ref.proj.first" value="${ref.first}"/>
...
<entry key="ref.proj.n" value="${ref.n}"/>
</propertyfile>
It’s possibile to apply a filter to a propertyfile task?
Thanks in advance!
It’s taking too long for me to work out all of the kinks. Sorry…
You should look at the
<echoproperties>task. This will let you select the various properties and print them out in property = value format.You could use that as your properties file itself.