Feature Request - Executor setting though the script

View: New views
4 Messages — Rating Filter:   Alert me  

Feature Request - Executor setting though the script

by Raja Nagendra Kumar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Instead of specifying the executor though ANT_OPTS is it possible to set the executor though the ant build.xml script.

In this approach of setting property ant executor etc.. (needed class path could also be set accrodingly like in taskdef) one could easily change the executor at build level or at each module level and do the custom pre and post target innovation.

Would like to have forum views on such feature.

We see such need for the reason of supporting virtual targets.. which are specific to each module. This approach can simplify a lot rather than one gaint executor which has info of each of the module and submodules.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

Re: Feature Request - Executor setting though the script

by Stefan Bodewig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-11-05, Raja Nagendra Kumar <Nagendra.Raja@...> wrote:

> Instead of specifying the executor though ANT_OPTS is it possible to set the
> executor though the ant build.xml script.

If you use a task at the top level, may work.  Setting the executor via
a task is a matter of invoking Project.setExecutor.

I'm not too familiar with Executor but it seems to be enough to simply
declare a reference with the correct name.  I.e. you don't even need a
custom task.

Something like

<typedef name="some-name" class="your.executor.here">
  <classpath location="if-necessary"/>
</typedef>
<some-name id="ant.executor"/>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Feature Request - Executor setting though the script

by Raja Nagendra Kumar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Woh..

Ant seems to have most of what we are looking for..
Your suggestion works.. small change was the name of the attribute was classname instead of class


<typedef name="TejaExecutor"
             classname="com.tejasoft.ant.TejaGlobalExecutor">
        <classpath>
            <path refid="cp.teja.ant"/>
        </classpath>
    </typedef>

<TejaExecutor id="ant.executor"/>

This takes care of it.

Stefan, when we supply it as ANT_ARGS, we used 'ant.executor.class' instead of 'ant.executor' .. Not sure why such difference..

Stefan, is this approach works with all other ANT_ARGS, such as -listener  etc.. if yes, could you let me know how to find the respective id name. Trying to get to know org.apache.tools.ant.Main better.

Basically we want to elinate any changes batch/sh files and put every thing in script so that we take advantage of platform independence of ant.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com



Re: Feature Request - Executor setting though the script

by Stefan Bodewig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-11-06, Raja Nagendra Kumar <Nagendra.Raja@...> wrote:

> Your suggestion works.. small change was the name of the attribute was
> classname instead of class

> <typedef name="TejaExecutor"
>     classname="com.tejasoft.ant.TejaGlobalExecutor">
> <classpath>
>    <path refid="cp.teja.ant"/>
> </classpath>
>     </typedef>

> <TejaExecutor id="ant.executor"/>

> This takes care of it.

Great.

> Stefan, when we supply it as ANT_ARGS, we used 'ant.executor.class'
> instead of 'ant.executor' .. Not sure why such difference..

ant.executor.class is the name of a property that can be used to specify
the executor implementation - but that approach doesn't give you control
over the classpath.

ant.executor is the name of the reference which holds the current
executor instance.  references and properties are two different concepts
and don't share the same namespace.  You can't define references on the
command line.

> is this approach works with all other ANT_ARGS, such as -listener

in general: no.  I don't think we actually provide a built-in way to
attach build listeners from inside the build file.  But it isn't that
hard to do, the record task or Jan's autoconf work do so, for example.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...