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/ # requires Google Closure Compiler http://code.google.com/closure/compiler/
# from command line run: # from command line run:
# rake min COMPILER='path/to/compiler.jar' # 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' js = 'jquery.isotope.js'
min_js = 'jquery.isotope.min.js' min_js = 'jquery.isotope.min.js'
desc "Generates #{min_js}" desc "Generates #{min_js}"
task :min do task :min do
unless File.exists?( compiler )
puts "ERROR: Compiler not found at " + compiler
else
puts "Minifying jquery.isotope.js..." puts "Minifying jquery.isotope.js..."
sh "java -jar #{compiler} --js #{js} --js_output_file #{min_js}" sh "java -jar #{compiler} --js #{js} --js_output_file #{min_js}"
# Adds header comment # Adds header comment
@ -17,4 +20,4 @@ task :min do
f.write min f.write min
end end
end end
end
Loading…
Cancel
Save