forked from bcylin/QuickTableViewController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
57 lines (46 loc) · 1.79 KB
/
Rakefile
File metadata and controls
57 lines (46 loc) · 1.79 KB
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
require "fileutils"
namespace :ci do
desc "Run tests with a specified scheme"
task :test, [:scheme] do |t, args|
scheme = args[:scheme]
unless scheme
puts "Usage: rake ci:test[scheme]"
next
end
sh %(xcodebuild -workspace QuickTableViewController.xcworkspace -scheme #{scheme} -sdk iphonesimulator -destination "name=iPhone 6,OS=latest" clean test | xcpretty -c && exit ${PIPESTATUS[0]})
exit $?.exitstatus if not $?.success?
end
desc "Build a target of specified scheme"
task :build, [:scheme] do |t, args|
scheme = args[:scheme]
unless scheme
puts "usage: rake ci:build[scheme]"
next
end
sh %(xcodebuild -workspace QuickTableViewController.xcworkspace -scheme #{scheme} -sdk iphonesimulator -destination "name=iPhone 6,OS=latest" clean build | xcpretty -c && exit ${PIPESTATUS[0]})
exit $?.exitstatus if not $?.success?
end
end
desc "Bump versions"
task :bump, [:version] do |t, args|
version = args[:version]
unless version
puts "Usage: rake bump[version]"
next
end
FileUtils.mv "QuickTableViewController.xcodeproj", "QuickTableViewController.tmp"
sh %(xcrun agvtool new-marketing-version #{version})
FileUtils.mv "QuickTableViewController.tmp", "QuickTableViewController.xcodeproj"
FileUtils.mv "Example.xcodeproj", "Example.tmp"
sh %(xcrun agvtool new-marketing-version #{version})
FileUtils.mv "Example.tmp", "Example.xcodeproj"
podspec = "QuickTableViewController.podspec"
text = File.read podspec
File.write podspec, text.gsub(%r(\"\d+\.\d+\.\d+\"), "\"#{version}\"")
puts "Updated #{podspec} to #{version}"
jazzy = ".jazzy.yml"
text = File.read jazzy
File.write jazzy, text.gsub(%r(:\s\d+\.\d+\.\d+), ": #{version}")
puts "Updated #{jazzy} to #{version}"
sh %(bundle exec pod install)
end