You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Scot P. Floess" <fl...@mindspring.com> on 2008/03/11 17:52:48 UTC

taskdef question - only usable at project level?

I'd like to call <taskdef> either in a <target> or a <macrodef>.  
However, when doing so it seems as if the call is ignored or forgotten 
afterward:

Either:

<target  name = "ensure-installed">
            <taskdef  resource = "net/sf/antcontrib/antlib.xml"  uri = 
"http://ant-contrib.sourceforge.net"  description = "Needed to use 
ant-contrib.">
                <classpath>
                    <pathelement  location = 
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
                </classpath>
            </taskdef>
</target>

Or

<macrodef  name = "ensure-installed">
    <sequential>
            <taskdef  resource = "net/sf/antcontrib/antlib.xml"  uri = 
"http://ant-contrib.sourceforge.net"  description = "Needed to use 
ant-contrib.">
                <classpath>
                    <pathelement  location = 
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
                </classpath>
            </taskdef>      
    </sequential>
</macrodef>

I am running JDK 1.6 and ant 1.7.1

I didn't readily see anything stating this can't be done...  Of course, 
I didn't spend too much time investigating...

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


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


Re: taskdef question - only usable at project level?

Posted by Peter Reilly <pe...@gmail.com>.
Most likely the typedef has been called from an <ant> or an <antcall>.

peter


On Tue, Mar 11, 2008 at 5:01 PM, Matt Benson <gu...@yahoo.com> wrote:
>
>  --- "Scot P. Floess" <fl...@mindspring.com> wrote:
>
>  > I'd like to call <taskdef> either in a <target> or a
>  > <macrodef>.
>  > However, when doing so it seems as if the call is
>  > ignored or forgotten
>  > afterward:
>
>  That shouldn't be the case.  If you can create a small
>  and reproducible example, pop it into Bugzilla.
>
>  Regards,
>  Matt
>
>
>
>  >
>  > Either:
>  >
>  > <target  name = "ensure-installed">
>  >             <taskdef  resource =
>  > "net/sf/antcontrib/antlib.xml"  uri =
>  > "http://ant-contrib.sourceforge.net"  description =
>  > "Needed to use
>  > ant-contrib.">
>  >                 <classpath>
>  >                     <pathelement  location =
>  >
>  "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>  >                 </classpath>
>  >             </taskdef>
>  > </target>
>  >
>  > Or
>  >
>  > <macrodef  name = "ensure-installed">
>  >     <sequential>
>  >             <taskdef  resource =
>  > "net/sf/antcontrib/antlib.xml"  uri =
>  > "http://ant-contrib.sourceforge.net"  description =
>  > "Needed to use
>  > ant-contrib.">
>  >                 <classpath>
>  >                     <pathelement  location =
>  >
>  "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>  >                 </classpath>
>  >             </taskdef>
>  >     </sequential>
>  > </macrodef>
>  >
>  > I am running JDK 1.6 and ant 1.7.1
>  >
>  > I didn't readily see anything stating this can't be
>  > done...  Of course,
>  > I didn't spend too much time investigating...
>  >
>  > --
>  > Scot P. Floess
>  > 27 Lake Royale
>  > Louisburg, NC  27549
>  >
>  > 252-478-8087 (Home)
>  > 919-754-4592 (Work)
>  >
>  > Chief Architect JPlate
>  > http://sourceforge.net/projects/jplate
>  > Chief Architect JavaPIM
>  > http://sourceforge.net/projects/javapim
>  >
>  > Architect Keros
>  > http://sourceforge.net/projects/keros
>  >
>  >
>  >
>  ---------------------------------------------------------------------
>  > To unsubscribe, e-mail:
>  > user-unsubscribe@ant.apache.org
>  > For additional commands, e-mail:
>  > user-help@ant.apache.org
>  >
>  >
>
>
>
>
>       ____________________________________________________________________________________
>  Never miss a thing.  Make Yahoo your home page.
>  http://www.yahoo.com/r/hs
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>  For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Re: taskdef question - only usable at project level?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Andrew:

Namespace isn't really an issue...I just like using it ;)  I think it 
makes it clearer where things originate...

Anyway...

I did figure out a way to do what I had intended.  I am actually able to 
download Ant contrib dynamically, install it and then use it...  If you 
are interested in my solution, I'd be happy to share that with you...



Andrew n marshall wrote:
>
> I am also trying to develop something like what Scot described and 
> running into similar problems.  However, I am not using the namespace 
> notation.  My version looks something like this:
>
>  <target name="update" depends="define_svnant_tasks">
>    <svn>
>      <checkout url="${cpptasks.svn}" destPath="${cpptasks.dir}" />
>    </svn>
>  </target>
>
>  <target name="define_svnant_tasks">
>    <!-- Using ant-contrib's antfetch task to call targets and import 
> resulting classpath -->
>    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
>    <antfetch antfile="svnant.xml" target="define_svnant_classpath" 
> return="svnant.classpath"/>
>    <taskdef resource="svntask.properties">
>      <classpath>
>        <pathelement path="${svnant.classpath}" />
>      </classpath>
>    </taskdef>
>    <echo>Defined &lt;svn&gt; task</echo>
>  </target>
>
>
> I currently get the following error:
>> define_svnant_classpath:
>>      [echo] Defined <svn> task
>>
>> update:
>>
>> BUILD FAILED
>> /Users/Anm/Projects/Development/ant_cpp_skeleton/lib/cpptasks.xml:19: 
>> java.lang.NoClassDefFoundError: 
>> org/tigris/subversion/javahl/ClientException
>
>
> Matt Benson wrote:
>> In Ant's distro (I think, else in SVN HEAD) you can check out the 
>> cooperation between fetch.xml and get-m2.xml . This does something 
>> like what you're talking about.
> The main difference I see is the use of import.  Instead, I avoid the 
> polluting the namespace by just <antfetch>ing the classpath before 
> defining the task.  Still, the task definition is missing in the 
> depending target.
>
>
>
> Anm
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


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


Re: taskdef question - only usable at project level?

Posted by Andrew n marshall <An...@mail.com>.
I am also trying to develop something like what Scot described and 
running into similar problems.  However, I am not using the namespace 
notation.  My version looks something like this:

  <target name="update" depends="define_svnant_tasks">
    <svn>
      <checkout url="${cpptasks.svn}" destPath="${cpptasks.dir}" />
    </svn>
  </target>

  <target name="define_svnant_tasks">
    <!-- Using ant-contrib's antfetch task to call targets and import resulting classpath -->
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
    <antfetch antfile="svnant.xml" target="define_svnant_classpath" return="svnant.classpath"/>
    <taskdef resource="svntask.properties">
      <classpath>
        <pathelement path="${svnant.classpath}" />
      </classpath>
    </taskdef>
    <echo>Defined &lt;svn&gt; task</echo>
  </target>


I currently get the following error:
> define_svnant_classpath:
>      [echo] Defined <svn> task
>
> update:
>
> BUILD FAILED
> /Users/Anm/Projects/Development/ant_cpp_skeleton/lib/cpptasks.xml:19: 
> java.lang.NoClassDefFoundError: 
> org/tigris/subversion/javahl/ClientException


Matt Benson wrote:
> In Ant's distro (I think, else in SVN HEAD) you can check out the 
> cooperation between fetch.xml and get-m2.xml . This does something 
> like what you're talking about.
The main difference I see is the use of import.  Instead, I avoid the 
polluting the namespace by just <antfetch>ing the classpath before 
defining the task.  Still, the task definition is missing in the 
depending target.



Anm



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


Re: taskdef question - only usable at project level?

Posted by Matt Benson <gu...@yahoo.com>.
--- "Scot P. Floess" <fl...@mindspring.com> wrote:

> So...to be honest...
> 
> I am working on something that will allow me to
> download whole projects 
> and install...only if not installed.  Yes, I know
> about Ivy ;)  And will 
> be incorporating soon...
> 

In Ant's distro (I think, else in SVN HEAD) you can
check out the cooperation between fetch.xml and
get-m2.xml .  This does something like what you're
talking about.

> So, what I was trying to do was...if something is
> installed, download 
> it, unpack it and then taskdef the appropriate
> stuff...like 
> Ant-Contrib...  There are some projects - JavaCC and
> FindBugs that 
> require the whole download...  I thought it'd be
> nice to have the above 
> mentioned capabilities...
> 
> I can definitely get around this...and have...  Just
> wanted to avoid 
> some pesky warning messages when the library isn't
> installed yet...
> 
> So, what are the advantages of antlib?  I've not
> used it...
> 

Um, when you taskdef a resource whose basename is
antlib.xml, you're using antlibs.  The advantage IMO
of using the xml ns mapping I pointed to is automation
and terseness.  The fetch.xml example shows that it
can be used at an arbitrary level e.g.
project/target/sequential as well.

HTH,
Matt

> Matt Benson wrote:
> > --- "Scot P. Floess" <fl...@mindspring.com>
> wrote:
> >
> >   
> >> Yeah it definitely doesn't work.  It gets even
> >> better...  If I try to do 
> >> something after the <taskdef> - for example
> >> <ant-contrib:var  name = 
> >> "FOO"  unset = "true"/> I get this kind of error:
> >>     
> >
> > Not sure about your problem, and it probably bears
> > looking into, but if you're just going to import
> the
> > whole antlib to a namespace anyway, have you tried
> > importing as in the example at:
> >
> >
>
file:///Users/mbenson/oss/asf/ant/docs/manual/CoreTypes/antlib.html#antlibnamespace
> >
> > I prefer this way.  :)
> >
> > -Matt
> >
> >   
> >>
> /home/rdu/sfloess/development/test/ant2/build.xml:2:
> >> The following error 
> >> occurred while executing this line:
> >>
> >>     
> >
>
/home/rdu/sfloess/development/test/ant2/third-party.xml:45:
> >   
> >> The prefix 
> >> "ant-contrib" for element "ant-contrib:var" is
> not
> >> bound.
> >>
> >>
> >> Matt Benson wrote:
> >>     
> >>> --- "Scot P. Floess" <fl...@mindspring.com>
> >>>       
> >> wrote:
> >>     
> >>>   
> >>>       
> >>>> I'd like to call <taskdef> either in a <target>
> >>>>         
> >> or a
> >>     
> >>>> <macrodef>.  
> >>>> However, when doing so it seems as if the call
> is
> >>>> ignored or forgotten 
> >>>> afterward:
> >>>>     
> >>>>         
> >>> That shouldn't be the case.  If you can create a
> >>>       
> >> small
> >>     
> >>> and reproducible example, pop it into Bugzilla.
> >>>
> >>> Regards,
> >>> Matt
> >>>
> >>>   
> >>>       
> >>>> Either:
> >>>>
> >>>> <target  name = "ensure-installed">
> >>>>             <taskdef  resource =
> >>>> "net/sf/antcontrib/antlib.xml"  uri = 
> >>>> "http://ant-contrib.sourceforge.net" 
> description
> >>>>         
> >> =
> >>     
> >>>> "Needed to use 
> >>>> ant-contrib.">
> >>>>                 <classpath>
> >>>>                     <pathelement  location = 
> >>>>
> >>>>     
> >>>>         
> >
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
> >   
> >>>   
> >>>       
> >>>>                 </classpath>
> >>>>             </taskdef>
> >>>> </target>
> >>>>
> >>>> Or
> >>>>
> >>>> <macrodef  name = "ensure-installed">
> >>>>     <sequential>
> >>>>             <taskdef  resource =
> >>>> "net/sf/antcontrib/antlib.xml"  uri = 
> >>>> "http://ant-contrib.sourceforge.net" 
> description
> >>>>         
> >> =
> >>     
> >>>> "Needed to use 
> >>>> ant-contrib.">
> >>>>                 <classpath>
> >>>>                     <pathelement  location = 
> >>>>
> >>>>     
> >>>>         
> >
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
> >   
> >>>   
> >>>       
> >>>>                 </classpath>
> >>>>             </taskdef>      
> >>>>     </sequential>
> >>>> </macrodef>
> >>>>
> >>>> I am running JDK 1.6 and ant 1.7.1
> >>>>
> >>>> I didn't readily see anything stating this
> can't
> >>>>         
> >> be
> >>     
> >>>> done...  Of course, 
> >>>> I didn't spend too much time investigating...
[SNIP]


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


Re: taskdef question - only usable at project level?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
So...to be honest...

I am working on something that will allow me to download whole projects 
and install...only if not installed.  Yes, I know about Ivy ;)  And will 
be incorporating soon...

So, what I was trying to do was...if something is installed, download 
it, unpack it and then taskdef the appropriate stuff...like 
Ant-Contrib...  There are some projects - JavaCC and FindBugs that 
require the whole download...  I thought it'd be nice to have the above 
mentioned capabilities...

I can definitely get around this...and have...  Just wanted to avoid 
some pesky warning messages when the library isn't installed yet...

So, what are the advantages of antlib?  I've not used it...

Matt Benson wrote:
> --- "Scot P. Floess" <fl...@mindspring.com> wrote:
>
>   
>> Yeah it definitely doesn't work.  It gets even
>> better...  If I try to do 
>> something after the <taskdef> - for example
>> <ant-contrib:var  name = 
>> "FOO"  unset = "true"/> I get this kind of error:
>>     
>
> Not sure about your problem, and it probably bears
> looking into, but if you're just going to import the
> whole antlib to a namespace anyway, have you tried
> importing as in the example at:
>
> file:///Users/mbenson/oss/asf/ant/docs/manual/CoreTypes/antlib.html#antlibnamespace
>
> I prefer this way.  :)
>
> -Matt
>
>   
>> /home/rdu/sfloess/development/test/ant2/build.xml:2:
>> The following error 
>> occurred while executing this line:
>>
>>     
> /home/rdu/sfloess/development/test/ant2/third-party.xml:45:
>   
>> The prefix 
>> "ant-contrib" for element "ant-contrib:var" is not
>> bound.
>>
>>
>> Matt Benson wrote:
>>     
>>> --- "Scot P. Floess" <fl...@mindspring.com>
>>>       
>> wrote:
>>     
>>>   
>>>       
>>>> I'd like to call <taskdef> either in a <target>
>>>>         
>> or a
>>     
>>>> <macrodef>.  
>>>> However, when doing so it seems as if the call is
>>>> ignored or forgotten 
>>>> afterward:
>>>>     
>>>>         
>>> That shouldn't be the case.  If you can create a
>>>       
>> small
>>     
>>> and reproducible example, pop it into Bugzilla.
>>>
>>> Regards,
>>> Matt
>>>
>>>   
>>>       
>>>> Either:
>>>>
>>>> <target  name = "ensure-installed">
>>>>             <taskdef  resource =
>>>> "net/sf/antcontrib/antlib.xml"  uri = 
>>>> "http://ant-contrib.sourceforge.net"  description
>>>>         
>> =
>>     
>>>> "Needed to use 
>>>> ant-contrib.">
>>>>                 <classpath>
>>>>                     <pathelement  location = 
>>>>
>>>>     
>>>>         
> "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>   
>>>   
>>>       
>>>>                 </classpath>
>>>>             </taskdef>
>>>> </target>
>>>>
>>>> Or
>>>>
>>>> <macrodef  name = "ensure-installed">
>>>>     <sequential>
>>>>             <taskdef  resource =
>>>> "net/sf/antcontrib/antlib.xml"  uri = 
>>>> "http://ant-contrib.sourceforge.net"  description
>>>>         
>> =
>>     
>>>> "Needed to use 
>>>> ant-contrib.">
>>>>                 <classpath>
>>>>                     <pathelement  location = 
>>>>
>>>>     
>>>>         
> "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>   
>>>   
>>>       
>>>>                 </classpath>
>>>>             </taskdef>      
>>>>     </sequential>
>>>> </macrodef>
>>>>
>>>> I am running JDK 1.6 and ant 1.7.1
>>>>
>>>> I didn't readily see anything stating this can't
>>>>         
>> be
>>     
>>>> done...  Of course, 
>>>> I didn't spend too much time investigating...
>>>>
>>>> -- 
>>>> Scot P. Floess
>>>> 27 Lake Royale
>>>> Louisburg, NC  27549
>>>>
>>>> 252-478-8087 (Home)
>>>> 919-754-4592 (Work)
>>>>
>>>> Chief Architect JPlate  
>>>> http://sourceforge.net/projects/jplate
>>>> Chief Architect JavaPIM 
>>>> http://sourceforge.net/projects/javapim
>>>>
>>>> Architect Keros         
>>>> http://sourceforge.net/projects/keros
>>>>
>>>>
>>>>
>>>>     
>>>>         
> ---------------------------------------------------------------------
>   
>>>   
>>>       
>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail:
>>>> user-help@ant.apache.org
>>>>
>>>>
>>>>     
>>>>         
>>>
>>>      
>>>       
> ____________________________________________________________________________________
>   
>>> Never miss a thing.  Make Yahoo your home page. 
>>> http://www.yahoo.com/r/hs
>>>
>>>
>>>       
> ---------------------------------------------------------------------
>   
>>> To unsubscribe, e-mail:
>>>       
>> user-unsubscribe@ant.apache.org
>>     
>>> For additional commands, e-mail:
>>>       
>> user-help@ant.apache.org
>>     
>>>   
>>>       
>> -- 
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (Work)
>>
>> Chief Architect JPlate  
>> http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM 
>> http://sourceforge.net/projects/javapim
>>
>> Architect Keros         
>> http://sourceforge.net/projects/keros
>>
>>
>>     
>
>
>
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


Re: taskdef question - only usable at project level?

Posted by Matt Benson <gu...@yahoo.com>.
--- "Scot P. Floess" <fl...@mindspring.com> wrote:

> Yeah it definitely doesn't work.  It gets even
> better...  If I try to do 
> something after the <taskdef> - for example
> <ant-contrib:var  name = 
> "FOO"  unset = "true"/> I get this kind of error:

Not sure about your problem, and it probably bears
looking into, but if you're just going to import the
whole antlib to a namespace anyway, have you tried
importing as in the example at:

file:///Users/mbenson/oss/asf/ant/docs/manual/CoreTypes/antlib.html#antlibnamespace

I prefer this way.  :)

-Matt

> 
> /home/rdu/sfloess/development/test/ant2/build.xml:2:
> The following error 
> occurred while executing this line:
>
/home/rdu/sfloess/development/test/ant2/third-party.xml:45:
> The prefix 
> "ant-contrib" for element "ant-contrib:var" is not
> bound.
> 
> 
> Matt Benson wrote:
> > --- "Scot P. Floess" <fl...@mindspring.com>
> wrote:
> >
> >   
> >> I'd like to call <taskdef> either in a <target>
> or a
> >> <macrodef>.  
> >> However, when doing so it seems as if the call is
> >> ignored or forgotten 
> >> afterward:
> >>     
> >
> > That shouldn't be the case.  If you can create a
> small
> > and reproducible example, pop it into Bugzilla.
> >
> > Regards,
> > Matt
> >
> >   
> >> Either:
> >>
> >> <target  name = "ensure-installed">
> >>             <taskdef  resource =
> >> "net/sf/antcontrib/antlib.xml"  uri = 
> >> "http://ant-contrib.sourceforge.net"  description
> =
> >> "Needed to use 
> >> ant-contrib.">
> >>                 <classpath>
> >>                     <pathelement  location = 
> >>
> >>     
> >
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
> >   
> >>                 </classpath>
> >>             </taskdef>
> >> </target>
> >>
> >> Or
> >>
> >> <macrodef  name = "ensure-installed">
> >>     <sequential>
> >>             <taskdef  resource =
> >> "net/sf/antcontrib/antlib.xml"  uri = 
> >> "http://ant-contrib.sourceforge.net"  description
> =
> >> "Needed to use 
> >> ant-contrib.">
> >>                 <classpath>
> >>                     <pathelement  location = 
> >>
> >>     
> >
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
> >   
> >>                 </classpath>
> >>             </taskdef>      
> >>     </sequential>
> >> </macrodef>
> >>
> >> I am running JDK 1.6 and ant 1.7.1
> >>
> >> I didn't readily see anything stating this can't
> be
> >> done...  Of course, 
> >> I didn't spend too much time investigating...
> >>
> >> -- 
> >> Scot P. Floess
> >> 27 Lake Royale
> >> Louisburg, NC  27549
> >>
> >> 252-478-8087 (Home)
> >> 919-754-4592 (Work)
> >>
> >> Chief Architect JPlate  
> >> http://sourceforge.net/projects/jplate
> >> Chief Architect JavaPIM 
> >> http://sourceforge.net/projects/javapim
> >>
> >> Architect Keros         
> >> http://sourceforge.net/projects/keros
> >>
> >>
> >>
> >>     
> >
>
---------------------------------------------------------------------
> >   
> >> To unsubscribe, e-mail:
> >> user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail:
> >> user-help@ant.apache.org
> >>
> >>
> >>     
> >
> >
> >
> >      
>
____________________________________________________________________________________
> > Never miss a thing.  Make Yahoo your home page. 
> > http://www.yahoo.com/r/hs
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
> >   
> 
> -- 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (Work)
> 
> Chief Architect JPlate  
> http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM 
> http://sourceforge.net/projects/javapim
> 
> Architect Keros         
> http://sourceforge.net/projects/keros
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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


Re: taskdef question - only usable at project level?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Yeah it definitely doesn't work.  It gets even better...  If I try to do 
something after the <taskdef> - for example <ant-contrib:var  name = 
"FOO"  unset = "true"/> I get this kind of error:

/home/rdu/sfloess/development/test/ant2/build.xml:2: The following error 
occurred while executing this line:
/home/rdu/sfloess/development/test/ant2/third-party.xml:45: The prefix 
"ant-contrib" for element "ant-contrib:var" is not bound.


Matt Benson wrote:
> --- "Scot P. Floess" <fl...@mindspring.com> wrote:
>
>   
>> I'd like to call <taskdef> either in a <target> or a
>> <macrodef>.  
>> However, when doing so it seems as if the call is
>> ignored or forgotten 
>> afterward:
>>     
>
> That shouldn't be the case.  If you can create a small
> and reproducible example, pop it into Bugzilla.
>
> Regards,
> Matt
>
>   
>> Either:
>>
>> <target  name = "ensure-installed">
>>             <taskdef  resource =
>> "net/sf/antcontrib/antlib.xml"  uri = 
>> "http://ant-contrib.sourceforge.net"  description =
>> "Needed to use 
>> ant-contrib.">
>>                 <classpath>
>>                     <pathelement  location = 
>>
>>     
> "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>   
>>                 </classpath>
>>             </taskdef>
>> </target>
>>
>> Or
>>
>> <macrodef  name = "ensure-installed">
>>     <sequential>
>>             <taskdef  resource =
>> "net/sf/antcontrib/antlib.xml"  uri = 
>> "http://ant-contrib.sourceforge.net"  description =
>> "Needed to use 
>> ant-contrib.">
>>                 <classpath>
>>                     <pathelement  location = 
>>
>>     
> "/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>   
>>                 </classpath>
>>             </taskdef>      
>>     </sequential>
>> </macrodef>
>>
>> I am running JDK 1.6 and ant 1.7.1
>>
>> I didn't readily see anything stating this can't be
>> done...  Of course, 
>> I didn't spend too much time investigating...
>>
>> -- 
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (Work)
>>
>> Chief Architect JPlate  
>> http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM 
>> http://sourceforge.net/projects/javapim
>>
>> Architect Keros         
>> http://sourceforge.net/projects/keros
>>
>>
>>
>>     
> ---------------------------------------------------------------------
>   
>> To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> For additional commands, e-mail:
>> user-help@ant.apache.org
>>
>>
>>     
>
>
>
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


Re: taskdef question - only usable at project level?

Posted by Matt Benson <gu...@yahoo.com>.
--- "Scot P. Floess" <fl...@mindspring.com> wrote:

> I'd like to call <taskdef> either in a <target> or a
> <macrodef>.  
> However, when doing so it seems as if the call is
> ignored or forgotten 
> afterward:

That shouldn't be the case.  If you can create a small
and reproducible example, pop it into Bugzilla.

Regards,
Matt

> 
> Either:
> 
> <target  name = "ensure-installed">
>             <taskdef  resource =
> "net/sf/antcontrib/antlib.xml"  uri = 
> "http://ant-contrib.sourceforge.net"  description =
> "Needed to use 
> ant-contrib.">
>                 <classpath>
>                     <pathelement  location = 
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>                 </classpath>
>             </taskdef>
> </target>
> 
> Or
> 
> <macrodef  name = "ensure-installed">
>     <sequential>
>             <taskdef  resource =
> "net/sf/antcontrib/antlib.xml"  uri = 
> "http://ant-contrib.sourceforge.net"  description =
> "Needed to use 
> ant-contrib.">
>                 <classpath>
>                     <pathelement  location = 
>
"/local/sfloess/test/lib/ant-contrib/ant-contrib-1.0b3.jar"/>
>                 </classpath>
>             </taskdef>      
>     </sequential>
> </macrodef>
> 
> I am running JDK 1.6 and ant 1.7.1
> 
> I didn't readily see anything stating this can't be
> done...  Of course, 
> I didn't spend too much time investigating...
> 
> -- 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (Work)
> 
> Chief Architect JPlate  
> http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM 
> http://sourceforge.net/projects/javapim
> 
> Architect Keros         
> http://sourceforge.net/projects/keros
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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