diff options
| author | Gergely Imreh | 2012-12-16 16:48:22 +0800 |
|---|---|---|
| committer | Igor Minar | 2013-01-17 10:44:39 -0800 |
| commit | 331f32deac503722e5c1060ba095f7b6d8ebe91b (patch) | |
| tree | fbe9306580904abd3ee644a7af2368a6e88d25c7 | |
| parent | bb80c96754f8bce404e959338d096a15959f815a (diff) | |
| download | angular.js-331f32deac503722e5c1060ba095f7b6d8ebe91b.tar.bz2 | |
chore(Rakefile): force 32bit JVM mode only when java supports it
Some Java installs don't have '-d32' flag (e.g. OpenJDK which is standard
for some Linux systems), and the closure_compile fails because of forcing
that flag. Test, and only run in faster 32bit mode if supported, or
else just run with no flag (default mode).
| -rw-r--r-- | Rakefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -292,14 +292,22 @@ def path_to(filename) end +## +# returns the 32-bit mode force flags for java compiler if supported, this makes the build much +# faster +# +def java32flags + return '-d32 -client' unless Rake::Win32.windows? || `java -version -d32 2>&1`.match(/Error/i) +end + + def closure_compile(filename) puts "Minifying #{filename} ..." min_path = path_to(filename.gsub(/\.js$/, '.min.js')) %x(java \ - -client \ - -d32 \ + #{java32flags()} \ -jar lib/closure-compiler/compiler.jar \ --compilation_level SIMPLE_OPTIMIZATIONS \ --language_in ECMASCRIPT5_STRICT \ |
