Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 19995 invoked from network); 23 Jul 2004 04:25:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jul 2004 04:25:41 -0000 Received: (qmail 86292 invoked by uid 500); 23 Jul 2004 04:25:32 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 85768 invoked by uid 500); 23 Jul 2004 04:25:29 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 85742 invoked by uid 99); 23 Jul 2004 04:25:29 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received: from [66.163.169.226] (HELO smtp106.mail.sc5.yahoo.com) (66.163.169.226) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 22 Jul 2004 21:25:27 -0700 Received: from unknown (HELO CDANIELS) (cjd4@213.161.65.38 with login) by smtp106.mail.sc5.yahoo.com with SMTP; 23 Jul 2004 04:25:26 -0000 From: "Charles Daniels" To: "Ant Users List" Subject: RE: How to get package name for a directory? Date: Fri, 23 Jul 2004 05:25:25 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: ralapa@spamex.com [mailto:ralapa@spamex.com] > Sent: Friday, July 23, 2004 1:23 AM > To: user@ant.apache.org > Subject: How to get package name for a directory? > > > Hi, > I have a very large projectd with 300 packages and 1000s of > source files. In each package, we created a build.xml file for > that package. > We also have a master build.xml file under our /build > directory which has targets to rebuild all the packages by > invoking the "compile" target on all 200 build.xml files. Why would you do such a thing? > > Everything works, but I am trying to see if there is a way to > simplify the build.xml files in each directory, so that it is > even easier to add a new build.xml for a new package. > > Here is an example build.xml that is in each package directory. >
> 
>     
>  
>     
>     
>         package: ${ant.project.name}
>         
>         
>     
> 
> 
> The "compile" target sets the "compile.dir" property, and then calls > the "compile" target in the master build.xml located in $(TOP)/build. > I am trying to find some way to make the assignement of project > name and the TOP variable automatic. I want to do something like. > >
> 
>        
> ...
> 
> 
> > For the package api.abc, I would need > ${ant.package.name} = api.abc > ${ant.package.path} = api/abc > > Is there anyway for me to construct this information based on the > basedir, or would this require a custom task? I guess I could > create a custom task which, > given a directory containing a java package, it could parse the package > statements in the .java source files to find out the package name. > > I would think this would be a commmon request, but I can't find > any builtin tasks or predefined variables which would help me > find out the java package name or base path for the package. > I found BaseName and DirName but these are very limited. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org