-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
37 lines (27 loc) · 983 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
task :default => [:lint_podspec, :run_tests]
task :lint_podspec do
sh("#{LINT_TOOL} #{LINT_FLAGS}")
end
task :run_tests_ios => [:clean] do
sh("#{BUILD_TOOL} #{BUILD_FLAGS_TEST_IOS} | #{PRETTIFY}")
end
task :clean do
sh("rm -rf '#{DERIVED_DATA_PATH}'")
end
task :run_tests => [:run_tests_ios]
private
LIBRARY_NAME = 'OHMKit'
TARGET_NAME = 'ObjectMapping'
PROJECT_PATH = "ObjectMapping/#{LIBRARY_NAME}.xcodeproj"
PODSPEC_PATH = "#{LIBRARY_NAME}.podspec"
DERIVED_DATA_PATH = "#{ENV['HOME']}/Library/Developer/Xcode/DerivedData"
DESTINATION = 'platform=iOS Simulator,name=iPhone 4s,OS=latest'
LINT_TOOL = 'bundle exec pod lib lint'
BUILD_TOOL = 'xcodebuild'
LINT_FLAGS = "#{PODSPEC_PATH}"
BUILD_FLAGS =
"-project '#{PROJECT_PATH}' "\
"-derivedDataPath '#{DERIVED_DATA_PATH}'"
BUILD_FLAGS_IOS = BUILD_FLAGS + " -destination '#{DESTINATION}'"
BUILD_FLAGS_TEST_IOS = "test -scheme '#{TARGET_NAME}' " + BUILD_FLAGS_IOS
PRETTIFY = "xcpretty --color; exit ${PIPESTATUS[0]}"