ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme Lacoste <jerome.laco...@smartcardsystem.com>
Subject Behavior of Ant task and exec task / return values for Ant.bat?
Date Thu, 26 Apr 2001 10:42:20 GMT
Some of my questions are directed to the developers, some to the users.
I first need to described the problem I am trying to solve:

I have a "dist" target that create a repository "${dist.dir}" that should
contain everything needed for the distribution of the project
I am trying to make a test of my 'dist' target, so that I know that my
distribution is complete.

To do so my idea was to run Ant in the "${dist.dir}".




I first tried to make the following target using the Ant Task:

	<!--
		Test Distribution (Run 'ant all' in the distribution directory)
	-->
	<target name="test.dist" depends="create.dist"
 		description="test the distribution (Run 'ant all' in the distribution
directory)">
    		<ant dir="${dist.dir}" antfile="${dist.dir}/build.xml" target="all"/>
    	</target>

My problem was that this cannot be used as the properties won't be overriden
when running the nested Ant task. This prevent me from making a clean test.

As there is no "undefine_all_properties_except_newly_passed_ones" option in
the Ant task I am let with trying to run the Ant program using the exec
Task:

	<target name="test.dist" depends="create.dist">
		<exec dir="${dist.dir}" executable="Ant.bat" failonerror="on">
  			<arg line="all"/>
		</exec>
    	</target>

Now my problem is that when the Ant fails, the exec does not fail.
I've tried both "on" and "yes" as values for the failonerror parameter to
the exec task (documentation of the Exec Task is not that clear on what
should be passed). None worked. I then assume that the error in not reported
by the Ant.bat executable. I've checked the code but didn't see anything
related to passing errors.

Here are my questions and comments:


- am I correct saying that the Ant.bat does not report errors? If so, is it
a wanted feature?
- could it be possible to add a 'forget-all-properties-except-new-ones'
option to the Ant task. This can seem interesting in case of automatic test.
- could someone improve comments on the Exec task (what are the expected
values for the argument. Only newEnvironment is described)


- any advice on how to achieve similar results with a different technique?
Somebody made it work?

Cheers

Jerome


Mime
View raw message