Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93B1F7A48 for ; Fri, 4 Nov 2011 01:41:12 +0000 (UTC) Received: (qmail 73785 invoked by uid 500); 4 Nov 2011 01:41:11 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 73745 invoked by uid 500); 4 Nov 2011 01:41:11 -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 73737 invoked by uid 99); 4 Nov 2011 01:41:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 01:41:11 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robseegel@comcast.net designates 76.96.62.56 as permitted sender) Received: from [76.96.62.56] (HELO qmta06.westchester.pa.mail.comcast.net) (76.96.62.56) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 01:41:01 +0000 Received: from omta11.westchester.pa.mail.comcast.net ([76.96.62.36]) by qmta06.westchester.pa.mail.comcast.net with comcast id speD1h0070mv7h056pghZL; Fri, 04 Nov 2011 01:40:41 +0000 Received: from Alyeska.local ([68.48.36.91]) by omta11.westchester.pa.mail.comcast.net with comcast id spgg1h00j1xz9Xo3XpghRY; Fri, 04 Nov 2011 01:40:41 +0000 Message-ID: <4EB34297.8000800@comcast.net> Date: Thu, 03 Nov 2011 21:40:39 -0400 From: Rob Seegel User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Ant Users List Subject: Re: Checking if a Target Exists References: <4EB28090.5090903@sas.com> In-Reply-To: <4EB28090.5090903@sas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Steve, For my project I created a custom task that was basically an extension of runtarget (from ant-contrib), which worked *almost* the way I wanted. I wanted the following specific case: - core skeleton build process in one script, that contained hooks I could use to "extend" with one or more smaller utility scripts that are also imported to enhance the core build process by taking advantage of those hooks very much like plug-ins. The runtarget extension, can run every implementation of a particular target that it finds, or a few variations. This allows me to define a task that looks for something like "run-test-suite" or "generate-report" or "initialize" or whatever, and then add however many implementations that are appropriate for that project. What this allows me to do, is wrap other custom ant tasks into small utility modules where sensible defaults are established (that can be overridden). It allows for easier reuse of ant processes. The final project build script usually ends up being incredibly small, only implementing small snippets that are absolutely specific to the one build. Most times a scripts is between one and three imports, and maybe a few property overrides. Let me take a look at the code tomorrow - perhaps I can share it. It was written for Ant 1.6.5, but I've also used it for 1.7.* The basic idea has worked pretty well for me. Rob On 11/3/11 7:52 AM, Steve Amerige wrote: > Hi all, > > I want to be able to check if a target exists and hope you can help. > I'm looking for a generic solution that doesn't rely any knowledge of > the target name to be checked. It is not possible to modify the > target code. And, I'd like to avoid any solutions that cause the > entire JVM to be loaded (e.g., as with antcall). > > My environment is Ant 1.7 and allows for the use of Ant-Contrib and > Groovy. > > Any ideas on how to do this? Even better, any solutions anyone have > to share?! > > Thanks, > Steve Amerige > SAS Institute, Deployment Software Development > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org