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]