Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 10875 invoked by uid 500); 13 Jun 2001 14:37:10 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 10789 invoked from network); 13 Jun 2001 14:37:04 -0000 content-class: urn:content-classes:message Subject: Replace task - getting *tokens* from a properties file? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 13 Jun 2001 15:36:36 +0100 Message-ID: X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Replace task - getting *tokens* from a properties file? Thread-Index: AcD0Fj/NQAl3PsAeQTy3BsTeUzm+vw== From: "Jon Skeet" To: , X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N [Apologies for posting to both lists - I'm really not sure which this mail belongs to. As I may have future similar ones, guidance on where to post such mails in future is warmly welcome. I'm monitoring both lists, so feel free to trim replies.] I'm trying to convert our company's build procedure to Ant. I'm doing pretty well (with the addition of a couple of tasks - CopyProperty which sets the value of one specified property to the value of another; I think it's the only way of doing effectively ${${embedded}.property}, and works well enough for now, and FailUnless which simply fails unless a given property is set - I need this because "if" doesn't resolve property values (ie doing if=3D"${project}" doesn't resolve project and then test whether or not that name has is set), but I've run up against something slightly trickier. In my old build procedure I had a few steps which take a normal file (.java or whatever) and a properties file. The properties file had, for instance: Version=3Dfoo Name=3Dbar I have a little Java program which looks through the properties file, finds all the properties within it, then does a replace on all the "normal" files using these properties wrapped in <%...%>. In this case, it would be the equivalent of: " value=3D"foo"/> " value=3D"bar"/> However, I'd like the property files to determine the tokens, as my previous build did. I can probably hack something up in Replace, something like: " /> but I'm not sure that such a patch would get accepted. (Speaking of which, has anyone glanced at my Zip and VSS patches yet?) It feels slightly silly to create a whole new task for something so similar to Replace. Ideas welcome. Jon