在Google闭包编译器Ant构建中使用通配符

在Google闭包编译器Ant构建中使用通配符,ant,google-closure-compiler,Ant,Google Closure Compiler,是否可以使用通配符选择多个文件,而不是使用标记指定每个文件 目前我正在这样做: <jscomp compilationLevel="simple" debug="false" output="build.js"> <sources dir="${basedir}/source"> <file name="foo.js" /> <file name="bar.js" /> </sources>

是否可以使用通配符选择多个文件,而不是使用
标记指定每个文件

目前我正在这样做:

<jscomp compilationLevel="simple" debug="false" output="build.js">
    <sources dir="${basedir}/source">
        <file name="foo.js" />
        <file name="bar.js" />
    </sources>
</jscomp>

我尝试使用
,但
不支持:

<jscomp compilationLevel="simple" debug="false" output="build.js">
    <sources dir="${basedir}">
        <fileset dir="source">
            <include name="**/*.js" />
        </fileset>
    </sources>
</jscomp>

查看我相信(未测试)它支持Ant
路径
作为它最初支持的
文件列表
的替代方案。A添加此项。有人试图将文件列表更改为文件集,但问题是文件集没有排序

根据提交的补丁,您可以这样做。此示例显示了正在使用的文件列表和文件集的混合:

<path id="ui.js.fileset">
    <fileset dir="source">
        <include name="**/*.js" />
    </fileset>
</path>

<path id="app.js.fileset">
    <filelist dir="${js.dir}/app/">
        <file name="app.core.js"/>
        <file name="app.foo.js"/>
    </filelist>
    <path refid="ui.js.fileset" />
</path>

<jscomp compilationLevel="simple" debug="false" output="build.js">
    <path refid="app.js.fileset" />
</jscomp>


似乎还没有更新以反映此选项的可用性,但它确实说“偶尔会添加新功能,任务的源文件可能是最好的文档。”

您能发布完整的XML吗?抱歉延迟!我原以为我找到了,但我从补丁页面上找到了错误的代码片段——刚刚在上面编辑过。通常我会在发布前测试一个解决方案,但我没有安装闭包编译器,因此我无法确认上面的方法是否有效,但我相信它会有效。为了确认,我测试了这个方法和嵌套的