Is it possible to use multiple AntBuildFile clauses in an ItemGroup?
-
Tuesday, July 31, 2012 3:39 PM
We are trying to setup a build on Eclipse using the TeamBuildExtensions. We have an existing series of Ant builds that must be executed in sequence. In my TFSBuild.proj file I have the following:
<ItemGroup>
<!-- Ant Call Configuration.
The build file called should be included in the workspace of the build definition.
-->
<AntBuildFile Include="$/MyProject/Test_build1.xml">
<Targets></Targets>
<Properties>dist=dist;properties=properties</Properties>
<Lib></Lib>
</AntBuildFile><AntBuildFile Include="$/MyProject/Test_build2.xml">
<Targets></Targets>
<Properties>dist=dist;properties=properties;BinariesRoot=$(BinariesRoot);</Properties>
<Lib></Lib>
</AntBuildFile><AntBuildFile Include="$/MyProject/Test_build3.xml">
<Targets></Targets>
<Properties>dist=dist;properties=properties;BinariesRoot=$(BinariesRoot);BuildDefinitionName=$(BuildDefinitionName)</Properties>
<Lib></Lib>
</AntBuildFile></ItemGroup>
When I run this, the Ant build runs Test_build3 three times! How do I get this to run all of the Ant files?
All Replies
-
Wednesday, December 19, 2012 9:55 AMThis question has been open for 5 months! Does anyone know anything about this?
-
Thursday, January 24, 2013 2:49 PM6 months! Can anyone suggest a better forum for this question?
-
Thursday, January 24, 2013 5:28 PMSorry for the late reply. I'll look into the question and follow up with you shortly. Thanks
Kai Tian, Microsoft
-
Thursday, January 24, 2013 8:31 PM
Currently by default we only support one ant build file, did you manually modify the TFSBuild.proj file to add in the other two AntBuildFile ?
It should be possible to prepare only one build file for your use to execute all three build tasks. Can you try that first?
If in any case you have to use multiple ant build files, can you post the question to the TFS build forum? It is MSBuild that loads the TFSBuild.proj file and do the ant build. MSBuild might assume there is only one ant build file and might have some issues if have multiple ant build files, which I'm not quite sure. They can help you better there. Again, sorry for the inconveniences and late reply.
Kai Tian, Microsoft
-
Tuesday, January 29, 2013 4:54 PMI am trying to call three separate Ant files from a single TfsBuild.proj file (see the snippet in the OP above). I have also tried calling them from three separate ItemGroups with the same result (three calls to the last build file). Could you post an example which might work?
-
Thursday, January 31, 2013 4:03 PMNo, what I suggest is that you try to create a new ant build file (i.e. build.xml) which do all the build work you want and in your TfsBuild.proj, add use one AntBuildFile. Can you try that?
-
Thursday, January 31, 2013 4:37 PM
Hi,
Another option is to add one Ant build file that imports the three build files that you are trying to use. Then, this new ant build file is the one to use in the TfsBuild.proj
Ex: that Ant build file can use this syntax to import the other three build files
<import file="file1Path" />
<import file="file2Path" />
<import file="file3Path" />
Please let me know if that does not work for you.
Thanks
Mireille
-
Friday, February 01, 2013 8:51 AM
We tried that, but there are two problems with that approach:
1. TFS won't know which Ant build has failed (unless I somehow create my own messagin system from Ant)
2. I know almost nothing about Ant scripts - I come from a .NET background, and I have been tasked with getting our Java code (running in TEE) to build on Java.
The reason for asking this question was to avoid exactly this scenario

