title: How to use Google Closure compiler
body: <p>I'm trying to migrate from the closurebuilder.py script to the <a href="https://developers.google.com/closure/compiler/" rel="nofollow">Closure compiler</a> because of this message:</p>
  
  <pre><code>../../closure-library/closure/bin/build/closurebuilder.py: Closure Compiler now natively understands and orders Closure dependencies and
  </code></pre>
  
  <p>is prefererred over using this script for performing JavaScript compilation</p>
  
  <p>Since I'm using <a href="https://github.com/google/closure-library/" rel="nofollow">Google Closure Library</a> and the <a href="https://github.com/openlayers/ol3" rel="nofollow">OpenLayers 3</a>, how do I have to call the compiler (compiler.jar) to</p>
  
  <ul>
  <li>Build an myapp-deps.js dependency file</li>
  <li>Build an minified version myapp.js that includes only used OL3 and CL classes</li>
  <li>Build both with the usage of pre-calculated dependency files of OL3 and CL (e.g. ol3-deps.js)</li>
  </ul>
  
  <p>Let's further say everything is located in the following structure. This almost equals to my own project but it is to big and complex to be posted here directly.</p>
  
  <pre><code>project/
      src/
          js/
              &lt;some other js "required" in myapp.js&gt;
              myapp.js
              myapp-deps.js                 # This should be the dependency file
          lib/
              closure/goog/...
              third_party/closure/goog/...  
              myapp.js                      # This should be the minified version
      ol3/
  </code></pre>
  
  <p>I'm thankful for every hint.</p>