ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Using ExecTask class
Date Mon, 03 Feb 2003 16:06:29 GMT
When composing an Ant task within your custom task, use the following idiom:

    // Override Task#init
    public void init()
                throws BuildException {
        _java = new Java();
        configureTask(_java);
    }

    private void configureTask(Task helper) {
        helper.setProject(getProject());
        helper.setTaskName(getTaskName());
        helper.setOwningTarget(getOwningTarget());
        helper.init();
    }

Cheers, --DD

-----Original Message-----
From: Klaus Petzold [mailto:califax@angelfire.com] 
Sent: Monday, February 03, 2003 9:58 AM
To: ant-user@jakarta.apache.org
Subject: Using ExecTask class

Hello.

I want to use the ExecTask class from my
own task. At the moment I do the following:
1) Create a new ExecTask instance (et).
2) Calling et.setProject(getProject()).
3) Calling et.createArg().setValue("blah").
4) Calling setExecutable("blub").
5) Calling et.execute().

The program does not properly start. When 
I execute it with
<exec executable="blub">
  <arg line="blah"/>
</exec>
(ie with the original ExecTask class)
it runs fine. What am I doing wrong, when
I create a ExecTask instance and setting its arguments?

Klaus Petzold



____________________________________________________________
Get 25MB of email storage with Lycos Mail Plus!
Sign up today -- http://www.mail.lycos.com/brandPage.shtml?pageId=plus 

---------------------------------------------------------------------
To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ant-user-help@jakarta.apache.org

Mime
View raw message