views:

37

answers:

1

How to make teamcity and/or TFS 2010 to run closure compiler for js files in a project. There are 2 reasons for using closure compiler:

  1. error/warning detection

  2. js minification/obfuscation - optional

+1  A: 

We use rake builds and TeamCity. It calls closure to compile and minify all of our javascript as part of packaging for installers.

Its pretty simple in rake to do this, just use sh to do somethinj like:

sh "java -jar #{JS_TOOLS_DIR}/google-closure.jar --js=#{js_file} --js_output_file=#{min_file} " + "--warning_level QUIET --compilation_level WHITESPACE_ONLY"
James Summerton
Seems like a valid answer to me, however, i found out a different way to do it: recent versions of closure-compiler contain built-in ant task. And teamcity can easily run ant tasks - main problem for me now is that it can run as a separate project only.
bushed