Source

SpinorNetwork / Rakefile

Full commit
# encoding = utf-8

desc 'compile SCSS.'
task :scss do
  style_dir = 'public/styles'
  compressor_path = '_resources/yuicompressor-2.4.7.jar'
  Dir["#{style_dir}/*.scss"].each do |filename|
    basename = "#{style_dir}/#{File.basename filename, '.scss'}"
    sh "sass #{filename} #{basename}.css; " +
       "java -jar #{compressor_path} -o #{basename}.min.css #{basename}.css"
  end
end

desc 'compile JS by Google ClosureCompiler.'
task :js do
  script_dir = 'public/scripts'
  compiler_path = '_resources/compiler.jar'
  ['barnner', '../game/Sp2game'].each do |name|
    sh "java -jar #{compiler_path} --compilation_level SIMPLE_OPTIMIZATIONS --js #{script_dir}/#{name}.js --js_output_file #{script_dir}/#{name}.min.js "
  end
end

task :default => [:scss]