-
Notifications
You must be signed in to change notification settings - Fork 10
/
Rakefile
64 lines (49 loc) · 1.13 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'xcoder/rake_task'
require 'open4'
class String
def self.colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red
self.class.colorize(self, 31);
end
def green
self.class.colorize(self, 32);
end
def yellow
self.class.colorize(self, 33);
end
def cyan
self.class.colorize(self, 36);
end
end
class Runner
def self.instance
@instance ||= Runner.new
end
def execute(title, command)
puts title.green
status = Open4::popen4(command) do |pid, stdin, stdout, stderr|
stderr.each_line do |line|
puts line.red
end
end
return status.exitstatus
end
end
namespace :tools do
desc "Setup project for development"
task :setup do
Runner.instance.execute("Loading git submodules...", "git submodule update --init --recursive")
puts "\nComplete.".green
end
end
namespace :build do
desc "Build Sample"
task :sample do
config = Xcode.project('JJAFAcceleratedDownloadRequestOperation-Sample').target('JJAFAcceleratedDownloadRequestOperation-Sample').config(:Debug)
builder = config.builder
builder.clean
builder.build :sdk => :iphonesimulator
end
end