ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From THUFIR HAWAT <hawat.thu...@gmail.com>
Subject subant to reference a task outside of build.xml?
Date Sun, 20 Mar 2005 10:41:04 GMT
data:

D:\>
D:\>
D:\>ant
Buildfile: build.xml

clean:
   [delete] Deleting directory D:\java\classes

prepare:
    [mkdir] Created dir: D:\java\classes

compile:
    [javac] Compiling 3 source files to D:\java\classes

package:
     [echo] mainClass=HelloWorldSwing

clean:
   [delete] Deleting directory D:\java\classes

prepare:
    [mkdir] Created dir: D:\java\classes

compile:
    [javac] Compiling 3 source files to D:\java\classes

package:
     [echo] mainClass=HelloWorldSwing

BUILD FAILED
D:\build.xml:23: The following error occurred while executing this line:
D:\build.xml:23: antcall task calling its own parent target.

Total time: 5 seconds
D:\>type package.xml
<target name="package">
        <jar jarfile="${outputDir}/${mainClass}.jar" basedir="${outputDir}" >
                <manifest>
                        <attribute name="Main-Class" 
value="${pkgPath}${mainClass}"/>
                </manifest>
        </jar>
</target>

D:\>type build.xml
<project name="XHTML" default="package">

        <import file="properties.xml" />

        <target name="clean">
                <delete dir="${outputDir}" />
        </target>

        <target name="prepare" depends="clean">
                <mkdir dir="${outputDir}" />
        </target>

        <target name="compile" depends="prepare">
                <javac
                        srcdir   ="${sourceDir}"
                        destdir  ="${outputDir}"
                        classpath="${libPath}"
                />
        </target>

        <target name="package" depends="compile">
                <echo message="mainClass=${mainClass1}"/>
                <antcall target="package">
                        <param name="mainClass" value="${mainClass1}"/>
                </antcall>
        </target>
</project>

D:\>


"Nested <reference> elements can be used to copy 
references from the calling project to the new project, 
optionally under a different id. References taken from 
nested elements will override existing references that 
have been defined outside of targets in the new project - 
but not those defined inside of targets."

<http://ant.apache.org/manual/CoreTasks/antcall.html>


<reference> should be used to call the package task of 
package.xml from build.xml?


thanks,

Thufir

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


Mime
View raw message