什么是嵌套的路径和文件集之间的区别? [英] What's the difference between a nested path and fileset?

查看:257
本文介绍了什么是嵌套的路径和文件集之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Google的文章文件集和路径之间的差异了一段时间,但没有发现任何有用的。
例如,什么是以下之间的差异(比如,有一个 someDir 目录,其中包含.jar文件,也没有子目录):

I have been googling for the "Differences between fileset and path" article for some time, but have found nothing useful. For example, what is the difference between the following (say, there is a someDir directory, which contains .jar files and has no subdirectories):

<path id="somePathId">
    <pathelement path="someDir"/>
</path>

<path id="someId">
  <path refid="somePathId" />
</path>

<path id="someId">
  <fileset dir="someDir">
     <include name="*.*">
  </fileset>
</path>

推荐答案

他们在不同情况下使用。

They are used in different situations.

文件集用于指定一组文件。您可以使用选择 patternset s到只得到你想要的文件。

fileset is used to specify a group of files. You can use selectors and patternsets to get only the files you want.

的classpath 用于指定类路径引用。 的classpath 可以用一个罐子(​​位置=...),一个; 或分离罐的列表(路径=...)或嵌套的资源集合(如文件集)。

classpath is used to specify classpath references. classpath can be specified with a single jar (location="..."), a ; or : separated list of jars (path="...") or with nested resource collections (like fileset).

此外,如果你想调试它们,它是不同的:

Also if you want to debug them, it is different:

<echo message="Build-path: ${toString:build-path}" />

VS

<property name="debug.classpath" refid="classpath"/>
<echo message="Classpath = ${debug.classpath}"/>

至于你的脚本,

<path id="somePathId">
    <pathelement location="someDir"/>
</path>

我没有测试,但根据文档 PATH = 需要一个; 分离罐的列表。这是不一样的第二个例子。

I did not test it but according to the documentation path= expects a ; or : separated list of jars. This is not the same as your second example.

这篇关于什么是嵌套的路径和文件集之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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