ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Rhodes <>
Subject Re: Need to make a DirSet from all directories containing a given file in Ant 1.6.5
Date Sat, 05 Apr 2008 20:56:42 GMT
Patrick Aikens wrote:
> I've seen solutions using <scriptselector> and javascript, but that's
> not supported in 1.6.5 as far as I can tell.  Unfortunately, I can't
> upgrade to 1.7.0 just yet.  I need to be able to run a <subant> task
> on all project directories using a single build file (genericantfile),
> but ONLY if those directories contain an ivy.xml file (we want do some
> magic preprocessing on projects that have migrated to using ivy using
> dependencies found from ivy:resolve - but not all projects have
> migrated).  For reasons I don't want to get into here, I am not able
> to simply have a build file for each project at this time.

I don't know any way to do this that doesn't involve having a build.xml
in each of those directories.  Is there any way you could actually
put a build.xml in there, but make it all but empty, simply
importing the "genericantfile" contents?  If you could then you could
use ivy:buildlist with skipbuildwithoutivy="true" set.

FWIW, here's how I structure things:

     <target name="buildlist">
         <ivy:buildlist reference="build-path" skipbuildwithoutivy="true">
             <fileset dir="..">
              	<include name="**/build.xml" />

     <target name="clean-all-subprojects" depends="buildlist"
description="clean-all all projects">
         <subant target="clean-all" buildpathref="build-path" />
     <target name="compile-subprojects" depends="buildlist"
description="compile all projects">
         <subant target="compile" buildpathref="build-path" />
	<target name="package-subprojects" depends="buildlist"
description="package all projects">
         <subant target="package" buildpathref="build-path" />
     <target name="publish-shared-subprojects" depends="buildlist"
description="publish-shared all projects">
         <subant target="publish-shared" buildpathref="build-path" />

     <target name="build-publish-subprojects" depends="buildlist"
description="build and then publish each subproject, based on
interproject dependencies" >
        <subant buildpathref="build-path">
        	<target name="package" />
         <target name="publish-shared" />

All of this (and some other stuff) lives in common.xml, and individual
project build.xml files mostly look like this:

<project  xmlns:ivy="antlib:org.apache.ivy.ant" name="exp-dashboard"
         OpenQabal Experimental Dashboard app

     <property file=""/>

     <import file="${keras.home}/common.xml" />


HTH, sorry to not have a better answer for you. Good luck figuring
something out. :-)


Phillip Rhodes
Chief Architect - OpenQabal

View raw message