Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 63537 invoked from network); 16 Jun 2006 11:52:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 11:52:03 -0000 Received: (qmail 5018 invoked by uid 500); 16 Jun 2006 11:51:59 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 4977 invoked by uid 500); 16 Jun 2006 11:51:58 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 4960 invoked by uid 99); 16 Jun 2006 11:51:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 04:51:58 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 195.212.29.136 is neither permitted nor denied by domain of mark.hindess@googlemail.com) Received: from [195.212.29.136] (HELO mtagate3.uk.ibm.com) (195.212.29.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 04:51:57 -0700 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate3.uk.ibm.com (8.13.6/8.13.6) with ESMTP id k5GBpZhc066430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Jun 2006 12:51:35 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.6/NCO/VER7.0) with ESMTP id k5GBqp6g113266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Jun 2006 12:52:51 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k5GBpZhe028853 for ; Fri, 16 Jun 2006 12:51:35 +0100 Received: from anaheim.local (sig-9-145-16-212.uk.ibm.com [9.145.16.212]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5GBpYTg028832 for ; Fri, 16 Jun 2006 12:51:34 +0100 Message-Id: <200606161151.k5GBpYTg028832@d06av02.portsmouth.uk.ibm.com> X-Mailer: exmh version 2.7.2 01/07/2005 (debian 1:2.7.2-7) with nmh-1.1 From: Mark Hindess To: harmony-dev@incubator.apache.org Subject: Re: [classlib] Simplifying the ant files? In-reply-to: Your message of "Fri, 16 Jun 2006 11:48:53 BST." <44928C95.6070307@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 16 Jun 2006 12:51:34 +0100 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 16 June 2006 at 11:48, Oliver Deakin wrote: > Mark Hindess wrote: > > There are a couple of things I'd like to "fix" about the build.xml > > structure. I'd be very interested in what other people think about > > these issues. In no particular order: > > > > 1) Currently when you look at the classlib checkout for the first time > > the first think most people are going to do is look for a build.xml > > file. Well, we don't have one at the top level. Fortunately 'make' > > is an obvious place to look but then you find several .xml files. > > Again fortunately build.xml is the obvious choice but the other files > > 'build-java.xml' and 'build-test.xml' might be confusing ... the latter > > more especially when you come to run the tests. (Granted reading the > > README helps.) > > > > I think we should move build.xml up to the top-level. > > > > It isn't the case right now, but we should aim to make this the only > > ant file that developers need to invoke when building/testing at the > > top-level. > > > > Agreed. A while back I opened HARMONY-286 (which was never applied, > and is likely wildly out of date by now) to create build-java and > build-natives targets in the main build.xml - I was spurred on by the > fact that the only way to compile only Java or only native code was > to go and run those particular Ant scripts, and there were errors in > the scripts that meant they couldn't be run standalone without some > tweaking (which I believe have since been fixed). I think compiling native/java is less of an issue now we don't "clean"? What do you think? > It would be nice to get to a point where a developer can rebuild/test > any part of the classlib just by calling targets in the main > build.xml. > > > An example of why this doesn't quite work right now is that I > > sometimes use make/build-test.xml with arguments like "test-archive > > gen-report" to just run the tests for the archive module. Rather > > than create test-archive, test-auth, etc in the top-level > > build.xml I think we should us a variable so you can do "ant > > -Dtest.module=luni test" rather than "ant test-luni gen-report". > > Obviously the default if the variable is not set should be to test > > every module. This is not dissimilar to the test.case variable > > usage in the module build.xml files. > > > > I'm sure others can think of more examples. I think doing this > > helps to make it clear which parts of the ant scripts are API - that > > we should aim to support (and over time stabilise) - and which bits > > are "internals" that might change. > > > Perhaps we could also have the capability to build individual modules > by specifying "-Dbuild.module=luni"? Obviously this would rely on you > previously building the whole classlib (as the modular build would > require its dependencies to already exist) or have an HDK installed > somewhere. Some might argue that this would be better achieved by moving to the module level, but it could come out in the wash when fixing my "test-luni gen-report" issue so I don't see any problem with supporting this. > > 4) Also at the module level, I think we should compress the two layers > > of make/build.xml and make/common/build.xml. For one thing it is very > > confusing, that: > > > > a) modules/auth/make/common/build.xml builds the platform-specific > > java code, and > > > > b) modules/luni/make/platform seems to be related to what we've been > > calling native code not about platform-specific java code. > > > > It would be crazy to separate building of platform-specific and > > platform-independent java code because we'll only have problems > > handling dependencies and it would mean a lot of duplication. > > > > Even if we renamed 'platform' to native, I still don't think the > > separate build.xml is needed since all it would ever do - in the near > > future when we start moving the native code - is call straight out to > > a makefile (or configure or whatever) so I don't think this extra > > layer would add much. > > > > Agreed - currently the extra Ant files under platform are of no use and > can safely be removed. > IMHO they won't become useful any time soon since, as you say, all we do > to build native code > is exec whichever make command. I dont think that justifies separate > platform specific scripts. > > Perhaps we could have Ant scripts organised in a similar way to those at > the top level? > i.e. the main build.xml is at the top level of the module. Then under > the module's make > directory we have a build-java.xml, a build-native.xml and a > build-tests.xml, which the top > level build.xml delegates all of the "real work" down to. As you > suggested above, the top level > build.xml contains all the common targets that a developer might want to > use, such as build-native, > clean-native etc. > > Sound good? I like as few layers of indirection as possible but agree that modules and top-level should be alike where possible. > > 5) The module ant files use a properties file to define a bunch of > > variables called: > > > > hy..blah.blah > > > > Is anyone really attached to xml properties files? Personally I find > > it much easier to read text properties like: > > > > hy.luni.src.main.java=src/main/java > > hy.luni.bin.main=bin/main > > > > than: > > > > > > > > > >
> > > >
> >
> > > >
> > > > > > > > > > [Aside: hy.luni.bin.main isn't used (correctly) any more anyway.] > > > > These files can be a little bit unreadable - are you suggesting > that we still have a separate properties file but it contains plain > one-line properties instead of xml, or get rid of the separate > properties file altogether and incorporate all the required properties > into whichever build script they are appropriate to? I was thinking still keeping a separate file. There might be an issue with some "location" variables since you can't distinguish between value and location properties in text files. (At least I don't think so but I could be wrong.) > > 8) Running "ant -f make/build.xml" from a module sub-directory doesn't > > actually clean the main compiled classes. (I think this is pretty > > important to getting consistent expected behaviour so I'm looking at > > this right now and will fix it shortly unless anyone shouts.) > > > > Do you mean the classes that are built under the > /build directory? Since I've been doing work on > modularisation recently, I've been thinking about where modules should > build their classes when you run the module level build script. > > I was thinking about a developer who only had, say, luni checked out > and an HDK to build against. He goes into the luni module and runs > the main build.xml, but when this builds the Java code it tries to > stick the classes into /../../build, which doesnt actually > exist! I was wondering if maybe the default output dir for a modular > java build should be /build, and for a global build it > will be /build? We had things building to two places before it caused really confusion. I think George would remember the details. > So can I suggest that the modular build.xml defaults to building and > cleaning its classes in a /build directory, but allow the > location of the build directory to be overridden? The first part is what I was suggesting but ... I think the overriding needs thinking about a little more. Specifically, I don't want someone doing: cd classlib ant cd modules/luni ant and having classes compiled to two different locations. But if modules/ luni is your "top-level" then yes, building to ../../build is a little odd. ;-) > > Well, these are some of the things that are bothering me. I suspect > > others have other issues? > > > > I also notice that the modular build.xml looks to open the > properties file in the classlib/trunk/make directory by > using a relative path from the location of the module i.e. > /../../make/properties.xml. If a developer only has > that module checked out, then this relative location will not work - > this is something that I guess can be approached if you rework the > properties files (5). I think there are a lot of issues when building with just one module checked out. I think we should fix the existing problems - but with this issue in mind - and deal with this on a new thread. -Mark. --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org