aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGergely Imreh2012-12-16 16:48:22 +0800
committerIgor Minar2013-01-17 01:34:01 -0800
commit3c8583e5dd10ff356ac473f53e920fb10eb41571 (patch)
tree28b3f7c62011272566cc939fef46f27445501506
parent78699c62eae3874c5d7f8ab6ac6f67cd38aabc27 (diff)
downloadangular.js-3c8583e5dd10ff356ac473f53e920fb10eb41571.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--Rakefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index a3dc51aa..1b443e2b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -273,14 +273,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 \