Jan:

Thanks for the reply!

Yeah, I know I can unzip or unjar...

Really, this isn't functionality I need per say... I had been thinking of a way to package up my build environment for others to use in conjunction with Ivy... As my environment contains a number of reusable things - such as XML files containing macrodefs - I was hoping to package it all up into something like a jar file...

I am still learning Ivy so maybe there is a way to use it for all my files...

Perhaps, with regards to <import> an additional attribute could be defined? For instance:

<import resource = "/some/dir/to/jarfile/somejar.jar" path = "/foo/bar/build.xml"/>

Where the resource attribute specifies a path to the jar file and path represents the path within the jar file? Just a thought...

Anyway - I don't specifically need this kind of functionality, I just thought it'd be neat if there was a way to do it :)

Thanks again!

Scot

[EMAIL PROTECTED] wrote:
We thought about extending <import> to get a resource (JAR, URL, ...), but there is one 
"problem": a project must have a basedir from where you could do calculate all the paths. Not 
really easy - if possible. What is "/"?

So you cant use the bunch of buildfiles from an archive.

But you can extract these files ...
And (I tested this) you can do this in your main buildfile:


imported-buildfiles.zip contains only b.xml:
<project name="B">
    <echo>${ant.project.name}</echo>
<target name="imported">
        <echo>imported</echo>
    </target>
</project>



build.xml is:
<project>
  <unzip src="imported-buildfiles.zip" dest="."/>
  <import file="b.xml"/>
</project>



$dir
14.09.2007  08:44               102 build.xml
14.09.2007  08:42               192 imported-buildfiles.zip

$ant -p
Buildfile: build.xml
    [unzip] Expanding: C:\TEMP\ant-test\imported-buildfiles.zip into 
C:\TEMP\ant-test
     [echo] ${ant.project.name}

Main targets:

Other targets:

 B.imported
 imported




Jan

-----Ursprüngliche Nachricht-----
Von: Scot P. Floess [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 13. September 2007 19:04
An: Ant Users List
Betreff: Import build files from a jar?

I was wondering if its possible to import build files from a Jar file?

For instance, lets "assume" I wrote a bunch of re-usable Ant scripts, placed them in a zip/jar file and wanted to import a build.xml
>from said
zip/jar file... The import task doesn't seem to work this way... Is there something else I can use or is this type of functionality not supported?

--
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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
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

Reply via email to