Skip to content

Commit

Permalink
Add coffee->js build rules
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvit committed Oct 22, 2011
1 parent 8bc353e commit f4b58ef
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ VERSION_FILES = %w(
src/connector.coffee
)

def coffee dst, src
sh 'coffee', '-c', '-b', '-o', File.dirname(dst), src
end

COFFEE.each do |coffee|
JS << (js = File.join('lib', File.basename(coffee).ext('js')))

file js => [coffee] do
coffee js, coffee
end
end

class JSModule
Expand Down Expand Up @@ -68,7 +76,7 @@ def subst_version_refs_in_file file, ver
end

file DIST => JS do

puts "CONCAT #{DIST}"
modules = {}
JS.each do |js|
mod = JSModule.new(js)
Expand Down Expand Up @@ -126,3 +134,4 @@ end
task :default => :build

CLOBBER << DIST
CLEAN.include *JS

0 comments on commit f4b58ef

Please sign in to comment.