Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3c8583e

Browse files
imrehgIgorMinar
authored andcommitted
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).
1 parent 78699c6 commit 3c8583e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Rakefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,22 @@ def path_to(filename)
273273
end
274274

275275

276+
##
277+
# returns the 32-bit mode force flags for java compiler if supported, this makes the build much
278+
# faster
279+
#
280+
def java32flags
281+
return '-d32 -client' unless Rake::Win32.windows? || `java -version -d32 2>&1`.match(/Error/i)
282+
end
283+
284+
276285
def closure_compile(filename)
277286
puts "Minifying #{filename} ..."
278287

279288
min_path = path_to(filename.gsub(/\.js$/, '.min.js'))
280289

281290
%x(java \
282-
-client \
283-
-d32 \
291+
#{java32flags()} \
284292
-jar lib/closure-compiler/compiler.jar \
285293
--compilation_level SIMPLE_OPTIMIZATIONS \
286294
--language_in ECMASCRIPT5_STRICT \

0 commit comments

Comments
 (0)