forked from probablycorey/wax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile
42 lines (33 loc) · 1.27 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
WAX_FILES = FileList["*"].exclude(/^(examples|xcode-template|framework|tools)/)
TARGET_XCODE_TEMPLATE = "#{ENV['HOME']}/Library/Application Support/Developer/Shared/Xcode/Project Templates/Wax/Wax iPhone App"
WAX_ROOT = File.expand_path("..", __FILE__)
task :default => :install
desc "Install wax xcode templates"
task :install => "template:create"
namespace :template do
task :create => :clean do
mkdir_p File.dirname(TARGET_XCODE_TEMPLATE)
cp_r "xcode-template", TARGET_XCODE_TEMPLATE
# Copy the wax files into the template
template_wax_path = "#{TARGET_XCODE_TEMPLATE}/wax"
mkdir_p template_wax_path
cp_r WAX_FILES, template_wax_path
`chmod +x "#{TARGET_XCODE_TEMPLATE}/wax/lib/build-scripts/copy-scripts.sh"`
# Create the default run script
puts
puts "Wax Xcode Template Installed!"
puts "-----------------------------"
puts
end
desc "Prepare xcode template for editing"
task :edit => :clean do
ln_s WAX_ROOT, "xcode-template/wax"
`open xcode-template/___PROJECTNAME___.xcodeproj`
end
desc "Cleans up xcode template for packaging"
task :clean do
rm_r File.dirname(TARGET_XCODE_TEMPLATE), :force => true
rm_r "xcode-template/wax", :force => true
rm_r "xcode-template/build", :force => true
end
end