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

Commit 331f32d

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 bb80c96 commit 331f32d

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
@@ -292,14 +292,22 @@ def path_to(filename)
292292
end
293293

294294

295+
##
296+
# returns the 32-bit mode force flags for java compiler if supported, this makes the build much
297+
# faster
298+
#
299+
def java32flags
300+
return '-d32 -client' unless Rake::Win32.windows? || `java -version -d32 2>&1`.match(/Error/i)
301+
end
302+
303+
295304
def closure_compile(filename)
296305
puts "Minifying #{filename} ..."
297306

298307
min_path = path_to(filename.gsub(/\.js$/, '.min.js'))
299308

300309
%x(java \
301-
-client \
302-
-d32 \
310+
#{java32flags()} \
303311
-jar lib/closure-compiler/compiler.jar \
304312
--compilation_level SIMPLE_OPTIMIZATIONS \
305313
--language_in ECMASCRIPT5_STRICT \

0 commit comments

Comments
 (0)