-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
36 lines (30 loc) · 824 Bytes
/
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
require 'rubygems' # Necessary for Ruby 1.8 (1.9 loads rubygems by default)
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/RubyServer')
require 'rake'
require 'json_server'
desc "Start server and client then wait for exchange completion"
task :run => [:server, :client, :wait]
desc "Start server and client then wait for exchange completion"
task :default => [:build, :run]
desc "Start Ruby JSON server"
task :server do
@server = JSONServer.new
@server.start
end
desc "Build Qt JSON client"
task :build do
FileUtils.cd("QtClient") do
sh "make"
end
end
desc "Start Qt JSON client"
task :client do
@client_thread = Thread.new do
system "./QtClient/JSONClient"
end
end
desc "Wait for server and client to shutdown"
task :wait do
@client_thread.join
@server.wait_for_completion
end