Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 45244 invoked from network); 1 Sep 2000 15:46:33 -0000 Received: from web1902.mail.yahoo.com (128.11.23.51) by locus.apache.org with SMTP; 1 Sep 2000 15:46:33 -0000 Received: (qmail 7242 invoked by uid 60001); 1 Sep 2000 16:04:16 -0000 Message-ID: <20000901160416.7241.qmail@web1902.mail.yahoo.com> Received: from [199.222.4.38] by web1902.mail.yahoo.com; Fri, 01 Sep 2000 09:04:16 PDT Date: Fri, 1 Sep 2000 09:04:16 -0700 (PDT) From: Kevin Toomey Reply-To: toomeyk@bigfoot.com Subject: Re: "depends" gets executed before "if" To: ant-user@jakarta.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Yes, it is a little clumsy, but after thinking about it some more, I think I understand why it was done that way. If and unless are used to check if a property has been set. Usually properties are set during an "init" target. The init target would need to run prior to the "if" check. Thanks, Kevin. --- Jesse Glick wrote: > Kevin Toomey wrote: > > Given the build.xml statements below, I expected that my input and > > output directories would get deleted only if the property cleanAll > was > > set. That's not the case. The "depends" targets get executed first, > > then the "if" is checked. I can get around this easily enough, by > > moving the "if" checks to the two delete_* tasks. > > Am I missing something in thinking that "if" and "unless" should be > > checked prior to performing depends"? > > Well, they're not...they only apply to the target they are placed on, > and I believe they are checked at runtime when that target is > reached. > The "depends" analysis is done statically before any targets are run. > I > can see how this would be considered confusing. Anyway, just add the > if-test to the subtargets; or move the subtargets into the body of a > conditional target, thus: > > > > > > > > depends="delete_class_files,delete_source_files"/> > > Clumsy and not very efficient but you can make it work. > > -Jesse > > -- > Jesse Glick > NetBeans, Open APIs > tel (+4202) 3300-9161 Sun Micro x49161 Praha CR __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/