将 Google 闭包编译器与 Eclipse IDE 集成?

发布于 2024-09-11 05:44:04 字数 253 浏览 3 评论 0原文

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

孤城病女 2024-09-18 05:44:04

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

经过一些谷歌搜索,我也发现了这个,但还没有测试它: com/greggian/Eclipse-Closure-Compiler" rel="nofollow noreferrer">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>

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>
你对谁都笑 2024-09-18 05:44:04

尝试这些 Eclipse 插件:

用于闭包模板的 Eclipse 插件

用于带有闭包编译器和闭包库的 JavaScript 的 Eclipse 插件

http://www.normalesup.org/~simonet/soft/index.en.html

一切正常!

try these eclipse plugins:

Eclipse Plugin for Closure Templates

Eclipse Plugin for JavaScript with Closure Compiler and Closure Library

http://www.normalesup.org/~simonet/soft/index.en.html

everything works!

云裳 2024-09-18 05:44:04

播客提供了一些有关闭包编译器如何适合 IDE 的信息。但它是在关闭发布之前发布的。

This podcast has some info on how the closure compiler might fit into the IDE. But it was published before closure was released.

玩套路吗 2024-09-18 05:44:04

您可能对 http://plovr.com/ 感兴趣,这是一个 Closure 构建工具。它动态地重新编译 JavaScript 和闭包模板代码。

You might be interested in http://plovr.com/, a Closure build tool. It dynamically recompiles JavaScript and Closure Template code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文