如何利用蚂蚁的contrib任务日食汽车内容辅助 [英] how to use ant-contrib tasks in eclipse auto content assist

查看:325
本文介绍了如何利用蚂蚁的contrib任务日食汽车内容辅助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Eclipse的木卫三和想使用自动内容助攻功能蚁。我有蚂蚁的contrib-1.0b3.jar 我。

什么样的​​配置,需要在Eclipse中使用自动辅助内容可以包括用于蚂蚁的contrib 呢?任务

当我用下面的蚂蚁可以识别蚂蚁的contrib任务,但内容辅助不起作用?

 <! - 定义类路径蚂蚁的contrib任务 - >
&所述;路径ID =ant.contrib.classpath>
    <文件集DIR =/路径/要/ lib中/>
        <包括姓名=蚂蚁的contrib-1.0b3.jar/>
    < /文件集>
< /路径><! - 任务定义 - >
<的taskdef资源=网/ SF / antcontrib / antcontrib.properties>
    <类路径REFID =ant.contrib.classpath/>
< /&的taskdef GT;


解决方案

请尝试以下操作。

据我了解,为Ant 1.6及更高版本,你需要引用antcontrib XML文件,而不是属性文件,像这样:

 <! - 任务定义 - >
<的taskdef资源=网/ SF / antcontrib / antlib.xml>
    <类路径REFID =ant.contrib.classpath/>
< /&的taskdef GT;

这是还详细介绍 这里

此外,在 preferences - >蚂蚁 - >编辑器 - >内容辅助检查为用户定义的任务建议检查像这样(这也是默认值):

如果上面两个都在地方,你应该得到如下图所示的内容辅助(这是从您的文章中code,唯一的区别是,已经取代了参考 antcontrib的.properties antlib.xml

更换参考特性制成Eclipse的靛蓝SR2(64位),我所有的不同的XML一个文件。

我检查,以确保此功能(内容协助用户定义的Ant任务)可以的至少的由于Eclipse 3.3。有在Ant编辑器中的性能问题在Eclipse 3.3具体涉及此功能,但同样也得到了解决。

I have Eclipse Ganymede and would like to use the auto content assist feature for ant. I have the ant-contrib-1.0b3.jar with me.

What configuration is required in eclipse to use auto content assist which can include tasks for ant-contrib as well?

When I use the following the ant can recognize tasks for ant-contrib but content assist doesn't work?

<!-- Define classpath for ant-contrib tasks -->
<path id="ant.contrib.classpath">
    <fileset dir="/path/to/lib/">
        <include name="ant-contrib-1.0b3.jar" />
    </fileset>
</path>

<!-- Task definition -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath refid="ant.contrib.classpath" />
</taskdef>

解决方案

Please try the following.

I understand that for Ant 1.6 and later you need to reference the antcontrib XML file instead of the properties file like so :

<!-- Task definition -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
    <classpath refid="ant.contrib.classpath" />
</taskdef>

This is also detailed here.

Besides that, in Preferences -> Ant -> Editor -> Content Assist check that Provide proposals for user defined tasks is checked like so (this is also the default) :

If both of the above are in place you should get the content assist as shown here (This is the code from your post, the only difference being, that have replaced the reference to antcontrib.properties with antlib.xml) :

Replacing the reference to the properties file with the xml one made all the difference for me on Eclipse Indigo SR2 (64 Bit).

I checked to make sure that this feature ( Content assist for user-defined ant tasks) is available at least since Eclipse 3.3. There were performance problems in the Ant Editor related specifically to this feature in Eclipse 3.3 but the same have since been resolved.

这篇关于如何利用蚂蚁的contrib任务日食汽车内容辅助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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