Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 32946 invoked from network); 25 Jan 2002 06:39:55 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Jan 2002 06:39:55 -0000 Received: (qmail 19657 invoked by uid 97); 25 Jan 2002 06:39:56 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 19638 invoked by uid 97); 25 Jan 2002 06:39:55 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 19599 invoked from network); 25 Jan 2002 06:39:54 -0000 Date: Thu, 24 Jan 2002 22:39:22 -0800 From: "Frank E. Weiss" Subject: Re: looping in ant To: Ant Users List Message-id: <3C50FD9A.B95DB06D@well.com> MIME-version: 1.0 X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) Content-type: multipart/mixed; boundary="Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw)" X-Accept-Language: en References: <9844CD94-1139-11D6-8F12-0003931D19A4@alodar.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Scott, see if this can solve your problem. --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-type: text/plain; charset=us-ascii; name=readme.txt Content-transfer-encoding: 7BIT Content-disposition: inline; filename=readme.txt Here's a quick example of doing loops with ant. There are three files. build.xml --------- This is the original file with a new target "build-all". This new target chains a style task with an ant task. The style task creates a "build-cruise.xml" intermediate file which is the build file for the subsequent ant task. cruise-master-project.xml ------------------------- This file contains the list of projects to be built. As it is in XML, it uses a two level hierarchy. The root element is which contains zero or more elements. The text contents of each is the value for the build.project parameter. build.xsl --------- This is an XSL stylesheet that take the list of project parameters from the "cruise-master-project.xml" file and creates an intermediate ant build file called "build-cruise.xml". The stylesheet matches the root element in the "cruise-master-project.xml" file. It then constructs an ant element. First it adds one target to the project. This target consists of antcall tasks, one for each element in the "cruise-master-project.xml" file. Each antcall also has a parameter with the name "build.project" and the value from the "cruise-master-project.xml" file. Following this target, the stylesheet adds all the targets from the "build.xml" file. The resulting ant file consists of a project whose default target does an antcall of the target "build-one-project" for each of the project types in the "cruise-master-project.xml" file. build-cruise.xml ---------------- An intermediate generated ant file. notes ----- Tested with Apache Xalan-J 2.0.1. Download the Xalan-J binaries, remove crimson.jar and jaxp.jar from the ant lib directory, Copy the xalan and xerces jars from the xalan bin directory to the ant lib directory. --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-type: text/xml; charset=us-ascii; name=build.xsl Content-transfer-encoding: 7BIT Content-disposition: inline; filename=build.xsl --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-type: text/xml; charset=us-ascii; name=cruise-master-build.xml Content-transfer-encoding: 7BIT Content-disposition: inline; filename=cruise-master-build.xml framework viewer importer printer --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-type: text/xml; charset=us-ascii; name=build.xml Content-transfer-encoding: 7BIT Content-disposition: inline; filename=build.xml --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw) Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: --Boundary_(ID_Cx++Yqg+fG1KX2FIOYimkw)--