-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
43 lines (35 loc) · 1.31 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
task :default => :build
desc "build files required to run app"
task :build => ["erlang:compile", "erlang:app", "erlang:ruby", "erlang:rackup"]
namespace :erlang do
ERL_SRC = FileList["src/**/*.erl"]
BEAM_OUT = ERL_SRC.sub(/src/, 'ebin').sub(/\.erl$/, '.beam')
desc "compile erlang source files in /src into beam files in /ebin"
task :compile => BEAM_OUT
rule(/\.beam$/ => [proc {|beam| beam.sub(/ebin/, 'src').sub(/\.beam$/, '.erl')}]) do |beam|
erlc = "erlc -W -I ./include +debug_info -o ./ebin #{beam.source}"
puts erlc
sh erlc
end
APP_SRC = FileList["src/**/*.app"]
APP_OUT = APP_SRC.sub(/src/, 'ebin')
desc "copy app files from src to ebin"
task :app => APP_OUT
rule(/ebin\/.+\.app/ => [proc{|app| app.sub(/ebin/, 'src')}]) do |app|
copy app.source, app.name
end
RUBY_SRC = FileList["src/**/*.rb"]
RUBY_OUT = RUBY_SRC.sub(/src/, 'ebin')
desc "copy ruby files from src to ebin"
task :ruby => RUBY_OUT
rule(/ebin\/.+\.rb/ => [proc{|rb| rb.sub(/ebin/, 'src')}]) do |rb|
copy rb.source, rb.name
end
RACKUP_SRC = FileList["src/**/*.ru"]
RACKUP_OUT = RACKUP_SRC.sub(/src/, 'ebin')
desc "copy rackup files from src to ebin"
task :rackup => RACKUP_OUT
rule(/ebin\/.+\.ru/ => [proc{|ru| ru.sub(/ebin/, 'src')}]) do |ru|
copy ru.source, ru.name
end
end