forked from airbnb/lottie-spm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
71 lines (61 loc) · 2.53 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
namespace :build do
desc 'Builds the Lottie example app'
namespace :example do
desc 'Builds the Example apps for all supported platforms / architectures. Requires valid code signing.'
task all: ['iOS:simulator', 'iOS:device', 'macOS:arm64', 'macOS:x86_64', 'macCatalyst:arm64', 'macCatalyst:x86_64']
desc 'Builds the Example app for platforms / architectures supported by Github Actions CI'
task github_actions: ['iOS:simulator', 'macOS:x86_64']
namespace :iOS do
task :simulator do
xcodebuild('build -scheme "Example (iOS)" -destination "platform=iOS Simulator,name=iPhone 8" -workspace Example/Example.xcworkspace')
end
task :device do
xcodebuild('build -scheme "Example (iOS)" -destination generic/platform=iOS -workspace Example/Example.xcworkspace')
end
end
namespace :macOS do
task :arm64 do
xcodebuild('build -scheme "Example (macOS)" -destination "platform=macOS,arch=arm64" -workspace Example/Example.xcworkspace')
end
task :x86_64 do
xcodebuild('build -scheme "Example (macOS)" -destination "platform=macOS,arch=x86_64" -workspace Example/Example.xcworkspace')
end
end
namespace :macCatalyst do
task :arm64 do
xcodebuild('build -scheme "Example (iOS)" -destination "platform=macOS,variant=Mac Catalyst,arch=arm64" -workspace Example/Example.xcworkspace')
end
task :x86_64 do
xcodebuild('build -scheme "Example (iOS)" -destination "platform=macOS,variant=Mac Catalyst,arch=x86_64" -workspace Example/Example.xcworkspace')
end
end
end
end
namespace :test do
desc 'Tests the Lottie package for supported platforms'
namespace :package do
desc 'Tests the Lottie package for all supported platforms'
task all: ['iOS', 'macOS', 'tvOS']
desc 'Tests the Lottie package for iOS'
task :iOS do
xcodebuild('test -scheme Lottie -destination "platform=iOS Simulator,name=iPhone 8"')
end
desc 'Tests the Lottie package for macOS'
task :macOS do
xcodebuild('test -scheme Lottie -destination platform=macOS')
end
desc 'Tests the Lottie package for tvOS'
task :tvOS do
xcodebuild('test -scheme Lottie -destination "platform=tvOS Simulator,name=Apple TV"')
end
end
end
def xcodebuild(command)
# Check if the mint tool is installed -- if so, pipe the xcodebuild output through xcbeautify
`which mint`
if $?.success?
sh "set -o pipefail && xcodebuild #{command} | mint run thii/[email protected]"
else
sh "xcodebuild #{command}"
end
end