You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Phil Bromley <Ph...@cdl.co.uk> on 2010/04/15 17:45:05 UTC

ant 1.8.0 exec issue

Hi All,
 
I've found the issue below with 1.8.0 that worked in 1.8.0RC1. This
seems to have been fixed in the latest build - 1.8.1alpha compiled on
April 15 2010 built locally, so I'm not reporting in on bugzilla,
however what is the process for rolling out bug fixes - I'm reluctant to
use the latest build in case other issues arise with this build.
 
Ideally some sort of branched version with this bug fix in would be best
but can you advise what's the best course of action?
 
Details of the os are below. This only seems to be on Windows XP
machines.
 
 
Using ant 1.8.0 - create a target that uses the exec task that calls cmd
then passes command line parameters "/c ant -f test.xml test-output"
which will call an ant target on another build file.
 
ant reports a build failure because the target (the target from the
first build file) does not exist in the build file - which it doesn't
have to - but seems like its ignoring the command line parameters of
which target to run.
 
here are the examples
 
*****file1 - testingoutput.xml *****
 
<project name="testingoutput">
<target name="test-output-file1">
    
        <echo message="here1" />
 
        <exec executable="cmd"
                dir="."
                failonerror="false"
                output="./test.output"
                append="true"
                resultproperty="build.result">
                <arg value="/c"/>
                <arg value="ant -f test.xml test-output"/>
        </exec>
        
        <echo message="here2" />
    
    </target>
</project>
 
*****file2 - test.xml *****
 
<project name="testing-output">
 
<target name="test-output">
            
    <echo message="hello testing"/>
 
</target>
 
</project>
 

****here is the output of running "ant -v -f testingoutput.xml
test-output-file1"*****
 
Apache Ant version 1.8.0 compiled on February 1 2010
Buildfile: C:\test\testingoutput.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0_12\jre
Detected OS: Windows XP
parsing buildfile C:\test\testingoutput.xml with URI =
file:/C:/test/testingoutput.xml
Project base dir set to: C:\test
Build sequence for target(s) `test-output-file1' is [test-output-file1]
Complete build sequence is [test-output-file1, ]
 
test-output-file1:
parsing buildfile
jar:file:/C:/PATH-TO-ANT/apache-ant-1.8.0/lib/ant.jar!/org/apache/to
ols/ant/antlib.xml with URI =
jar:file:/C:/PATH-TO-ANT/apache-ant-1.8.0/lib/ant.jar!/o
rg/apache/tools/ant/antlib.xml from a zip file
     [echo] here1
     [exec] Current OS is Windows XP
     [exec] Output appended to C:\test\test.output
     [exec] Executing 'cmd' with arguments:
     [exec] '/c'
     [exec] 'ant -f test.xml test-output'
     [exec]
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
     [echo] here2
 
BUILD SUCCESSFUL
Total time: 1 second
 

******here is the EXPECTED output in test.output******
 
Buildfile: c:\test\test.xml
 
test-output:
     [echo] hello testing
 
BUILD SUCCESSFUL
Total time: 0 seconds
 

******here is the actual output******
 
Apache Ant version 1.8.0 compiled on February 1 2010
Buildfile: C:\test\test.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0_12\jre
Detected OS: Windows XP
 
BUILD FAILED
Target "test-output-file1" does not exist in the project
"testing-output". 
 at org.apache.tools.ant.Project.tsort(Project.java:1873)
 at org.apache.tools.ant.Project.topoSort(Project.java:1781)
 at org.apache.tools.ant.Project.topoSort(Project.java:1744)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
 at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
or.java:41)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
 at org.apache.tools.ant.Main.runBuild(Main.java:801)
 at org.apache.tools.ant.Main.startAnt(Main.java:218)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
 
Total time: 0 seconds
parsing buildfile C:\test\test.xml with URI = file:/C:/test/test.xml
Project base dir set to: C:\test
 
 
 
Kind Regards
 
Philip Bromley
 
</PRE>
<p style="font-family:'Arial';font-size:8pt">
**********************************************************************<br>
Please consider the environment - do you really need to print this email?<br>
<br>
This email is intended only for the person(s) named above and may contain private and confidential information. If it has come to you in error, please destroy and permanently delete any copy in your possession and contact us on +44 (0) 161 480 4420. The information in this email is copyright © CDL Group Holdings Limited. We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before opening any attachment.<br>
CDL Internet Services Limited uses software which automatically screens incoming emails for inappropriate content and attachments. If the software identifies such content or attachment, the email will be forwarded to our Technology Department for checking. You should be aware that any email which you send to CDL Internet Services Limited is subject to this procedure. <br>
CDL Internet Services Limited, Strata House, Kings Reach Road, Stockport SK4 2HD<br>
Registered in England and Wales with Company Number 3871928</p>
<PRE>

Re: ant 1.8.0 exec issue

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-15, Phil Bromley <Ph...@cdl.co.uk> wrote:

> I've found the issue below with 1.8.0 that worked in 1.8.0RC1. This
> seems to have been fixed in the latest build - 1.8.1alpha compiled on
> April 15 2010 built locally, so I'm not reporting in on bugzilla,

>From your description it most likely has been
<https://issues.apache.org/bugzilla/show_bug.cgi?id=48876>.  If so, the
fix is a single added line inside of the .bat wrapper script.

> however what is the process for rolling out bug fixes - I'm reluctant to
> use the latest build in case other issues arise with this build.

> Ideally some sort of branched version with this bug fix in would be best
> but can you advise what's the best course of action?

In your situation I'd use Ant 1.8.0 and the .bat file from svn until Ant
1.8.1 gets released.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org