ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matèrne, Jan (RZF, SG 481) <jan.mate...@fv.nrw.de>
Subject AW: Target object names
Date Fri, 07 Dec 2012 08:39:57 GMT
I did a small evaluation:
- the ""-target is the global one


Cheers 
Jan


<project>

    <echo>global</echo>
    
    <target name="target-1">
        <echo>in-t1</echo>
    </target>
    
    <target name="target-2">
        <echo>in-t2</echo>
    </target>
    
    <script language="javascript">
        targets = self.getProject().getTargets();
        tNames = targets.keySet();
        for(it=tNames.iterator(); it.hasNext();) {
            name = it.next();
            tasks = targets.get(name).getTasks();
            java.lang.System.out.println("Target '" + name + "'");
            for(i=0; i&lt;tasks.length; i++) {
                java.lang.System.out.println("  + " + tasks[i].getWrapper().getText() );
            }
        }
    </script>

</project>

-----Ursprüngliche Nachricht-----
Von: Dominique Devienne [mailto:ddevienne@gmail.com] 
Gesendet: Montag, 3. Dezember 2012 15:05
An: Ant Developers List
Betreff: Re: Target object names

On Sun, Dec 2, 2012 at 5:51 PM, Gábor Guta <the.gaboo@gmail.com> wrote:
>   If I list the target names of a project from the build node, there
> is an extra target with name "". Is this target represents the global
> declarations?

from http://ant.apache.org/manual/using.html :

"since Ant 1.6.0, every project includes an implicit target that
contains any and all top-level tasks and/or types. This target will
always be executed as part of the project's initialization, even when
Ant is run with the -projecthelp option."

I believe this "" target is the "implicit" target mentioned. --DD

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


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


Mime
View raw message