I'm not getting any hits here so I'll try and explain this better by taking another approach.
I have multiple projects which may have a file(s) that need
string replacements. For example, ApplicationCAT has the file abc.xml that has two lines that require string replacements. ApplicationDOG has file abc.xml that only needs one string replacement.
I'm using one build.xml for all my projects (applications). In the properties file of each of the projects I specify the file(s)/existingString/replacementString that needs to take place during the build.
** EXAMPLE from the projects properties file **
WEB.Modify1.file=C:\\ccView\\${VOB.project.name}\\${VOB.project.name}_vob\\code\\${WEB1.project.name}\\${WEB.content}\\WEB-INF\\abc.xml
WEB.Token1.string=virtualHostName="default_host"
WEB.Value1.string=virtualHostName="VHMyTime"
** END EXAMPLE **
There will be as many of these entries in the properties files as there are string replacements. If there was a second string replacement I would have something like the above with the parameters: WEB.Modify2.file, WEB.Token2.string,WEB.Value2.string.
So at this point I have all the file and string replacement info in all of my projects properties files.
In my build.xml I must accomodate for the project that has the most string replacements. Here is an example of what is in the build.xml:
** CODE USED TO CHECK FOR EXISTENCE OF STRINGREPLACEMENT1.TXT **
<antcall target="replaceString1">
<param name="Modify1.file" value="${WEB.Modify1.file}"/>
<param name="Replace1.string" value="${WEB.Token1.string}"/>
<param name="Replacement1.string" value="${WEB.Value1.string}"/>
</antcall>
<antcall target="replaceString1">
<param name="Modify2.file" value="${WEB.Modify2.file}"/>
<param name="Replace2.string" value="${WEB.Token2.string}"/>
<param name="Replacement2.string" value="${WEB.Value2.string}"/>
</antcall>
** END **
So the above code will execute the string replacement command in targets "replaceString1" and "replaceString2". The problem is that project ApplicationDOG (going back to the example) only has ONE string replacement that needs to take place, so the build fails with it tries to do the second string replacement because there are no values.
The way I worked around this was to put a "dummy" file on the file system (stringreplacement"x".txt). For each project I have an area that I place these. ApplicationDOG would just have "stringreplacement1", while ApplicationCAT would have "stringreplacement1.txt" and "stringreplacment2.txt".
I then use an "available file" statement before the <antcall target="replaceStringx"> statement, which will check for the existence of the stringreplacementx.txt file. If it exist it executes the ant call, if not it skips it.
** EXAMPLE **
<available file="${global.vobAppBuildCode.dir}/${module.project.name}/stringreplacement1.txt" type="file" property="stringreplacement1.exists"/>
<antcall target="replaceString1">
<param name="Modify1.file" value="${WEB.Modify1.file}"/>
<param name="Replace1.string" value="${WEB.Token1.string}"/>
<param name="Replacement1.string" value="${WEB.Value1.string}"/>
</antcall>
** END OF EXAMPLE **
THE GOAL - FINALLY!!
I don't want to have to put the stringreplacmentx.txt file(s) on the file system as a means to check if it should execute the ant call. I would prefer it if there was a way to check if there was a value for WEB.modify1.file, WEB.modify2.file, etc. If a value has been set in the projects properties file there should be a value in there.
Is this possible? I initially though I could use something like the "available" task to check for a "JVM system resource" (I'm not sure if this would qualifies as as a JVM System Resource though).
I don't know if this makes any more sense than it did before, I hope so. If you want to take a look at the projects properties file and the build.xml I will gladly send it to you.
Thanks for your help,
Lisa