You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frank Wilson <fa...@gmail.com> on 2010/05/06 17:59:19 UTC

importing ant targets from the classpath

I would like to import ant build targets from the classpath. In
otherwords, I am looking for an equivalent of the "import" task, which
brings files not from the filesystem, but from the classpath (and
hence possibly from a jar). I doesn't seem to me that this is possible
with the import task. I was wondering if I have overlooked some other
facet of ant that allows this kind of functionality.

I need this kind of functionality because I have a lot of different
projects that build in a similar fashion. Currently I import the
common build targets from an ant file in a common directory, however I
would rather distribute this common build file using the maven
dependency mechanism for extra flexibility.

Ideally I would like to not have to check out the common build logic
unless I intend to change it.

Thanks,

Frank

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


Re: importing ant targets from the classpath

Posted by Frank Wilson <fa...@gmail.com>.
Thanks for your help Martin and Jan!

Sorry I missed that part of the manual Jan. :/
It was pretty much what I was looking for.

Frank

On 7 May 2010 09:24,  <Ja...@rzf.fin-nrw.de> wrote:
> From the <import> manual:
>
>  <import>
>    <javaresource name="common/targets.xml">
>      <classpath location="common.jar"/>
>    </javaresource>
>  </import>
>
>
> Jan
>
>>-----Ursprüngliche Nachricht-----
>>Von: Frank Wilson [mailto:fajwilson@gmail.com]
>>Gesendet: Donnerstag, 6. Mai 2010 17:59
>>An: user@ant.apache.org
>>Betreff: importing ant targets from the classpath
>>
>>I would like to import ant build targets from the classpath. In
>>otherwords, I am looking for an equivalent of the "import" task, which
>>brings files not from the filesystem, but from the classpath (and
>>hence possibly from a jar). I doesn't seem to me that this is possible
>>with the import task. I was wondering if I have overlooked some other
>>facet of ant that allows this kind of functionality.
>>
>>I need this kind of functionality because I have a lot of different
>>projects that build in a similar fashion. Currently I import the
>>common build targets from an ant file in a common directory, however I
>>would rather distribute this common build file using the maven
>>dependency mechanism for extra flexibility.
>>
>>Ideally I would like to not have to check out the common build logic
>>unless I intend to change it.
>>
>>Thanks,
>>
>>Frank
>>
>>---------------------------------------------------------------------
>>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
>
>

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


AW: importing ant targets from the classpath

Posted by Ja...@rzf.fin-nrw.de.
>From the <import> manual:

  <import>
    <javaresource name="common/targets.xml">
      <classpath location="common.jar"/>
    </javaresource>
  </import>


Jan 

>-----Ursprüngliche Nachricht-----
>Von: Frank Wilson [mailto:fajwilson@gmail.com] 
>Gesendet: Donnerstag, 6. Mai 2010 17:59
>An: user@ant.apache.org
>Betreff: importing ant targets from the classpath
>
>I would like to import ant build targets from the classpath. In
>otherwords, I am looking for an equivalent of the "import" task, which
>brings files not from the filesystem, but from the classpath (and
>hence possibly from a jar). I doesn't seem to me that this is possible
>with the import task. I was wondering if I have overlooked some other
>facet of ant that allows this kind of functionality.
>
>I need this kind of functionality because I have a lot of different
>projects that build in a similar fashion. Currently I import the
>common build targets from an ant file in a common directory, however I
>would rather distribute this common build file using the maven
>dependency mechanism for extra flexibility.
>
>Ideally I would like to not have to check out the common build logic
>unless I intend to change it.
>
>Thanks,
>
>Frank
>
>---------------------------------------------------------------------
>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: importing ant targets from the classpath

Posted by Martin Gainty <mg...@hotmail.com>.
Frank-

what i would do is a xslt transform on the xml file specified by the 'in' attribute
use the commonbuildfile.xsl specified by style attribute to replace known params
and output to out.xml specified by out attribute with predefined knownTarget and known parameters
  <target name="testXSLT" >
    <xslt in="/data.xml"
          out="/out.xml"
          style="${legacy.dir}/commonbuildfile.xsl">
    </xslt
  </target>

then at the end of target do an antcall to that target
    <antcall target="knownTarget">
      <param name="knownParameter1" value="1"/>
      <param name="knownParameter2" value="2"/>
    </antcall>

*gruss*
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Date: Thu, 6 May 2010 16:59:19 +0100
> Subject: importing ant targets from the classpath
> From: fajwilson@gmail.com
> To: user@ant.apache.org
> 
> I would like to import ant build targets from the classpath. In
> otherwords, I am looking for an equivalent of the "import" task, which
> brings files not from the filesystem, but from the classpath (and
> hence possibly from a jar). I doesn't seem to me that this is possible
> with the import task. I was wondering if I have overlooked some other
> facet of ant that allows this kind of functionality.
> 
> I need this kind of functionality because I have a lot of different
> projects that build in a similar fashion. Currently I import the
> common build targets from an ant file in a common directory, however I
> would rather distribute this common build file using the maven
> dependency mechanism for extra flexibility.
> 
> Ideally I would like to not have to check out the common build logic
> unless I intend to change it.
> 
> Thanks,
> 
> Frank
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
 		 	   		  
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5