Integrate Google closure compiler with Eclipse IDE?

11,028

Solution 1

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>

Solution 2

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!

Solution 3

you could use ant tasks for this http://code.google.com/p/closure-compiler/wiki/BuildingWithAnt

Solution 4

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

Solution 5

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

Share:
11,028

Related videos on Youtube

Borivojević
Author by

Borivojević

Updated on April 05, 2020

Comments

  • Borivojević
    Borivojević about 4 years

    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?

  • Magnetic_dud
    Magnetic_dud over 12 years
    too bad for the hijacked domain :(
  • firepol
    firepol over 11 years
    Rock Star Apps can't be found anymore because of the hijacked domain, but you can still manually download and install the zip. I just followed this post instructions and it worked: blog.avirtualhome.com/rockstarapps-for-eclipse
  • uchuugaka
    uchuugaka about 7 years
    You should update your post properly to remove the bad URL. It now hosts a site trying to trick people into downloading suspicious "FlashPlayer" updates...