Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@jakarta.apache.org Received: (qmail 3881 invoked by uid 500); 11 Jun 2001 15:15:26 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: ant-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 3738 invoked from network); 11 Jun 2001 15:15:23 -0000 From: =?iso-8859-1?Q?J=E9r=F4me_Lacoste?= To: "Ant Dev" Subject: better reuse/extension of build files - How about an OO approach for build file definition? Date: Mon, 11 Jun 2001 17:12:18 +0200 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.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I've been using Ant for some time now, but I am not sure whether it can easily achieve what I would like to do with it. My idea is to enforce a common structure in all my projects with minimum duplication of the build file. All my projects have the same targets, almost always identical, but sometimes with little changes. !! I would like to avoid duplicating my 'master' build file and modify it slightly in all projects !! The best is to give an example: I have a build file which contains a 'prepare' target. This target creates the necessary directories for the build. In 90 % of my projects it creates a 'classes' directory, a 'dist' directory, etc.. One of my projects would like to have a specific directory. My clean target would takes care of removing this specific directory. I would like to reuse the same generic build file without having to recreate a new one just because this 'prepare' target is different. I didn't find a way in Ant to have the same flexibility as one finds in the OO way, specifically with inheritance and overriding. If there was an OO approach to define the build file, this would be easy: .... nb: I didn't reuse Java keywords by purpose. Proposed implementation is purely hypothetical. --> Question: It is possible to achieve the same degree of flexibility and reusability with Ant? If so, how are you doing this reuse in your projects? --> If not, could we add a requirement for Ant2 to enforce the reusability and flexibility? This could of course perhaps be implemented as shown above or in a non-OO way. --> Another idea: I think it would help a lot if there was some kind of small repository with a selection of - complete and complex - build examples. Jerome