Question

I'm using Closure Compiler in my application. For the moment, I use XML to send my javascript to the CC's web service and compile the code. What I want to do is include CC into the project itself so that the compilation doesn't rely on the web service but is done entirely on the server. How do you include the .jar files that are downloaded in the CC download package and make it work in .net?

Thanks.

Was it helpful?

Solution

The simplest solution is just to put the CC folder on that server and then add it's path to your $PATH. Another option is to add it as a resource in the project and then set Copy to Output Dir to Always or If Newer and use a relative path to access it. I believe the second option is better because it removes the outside dependency.

Once you have the file there you can start a command line process with the commands like they have in the docs java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js and it will do what you want. There is of course also a Java dependency. For some basic info on starting process' in C# check out http://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top