是否可以从 javascript scriptdef 任务调用 ant 任务? [英] Is it possible to call ant task from a javascript scriptdef task?

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

问题描述

是否可以从 javascript scripdef 任务中调用同一 ant 脚本中的 ant 任务?

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

参考 Ant APIscript 任务的文档一>.

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

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

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