Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 74187 invoked from network); 3 Jun 2003 17:36:01 -0000 Received: from unknown (HELO mx1.trysybase.com) (63.102.81.233) by daedalus.apache.org with SMTP; 3 Jun 2003 17:36:01 -0000 Received: from mail.trysybase.com (mail.trysybase.com [172.20.0.10]) by mx1.trysybase.com (8.11.6/8.11.0) with ESMTP id h53HaCA21149 for ; Tue, 3 Jun 2003 11:36:12 -0600 Received: from wdn086 (corptechw2k.mclabs.com [172.20.1.227] (may be forged)) by mail.trysybase.com (8.11.6/8.11.6) with SMTP id h53HTrW29111 for ; Tue, 3 Jun 2003 11:29:53 -0600 Reply-To: From: "Adam Jack" To: "'Ant Users List'" Subject: RE: Custom Path/FileSet types Date: Tue, 3 Jun 2003 11:37:56 -0600 Message-ID: <010801c329f6$df5ccb40$34cbea43@wdn086> 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 CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <200306031624.59092.peter.reilly@corvil.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N peter reilly [mailto:peter.reilly@corvil.com] wrote: I'll attempt to answer some of these. Thanks, I appreciate that. First there is a big difference beween path and fileset. Path is a lot nicer to use, and can hold more files but fileset is used by more tasks that path. Ok, thanks for that insight. Second, do not do things in the constructor - an empty constructor is best. Use set/add methods to set/add things. Yup, works for me, I try to have lightweight constructors (and especially none w/ content that throws exception that I might want to catch), I'll go w/ empty... > > 1) Does what I am doing make sense as types verses tasks? What are the pros > and cons of each? It depends...., It may be usefull to be both. In your case it looks like it should be a datatype. If I go down to DataType, aren't I cutting myself off from this being passed into existing tasks? > 3) I suspect I'll have a singleton factory (of sorts) to create my > constructs. That entity will probably want some per VM or per project > configuration (or perhaps not a real singleton). I see I can access the > project, so I can access properties, but are there helpers for per project > instances? Do I need to roll my own? You should not use a singleton factory. A number of should be enough. Not sure I follow that, but then I probably mis-explained my intentions (or just plain used the wrong word). Making an analogy --- I see the things I create as 'File Handles', and I need to create a 'File Sub-System' to create them (and that is heavier weight.) I need to configure that once (knowledge of remote repositories, etc) and then these "file references" can be found/downloaded/reference much easier. That clearer? Any concept like that exist? > 4) How ought I handle logging? Can types log? Logging seems attached to the > Task, not ProjectComponent. If not, how might user tasks report debugging > information for types? A project componet has a setProject(Project) method that gets called when ant creates the object. Use project#log() for logging. Doh, didn't see logging down there. > 5) If I create a custom FileSet (say) can I add it to anything that takes a > FileSet (because I am a sub-class) or does the "container" need to > understand the XML tag? I.e. can I add