DCSIMG
Calling the Google Closure Javascript Compiler - Code - .NET Geek

.NET Geek

"It is upon the Trunk that a gentleman works" - Confucius

Calling the Google Closure Javascript Compiler - Code

Here’s a follow-up to the last post that contained a few screenshots showing the integration of the Google Closure Javascript compiler in Visual Studio.

Since I said in the last post that I would make the source available if there was interest, I’m doing that now.

The project structure is as following

solution struct

All of the code for accessing the compilation service is in the GoogleClosure project. Initially I didn’t have a Winform project. I split the projects for this post, realizing that some people interested in the code might not have CodeRush.

The GoogleClosure project also contains the UI in a user control. As such, there was no code to be written in neither the VS plugin or in the Winform application. Placing the user control from the GoogleClosure project is enough.

About the code: The code was written in brain-storming mode. As such, I won’t stand to trial for any best-practice not followed or any shortcut taken. ;-)
Seriously though, there’s not a lot of code here. In essence, the Compilation namespace in the GoogleClosure project, contains classes that maps to the compiler service results and options. The ClosureCompilerService class is doing all the communcation with the service. The compiler service can return its results in XML, JSON and text. I implemented only parsing of the XML results which is simple in .Net using Linq2Xml.

P.S (The “CR_” naming convention is common for CodeRush plugins.)

You can download the source code here.

Shout it

Comments

Integrating Google Javascript Compiler in Visual Studio - .NET Geek said:

Pingback from  Integrating Google Javascript Compiler in Visual Studio - .NET Geek

# November 10, 2009 5:42 PM

Charles said:

If you just want to quickly grab the output of a compiler call i made www.closureoptimizer.com this morning ...

# November 10, 2009 5:52 PM

Reflective Perspective - Chris Alcock » The Morning Brew #474 (the real 474) said:

Pingback from  Reflective Perspective - Chris Alcock  » The Morning Brew #474 (the real 474)

# November 11, 2009 10:35 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: