You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Patrick Aikens <pa...@gmail.com> on 2008/04/04 21:10:27 UTC

Need to make a DirSet from all directories containing a given file in Ant 1.6.5

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.

Is there any way to actually create a dirset of all directories that
contain a given file?

-- 
SELECT * FROM users WHERE clue > 0

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


Re: Need to make a DirSet from all directories containing a given file in Ant 1.6.5

Posted by Phillip Rhodes <mi...@cpphacker.co.uk>.
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" />
             </fileset>
         </ivy:buildlist>
     </target>


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

     <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" />
        </subant>
     </target>


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"
default="compile">
     <description>
         OpenQabal Experimental Dashboard app
     </description>

     <property file="build.properties"/>

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

<project>


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


TTYL,


-- 
Phillip Rhodes
Chief Architect - OpenQabal
https://openqabal.dev.java.net
LinkedIn: http://www.linkedin.com/in/philliprhodes