将Google封闭编译器与Eclipse IDE集成在一起?

Bor*_*vić 17 eclipse minify google-closure-compiler

有人知道如何将Google封闭编译器与Eclipse IDE集成吗?我试图做的是将Google封闭编译器配置为Eclipse IDE的外部工具.然后我就可以在IDE中运行闭包编译器并通过单击缩小我的Javascript文件.有人解决了这个问题吗?

jac*_*cnr 12

Rock Star Apps提供了一个鲜为人知的插件.我刚刚写了一篇关于它的博客文章:[已删除,因为不再存在].

经过一些谷歌搜索,我也找到了这个,但没有测试过它:https://github.com/greggian/Eclipse-Closure-Compiler.

更新:Rock Star Apps网站不再有效.如果我今天尝试这样做,我肯定会下载闭包编译器jar,编写一个ant脚本来运行它(类似下面的代码),然后为它创建一个项目构建器.

<target name="rebuild">

    <taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask"
            classpath="/opt/closure-compiler/compiler.jar"/>

    <jscomp compilationLevel="simple" warning="quiet" 
        debug="false" output="js/all.closure.js">
        <sources dir="js">
            <file name="script1.js"/>
            <file name="script2.js"/>
            <file name="script3.js"/>
            <file name="script4.js"/>
            <file name="script5.js"/>
            <file name="script6.js"/>
        </sources>
    </jscomp>

</target>
Run Code Online (Sandbox Code Playgroud)