ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Rhodes <mindcr...@cpphacker.co.uk>
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" />
             </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


Mime
View raw message