It's all about the answers!

Ask a question

Executing targets for a build twice?


Anne Ross (611) | asked May 07 '12, 8:57 a.m.
We're using Jazz Build Engine for our builds which are builidng an IM offering. The build is set up to do a buildEnginePrep, build, package and publish. However, I need to do this once and then copy some mock translation files that are displayed by IM and then perform the build again during the same build. I created targets called build-real and build-mock which build-all depends on. I only do the buildEnginePrep for build-real which executes first. Everything does fine for the build-real, however, the build-mock calls the build target, but that target seems to just return the second time without executing. The log file just shows it returning. What do I need to do to get the targets to execute twice?

2 answers



permanent link
David Olsen (5237) | answered May 07 '12, 9:40 a.m.
JAZZ DEVELOPER
On 5/7/12 6:08 , rossa wrote:
Everything does fine for the
build-real, however, the build-mock calls the build target, but that
target seems to just return the second time without executing. The
log file just shows it returning. What do I need to do to get the
targets to execute twice?

You didn't say what scripting language your build script is written in,
so I will assume Ant. If it's something else, then this answer doesn't
apply.

To have an Ant target run twice, you need to use <antcall> within the
body of a target rather than using the depends="..." mechanism in the
header of the target. If the target has to be called at the correct
time, it may take some thought to organize your Ant script in just the
right way.

--
David Olsen | IBM Rational | Jazz Process Team

permanent link
Anne Ross (611) | answered May 07 '12, 4:17 p.m.
On 5/7/12 6:08 , rossa wrote:
Everything does fine for the
build-real, however, the build-mock calls the build target, but that
target seems to just return the second time without executing. The
log file just shows it returning. What do I need to do to get the
targets to execute twice?



You didn't say what scripting language your build script is written in,
so I will assume Ant. If it's something else, then this answer doesn't
apply.

To have an Ant target run twice, you need to use <antcall> within the
body of a target rather than using the depends="..." mechanism in the
header of the target. If the target has to be called at the correct
time, it may take some thought to organize your Ant script in just the
right way.

--
David Olsen | IBM Rational | Jazz Process Team


Well, that is embarrassing. You are absolutely right and it makes sense now that you've mentioned it. Thanks!

Your answer


Register or to post your answer.