Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 80202 invoked from network); 27 Aug 2003 17:51:20 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Aug 2003 17:51:20 -0000 Received: (qmail 43120 invoked by uid 500); 27 Aug 2003 17:50:49 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 43076 invoked by uid 500); 27 Aug 2003 17:50:48 -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 43059 invoked from network); 27 Aug 2003 17:50:48 -0000 Received: from unknown (HELO web20414.mail.yahoo.com) (66.163.169.90) by daedalus.apache.org with SMTP; 27 Aug 2003 17:50:48 -0000 Message-ID: <20030827175041.24151.qmail@web20414.mail.yahoo.com> Received: from [208.128.243.250] by web20402.mail.yahoo.com via HTTP; Wed, 27 Aug 2003 10:50:41 PDT Date: Wed, 27 Aug 2003 10:50:41 -0700 (PDT) From: Matt Benson Subject: Re: New Task and Classpath To: Ant Users List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N You should probably just extend the task then. Then you get a lot of stuff built in for you that it just would not make sense to duplicate. Just override setClassname() to throw an UnsupportedOperationException wrapped in a BuildException, and call super.setClassname("my.wonderful.Class") in your default constructor... disable and set to desired values any other attributes or nested elements you like similarly. -Matt --- Aloizio Pereira da Silva wrote: > My apologize. > > Yes, I am invoking a Java class from the ant task > code. > > How I can solve this problem? > > > > ***************************************************** > * Federal University of Minas > Gerais * > * Department of Computer > Science * > * Master Degree in Computer > Science * > * > * > * Aloizio Silva > * > * > http://www.dcc.ufmg.br/~aloizio * > * > * > * Mobile Computer and Network > Optimization * > > ***************************************************** > > > On Wed, 27 Aug 2003, Matt Benson wrote: > > > Normal message list etiquette is to keep the > > discussion on the list unless it is agreed to take > the > > discussion private. This is for everyone's > benefit > > including your own. Anyway, the problem still > remains > > that we don't know what it is you intend to do > with a > > classpath. Your task still has to DO something > with > > the classpath, like invoking a Java class, or > > searching for class files or something. > > > > -Matt > > > > --- Aloizio Pereira da Silva > > wrote: > > > Hi Matt Benson, > > > > > > I implemented your suggestion. Now, my new ant > task > > > allows to use > > > , but it can not set the > classpath. > > > Could you help me? > > > > > > > > > > > > ***************************************************** > > > * Federal University of > Minas > > > Gerais * > > > * Department of Computer > > > Science * > > > * Master Degree in Computer > > > Science * > > > * > > > > * > > > * Aloizio Silva > > > > * > > > * > > > http://www.dcc.ufmg.br/~aloizio * > > > * > > > > * > > > * Mobile Computer and Network > > > Optimization * > > > > > > > > > ***************************************************** > > > > > > > > > On Tue, 26 Aug 2003, Matt Benson wrote: > > > > > > > You should be able to use either an > inline-defined > > > > path element, or a referenced path element. > > > However, > > > > your task must accept a path, for one thing. > So > > > adapt > > > > that code from an existing task, like > > > > (classname > org.apache.tools.ant.taskdefs.Java). > > > It > > > > has the method: > > > > > > > > public Path createClasspath(){...} > > > > > > > > It might be possible to add Paths via some of > > > Ant's > > > > other mechanisms, but using the above has the > > > added > > > > benefit of allowing you to accept multiple > nested > > > > paths and logically concatenate them into one, > > > which > > > > is what does. > > > > > > > > then your task has to know what to DO with a > > > > classpath. Maybe if your task encapsulates > the > > > > execution of the main method of some Java > class > > > you > > > > should just extend the task to make > your > > > life > > > > easier... > > > > > > > > -Matt > > > > > > > > > > > > --- Aloizio Pereira da Silva > > > > > wrote: > > > > > This does not work. I get the following > message: > > > > > > > > > > BUILD FAILED > > > > > > file:M:/Aloizio/JAVADOC/NewAntTask/build.xml:58: > > > The > > > > > > > > > > task doesn't support the nested "classpath" > > > element. > > > > > > > > > > > > > > > The code is: > > > > > > > > > > > > > > > > > > > name="gerar_relatorio" > > > > > > > > > > > > > > > classname="org.apache.tools.ant.taskdefs.TaskGeraRelatorio" > > > > > classpath="${build.dir}"/> > > > > > --> > > > > > > > > > diretorioSaida= > > > "M:\aloizio\" > > > > > arqPrestacao= > > > > > "M:\aloizio\prestacao.txt" > > > > > > > > > > arqNomeRelatorio="M:\aloizio\relatorios.txt" > > > > > banco= > > > > > "orofic,usu_anual2,usu_anual2orofic" > > > > > > > > > > caminhoBancosInterBase="M:\aloizio\gdbs\" > > > > > > > > > > > > > > > > > > > > versaojar="C:/Local/JBuilder4/lib/Synergia/remessaanual_2.1.jar" > > > > > usarID="Sim"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ***************************************************** > > > > > * Federal University of > > > Minas > > > > > Gerais * > > > > > * Department of > Computer > > > > > Science * > > > > > * Master Degree in > Computer > > > > > Science * > > > > > * > > > > > > > > > * > > > > > * Aloizio Silva > > === message truncated === __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org