Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 33165 invoked from network); 22 Jul 2009 20:51:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jul 2009 20:51:53 -0000 Received: (qmail 91823 invoked by uid 500); 22 Jul 2009 20:28:31 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 91798 invoked by uid 500); 22 Jul 2009 20:28:31 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 91788 invoked by uid 99); 22 Jul 2009 20:28:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 20:28:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qazwart@gmail.com designates 209.85.218.211 as permitted sender) Received: from [209.85.218.211] (HELO mail-bw0-f211.google.com) (209.85.218.211) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 20:28:22 +0000 Received: by bwz7 with SMTP id 7so427713bwz.28 for ; Wed, 22 Jul 2009 13:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=9NSq3zd7uLu6HlzDebKx8N2Njh0j2L60Mox2Rt3PFXo=; b=hkQdZyLRLHz1V7/ygY/GBiejPKe0TZcI2RZoq8b8Ag3KV4w2Y0AxJuTBVWdjE0N9dR p4B4YPatWYZ9TNQ5fUDSuZvW58K2JE5aSYHzSo0q1b+YCHkzLqh5uHrgoaOTsVtQUSdt b1C5i2rUzYSItBv+HbDlSWcj+oYZpwcMYJWCc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jbxyO5oMOKbVB4Br1J4VOHwVLxcNgvnCPg+22wRjp3QDATFgiX7kZR/eaRUTOOeh8E r0QjJ1HUCU12RqTI0eAnpr5oFhsowRPPJtku1Q+8yFqGr4H+33XjH3w5pz7FkDwFgV5e tZhvCmuMchPXtBg9I5mOVWkg/zOg4kkQFbMac= MIME-Version: 1.0 Received: by 10.239.152.139 with SMTP id v11mr133602hbb.91.1248294480907; Wed, 22 Jul 2009 13:28:00 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Jul 2009 16:28:00 -0400 Message-ID: Subject: Re: help to find not replaced variables From: David Weintraub To: Ant Users List Content-Type: multipart/alternative; boundary=001485f9458a1c0cfd046f5135f9 X-Virus-Checked: Checked by ClamAV on apache.org --001485f9458a1c0cfd046f5135f9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Actually, I think this solution might be more of what you want. The first solution I gave you will only tell you that there were parameters that weren't replaced, but won't tell you which parameters weren't replaced. Imagine if you had 100 parameters, and you only replaced 99 of them. It would take you a long time to find that one parameter out of the 100 that didn't get replaced. This solution will actually give you the lines that weren't substituted: ** * * * * * * * * * * The property *nonreplaced.lines* will now contain all the lines that weren'= t replaced. Thus, it would be much easier to correct the situation. You'd kno= w which one you were missing. This could be put into a fail message to fail the build if any lines were detected: * * We (including me) really should start looking more into filterchains and resources. They're a bit harder to understand than standard ant tasks like "copy", but they offer a lot of power. On Wed, Jul 22, 2009 at 3:40 PM, Scot P. Floess wrote: > > Ew - thats a really nice solution :) Now to remove my foot from my mout= h > ;) > > > On Wed, 22 Jul 2009, David Weintraub wrote: > > Ah! You want to see if the "replace" failed! >> >> Try this: >> >> ** >> * * >> * * >> * * >> ** >> * >> Files failing replace: ${files.not.replaced} >> >> >> >> >> >> >> >> * >> >> Let's take this apart: >> >> The ** should be the directory that >> contains >> the files with the variables being replaced. You then use the * >> * to find the files that contain the regular expression "= * >> @[^@][^@]*@*" >> >> The ** counts the number of files that your >> **selects. Thus if the count is greater than zero, at least >> one file has a >> parameter that wasn't replaced. >> >> 2009/7/22 J=FAlio Cesar Bueno Cotta >> >> I alread have a ant script to replace the variables..and it is working. >>> What I need is check if all the variables are beeing replaced. >>> I have a dev.properties where I have lines like this >>> @vari@=3Dtest >>> >>> each @vari@ is replaced to "test" after I run the script. >>> >>> But >>> If I forget to add the variable in the dev.properties , that variable >>> wont >>> be replaced. >>> I want to search all the varibles not replaced. >>> Thanks. >>> >>> 2009/7/22 David Weintraub >>> >>> You can do this with the task via the : >>>> >>>> A good example is given on this page: >>>> >>>> >>>> >>>> Look for the text "*Copy a set of files to a directory, replacing >>>> @TITLE@with Foo Bar in all files." >>>> >>>> *You can also look here: http://ant.apache.org/manual/index.html at th= e >>>> task. >>>> >>>> And, take a look over here too: >>>> >>>> >>>> >>>> This one shows the concept of a "filterset" and how it works with the >>>> >>>> task. It also has some excellent examples. >>>> >>>> 2009/7/22 J=FAlio Cesar Bueno Cotta >>>> >>>> Hello there, >>>>> I am new over here and I need some help. >>>>> There is a script that replace variables in the files. >>>>> And I am trying to write a ant script to find in the replaced files ( >>>>> >>>> into >>>> >>>>> a >>>>> folder like workspace/web-inf/ ) variables witch were not replaced.. >>>>> Someone can help me? >>>>> Is there some task to do that? >>>>> >>>>> I am sorry if I am not clear..my English is not pretty good. >>>>> Thanks all. >>>>> >>>>> -- >>>>> J=FAlio Cesar Bueno Cotta >>>>> Graduando em ci=EAncia da computa=E7=E3o >>>>> Universidade Federal de Vi=E7osa >>>>> >>>>> >>>> >>>> >>>> -- >>>> David Weintraub >>>> qazwart@gmail.com >>>> >>>> >>> >>> >>> -- >>> J=FAlio Cesar Bueno Cotta >>> Graduando em ci=EAncia da computa=E7=E3o >>> Universidade Federal de Vi=E7osa >>> >>> >> >> >> -- >> David Weintraub >> qazwart@gmail.com >> >> > Scot P. Floess > 27 Lake Royale > Louisburg, NC 27549 > > 252-478-8087 (Home) > 919-890-8117 (Work) > > Chief Architect JPlate http://sourceforge.net/projects/jplate > Chief Architect JavaPIM http://sourceforge.net/projects/javapim > > Architect Keros http://sourceforge.net/projects/keros > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > --=20 David Weintraub qazwart@gmail.com --001485f9458a1c0cfd046f5135f9--