forked from sharplet/Regex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
78 lines (64 loc) · 2.01 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require_relative "lib/suite_task"
desc "Set up the project for development"
task :setup do
sh "carthage bootstrap --no-build"
end
namespace :build do
desc "Build for all platforms"
suite :all => [:pod, :framework, :package]
desc "Build and validate the podspec"
task :pod do
sh "pod lib lint *.podspec --quick --no-clean"
end
desc "Build the framework"
task :framework do
sh "carthage build --no-skip-current"
end
desc "Build the Swift package"
task :package do
if ENV["TRAVIS"] == "true"
puts "warning: Skipping swift build while Swift 3 is in development"
next
end
sh "swift build"
end
end
desc "Run swiftlint if available"
task :swiftlint do
system "which -s swiftlint" and exec "swiftlint"
end
desc "Clean built products"
task :clean do
Dir["build/", "Carthage/Build/*/Regex.framework*"].each do |f|
rm_rf(f)
end
sh "swift build --clean"
end
namespace :test do
def pretty(cmd)
if system("which -s xcpretty")
sh("/bin/sh", "-o", "pipefail", "-c", "env NSUnbufferedIO=YES #{cmd} | xcpretty")
else
sh(cmd)
end
end
desc "Run tests on OS X"
task :osx do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-OSX"
end
desc "Run tests on iOS Simulator"
task :ios do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-iOS -destination 'platform=iOS Simulator,name=iPhone 6s'"
end
desc "Run tests on tvOS Simulator"
task :tvos do
pretty "xcodebuild build-for-testing test-without-building -workspace Regex.xcworkspace -scheme Regex-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p'"
end
desc "Build for watchOS Simulator"
task :watchos do
pretty "xcodebuild build -workspace Regex.xcworkspace -scheme Regex-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm'"
end
end
desc "Run all tests"
task :test => ["test:osx", "test:ios", "test:tvos", "test:watchos"]
task :default => :test