将Google关闭编译器与Eclipse IDE集成在一起? [英] Integrate Google closure compiler with Eclipse IDE?

查看:173
本文介绍了将Google关闭编译器与Eclipse IDE集成在一起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何整合 Google关闭编译器与Eclipse IDE?我试图做的是将Google封闭编译器配置为Eclipse IDE的外部工具。然后我可以在IDE中运行闭包编译器,并通过单击来简化我的Javascript文件。
有人解决了这个问题吗?

解决方案

Rock Star应用程序提供了一个有名的插件这个。我刚刚写了一篇博客文章:[删除不再存在]



经过一些搜索,我也发现了这一点, t测试: https://github.com/greggian/Eclipse-Closure-Compiler



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

  target name =rebuild> 

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

< jscomp compilationLevel =simplewarning =quiet
debug =falseoutput =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>


Does anybody know how to integrate Google closure compiler with Eclipse IDE? The thing I was trying to do is to configure Google closure compiler as a external tool for Eclipse IDE. Then I would be able to run closure compiler within IDE and minify my Javascript files with single click. Have anybody solved this problem yet?

解决方案

Rock Star Apps provide a little-known plugin which does this. I just wrote a blog article on it: [removed as doesn't exist anymore].

After some googling, I also found this, but haven't tested it: https://github.com/greggian/Eclipse-Closure-Compiler.

Update: the Rock Star Apps site no longer works. Were I to try to do this today, I would definitely just download the closure compiler jar, write an ant script to run it (something like the code below), and then create a project builder for it.

<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>

这篇关于将Google关闭编译器与Eclipse IDE集成在一起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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