ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53335] New: Output redirection fails if antcall is started using a script
Date Thu, 31 May 2012 11:42:13 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53335

          Priority: P2
            Bug ID: 53335
          Assignee: notifications@ant.apache.org
           Summary: Output redirection fails if antcall is started using a
                    script
          Severity: normal
    Classification: Unclassified
          Reporter: issues.apache.org@steffen-heil.de
          Hardware: PC
            Status: NEW
           Version: 1.8.2
         Component: Core tasks
           Product: Ant

I have a target that calls a java class that does some output. That output is
redirected into a file.
However redirection only works, if the target is called by antcall directly,
but not if that antcall is created by some script.
Testcase is below.
Both outputs should be redirected...



<project name="specification">

    <target name="testcase-echo">
        <java classname="C" classpath="." output="output.txt" />
    </target> 

    <target name="testcase">

        <echo>${ant.version}</echo>
        <!-- prepare -->
    <echo file="C.java">public class C {public static void main(String[] x)
{System.out.println("Hello");}}</echo>
    <javac srcdir="." destdir="." includes="C.java"/>

        <!-- manually -->
        <property name="output" value="not loaded" />
        <delete file="output.txt" failonerror="no" />
    <antcall target="testcase-echo" />
        <loadfile property="manually" srcFile="output.txt" />
        <echo>manual call: ${manually}</echo>

        <!-- scripted -->
        <property name="output" value="not loaded" />
        <delete file="output.txt" failonerror="no" />
        <script language="javascript"> <![CDATA[ 
      var call = specification.createTask( "antcall" );         
            call.setTarget( "testcase-echo" );
            call.execute(); 
        ]]></script>
        <loadfile property="scripted" srcFile="output.txt" />
        <echo>script call: ${scripted}</echo>

  </target>

</project>

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message