Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 35111 invoked from network); 23 Mar 2002 11:31:27 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 23 Mar 2002 11:31:27 -0000 Received: (qmail 29577 invoked by uid 97); 23 Mar 2002 11:31:25 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 29521 invoked by uid 97); 23 Mar 2002 11:31:24 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 29498 invoked from network); 23 Mar 2002 11:31:24 -0000 From: "Adam Murdoch" To: "Ant Developers List" Subject: RE: Exporting a Project Instance Date: Sat, 23 Mar 2002 21:27:53 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: jbjk@mac.com [mailto:jbjk@mac.com] > Sent: Saturday, 23 March 2002 9:06 PM > To: Ant Developers List > Subject: Re: Exporting a Project Instance > > I have a code generator which produces a different number of Java classes > based upon the input). The names of these classes are also dependent on > the input. To make it that bit easier to work with the generated code I > also > generate a build.xml file. I currently do this by hand crafting the XML > using > StringBuffer.append(...). For example if I add a copy task to the > project, I > simply do something like: > > buff.append(" buff.append(" tofile=\"").append(destFilename).append("\""); > buff.append(" />\n"); > > This is fine for the limited tasks I currently use. I was thinking that > in the > future I may require to add other tasks and as such the amount of code I > need > to write increases. The responses on this thread have been helpful and I > now realise that my simplistic approach will not work. The object model > approach that Adam discussed seems to be the best way to achieve what > I require. > Unfortunately, you might have a bit of a wait for the project model to actually happen. Have you thought about using something like JDom to build the XML, rather than hand crafting it? Or, maybe using something like Castor or JAXB to generate a bunch of proxies for the tasks, that can turn themselves into XML. Adam -- To unsubscribe, e-mail: For additional commands, e-mail: