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

Rakefile: closure_compile force 32bit mode only when java supports it #1719

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,24 @@ def path_to(filename)
end


##
# returns the 32-bit mode force flag for java compiler if supported
#
def java32flag
void = Rake::Win32.windows? ? 'NUL' : '/dev/null'
testcmd = "java -d32 -version >>#{void} 2>&1"
return system(testcmd) ? '-d32' : ''
end


def closure_compile(filename)
puts "Minifying #{filename} ..."

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

%x(java \
-client \
-d32 \
#{java32flag()} \
-jar lib/closure-compiler/compiler.jar \
--compilation_level SIMPLE_OPTIMIZATIONS \
--language_in ECMASCRIPT5_STRICT \
Expand Down