forked from cppforlife/CedarShortcuts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (35 loc) · 965 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
37
38
39
40
41
PROJECT_NAME = "CedarShortcuts"
CONFIGURATION = "Release"
SDK_VERSION = "6.0"
def build_dir
File.join(File.dirname(__FILE__), "build").tap do |path|
Dir.mkdir(path) unless File.exists?(path)
end
end
def output_file(target)
File.join(build_dir, "#{target}.output")
end
def system_or_exit(cmd, stdout = nil)
cmd.gsub!("\n", "")
cmd += " > #{stdout}" if stdout
puts "Executing #{cmd}"
system(cmd) or raise "******** Build failed ********"
end
desc "Build & install"
task :install => :clean do
system_or_exit <<-BASH, output_file("install")
xcodebuild
-project #{PROJECT_NAME}.xcodeproj
-configuration #{CONFIGURATION}
install
BASH
end
desc "Uninstall"
task :uninstall do
plugins_dir = "~/Library/Application\\ Support/Developer/Shared/Xcode/Plug-ins"
system_or_exit "rm -rf #{plugins_dir}/#{PROJECT_NAME}.xcplugin"
end
desc "Clean"
task :clean do
system_or_exit "rm -rf #{build_dir}/*", output_file("clean")
end