-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
45 lines (37 loc) · 1.05 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
44
45
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'rake/clean'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
['Client', 'Server'].each do |name|
dir = "lib/rake/subproject/#{name.downcase}"
directory dir
CLEAN.include dir
FileList["resources/network/*.rb"].each do |path|
file "#{dir}/#{File.basename(path)}" => "lib/rake/subproject/#{name.downcase}" do |t|
print "creating #{t.name}\n"
File.open(t.name, 'w') do |f|
f.puts <<END
module Rake::Subproject
module #{name} #:nodoc: all
#{File.read(path)} end
end
END
end
end
namespace :build do
task :library => "#{dir}/#{File.basename(path)}"
end
CLEAN.include "#{dir}/#{File.basename(path)}"
end
end
file "lib/rake/subproject/server/task.rb" => ["resources/server_task.rb", "lib/rake/subproject/server"] do |t|
cp t.prerequisites.first, t.name
end
namespace :build do
task :library => "lib/rake/subproject/server/task.rb"
end
task :build => 'build:library'
task :test => :'build:library' do
sh 'rspec', verbose: false
end