Browse Source

Rakefile : add logic if compiler isn't there

pull/14/head
David DeSandro 14 years ago
parent
commit
72ebb02427
  1. 7
      Rakefile

7
Rakefile

@ -2,12 +2,15 @@
# requires Google Closure Compiler http://code.google.com/closure/compiler/
# from command line run:
# rake min COMPILER='path/to/compiler.jar'
file compiler = ENV["COMPILER"] || '~/resources/google-closure/compiler.jar'
file compiler = ENV["COMPILER"] || '../../resources/google-closure/compiler.jar'
js = 'jquery.isotope.js'
min_js = 'jquery.isotope.min.js'
desc "Generates #{min_js}"
task :min do
unless File.exists?( compiler )
puts "ERROR: Compiler not found at " + compiler
else
puts "Minifying jquery.isotope.js..."
sh "java -jar #{compiler} --js #{js} --js_output_file #{min_js}"
# Adds header comment
@ -16,5 +19,5 @@ task :min do
f.write File.readlines( js )[0..9].join()
f.write min
end
end
end

Loading…
Cancel
Save