是否有可能从一个javascript scriptdef任务调用Ant任务? [英] Is it possible to call ant task from a javascript scriptdef task?

查看:135
本文介绍了是否有可能从一个javascript scriptdef任务调用Ant任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能调用Ant任务就是在同一个Ant脚本从一个javascript scripdef任务?

Is it possible to call an ant task that is in the same ant script from a javascript scripdef task?

推荐答案

是的。情况下,你的意思的目标,而不是一个任务,这里有两个例子:

Yes. In case you meant target, rather than a task, here are examples of both:

<target name="test">
    <echo message="In test target" />
</target>

<scriptdef name="demo" language="javascript">
<![CDATA[
    self.project.executeTarget( "test" );

    var task = project.createTask( "echo" );
    task.setMessage( "In demo task" );
    task.perform( );
]]>
</scriptdef>

<demo />    

在运行,收益率:

test:
     [echo] In test target
     [echo] In demo task

有可能是来指蚂蚁的API 并为 剧本任务

It may be useful to refer to the Ant API and docs for the script task.

这篇关于是否有可能从一个javascript scriptdef任务调用Ant任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆