You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Raja Nagendra Kumar <Na...@tejasoft.com> on 2009/11/05 07:00:02 UTC

Feature Request - Executor setting though the script

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
-- 
View this message in context: http://old.nabble.com/Feature-Request---Executor-setting-though-the-script-tp26208582p26208582.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


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


Re: Feature Request - Executor setting though the script

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-11-06, Raja Nagendra Kumar <Na...@tejasoft.com> 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@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Feature Request - Executor setting though the script

Posted by Raja Nagendra Kumar <Na...@tejasoft.com>.
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.

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



-- 
View this message in context: http://old.nabble.com/Feature-Request---Executor-setting-though-the-script-tp26208582p26226565.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


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


Re: Feature Request - Executor setting though the script

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-11-05, Raja Nagendra Kumar <Na...@tejasoft.com> 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@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org