Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 93652 invoked from network); 8 Apr 2005 19:29:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Apr 2005 19:29:01 -0000 Received: (qmail 31994 invoked by uid 500); 8 Apr 2005 19:28:53 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 31958 invoked by uid 500); 8 Apr 2005 19:28:53 -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 31942 invoked by uid 99); 8 Apr 2005 19:28:53 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ggimler@gmail.com designates 64.233.184.194 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.194) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 08 Apr 2005 12:28:51 -0700 Received: by wproxy.gmail.com with SMTP id 67so2054525wri for ; Fri, 08 Apr 2005 12:28:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=UKkuRQBls3hA1/hEjS1/lLIPySeLaoVl8dDdxqAaoBlHw8Z6EcK73RWvTDLsouOjgNFTjm6pDeS6DcUb1ERZChJ88ZbWgrMZ9iQAt20cAK6L44L4C7E3Mtu0ZB7jPCY3iDfqk5S/NrqzU4sVz7leQTF2wJW4bL4p0aSTd6iLLqg= Received: by 10.54.14.44 with SMTP id 44mr42922wrn; Fri, 08 Apr 2005 12:28:50 -0700 (PDT) Received: by 10.54.2.40 with HTTP; Fri, 8 Apr 2005 12:28:50 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2005 15:28:50 -0400 From: Greg Gimler Reply-To: Greg Gimler To: Matt Benson Subject: Re: custom task question Cc: Ant Users List In-Reply-To: <20050408190141.90910.qmail@web30902.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <20050408190141.90910.qmail@web30902.mail.mud.yahoo.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I'm probably doing things incorrectly. The code snippet is... Target target = (Target)getProject().getTargets().get(fromTarget); Task[] tasks = target.getTasks(); Then I just search through the array for the one labeled "java" and that turns out to be an UnknownElement. Basically, all I want to do is get a reference to some java task that will allow me to extract the classpath and jvm arguments so I can just output those to a shell script. Thanks for your help. -Greg On Apr 8, 2005 3:01 PM, Matt Benson wrote: > What code are you executing to return an > UnknownElement? > > -Matt > > --- Greg Gimler wrote: > > Sorry, sent that one too soon. > > > > Continuing... from there I'm trying to get access to > > the java runtime > > inside of the task specified to my custom task, > > unixscriptgen. > > Instead I get access to an UnknownElement which I > > can then try and > > call the getTask() method on. It returns null > > unless I first call a > > maybeConfigure() on it. Then I can cast it to a > > Java task but the > > classpath isn't filled. > > > > Any ideas or should I attack this differently? > > > > Thanks. > > > > -Greg > > > > > > > > > > On Apr 8, 2005 2:43 PM, Greg Gimler > > wrote: > > > Hello, > > > > > > I'm trying to generate a unix shell script from an > > ant task. The ant > > > task is just a simple java execution and I want to > > generate the unix > > > shell script for deployment purposes. Is there a > > way to do this > > > easily? I've tried to write a custom task and I'm > > having a difficult > > > time getting all of the information I need. For > > example I have the > > > following snippet... > > > > > > > description="Generates the appropriate > > > shell scripts from ant runtimes."> > > > > classname="task.UnixScriptGenerator" > > > classpathref="perseus.classpath.run"/> > > > > file="blah.sh"/> > > > > > > > > > > description="blah"> > > > > classname="nonexistantclass"> > > > > refid="perseus.classpath.run"/> > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > user-unsubscribe@ant.apache.org > > For additional commands, e-mail: > > user-help@ant.apache.org > > > > > > > __________________________________ > Yahoo! Messenger > Show us what our next emoticon should look like. Join the fun. > http://www.advision.webevents.yahoo.com/emoticontest > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org