@@ -40,16 +40,15 @@ namespace :carthage do
4040 end
4141end
4242
43- namespace :swiftlint do
44- desc "Install SwiftLint from pkg"
45- task :install do
46- next if system ( 'which swiftlint >/dev/null' )
47- install_pkg ( 'https://github.com/realm/SwiftLint/releases/download/0.26.0/SwiftLint.pkg' )
43+ namespace :demo do
44+ desc "Builds the ReusableDemo app for iOS using xcodebuild."
45+ task :ios do |t , args |
46+ xcodebuild ( scheme : 'ReusableDemo iOS' , sdk : 'iphonesimulator' , destination : DESTINATIONS [ :ios_sim ] )
4847 end
4948
50- desc "Run SwiftLint on the source code "
51- task :run do
52- run ( 'swiftlint lint --strict' , xcpretty : false )
49+ desc "Builds the ReusableDemo app for tvOS using xcodebuild. "
50+ task :tvos do | t , args |
51+ xcodebuild ( scheme : 'ReusableDemo tvOS' , sdk : 'appletvsimulator' , destination : DESTINATIONS [ :tvos_sim ] )
5352 end
5453end
5554
@@ -65,23 +64,38 @@ namespace :fmk do
6564 end
6665end
6766
68- namespace :demo do
69- desc "Builds the ReusableDemo app for iOS using xcodebuild. "
70- task :ios do |t , args |
71- xcodebuild ( scheme : 'ReusableDemo iOS' , sdk : 'iphonesimulator' , destination : DESTINATIONS [ :ios_sim ] )
67+ namespace :pod do
68+ desc "Lints the Reusable.podspec "
69+ task :lint do |t |
70+ run ( "pod lib lint --allow-warnings --quick" , xcpretty : false )
7271 end
72+ end
7373
74- desc "Builds the ReusableDemo app for tvOS using xcodebuild."
75- task :tvos do |t , args |
76- xcodebuild ( scheme : 'ReusableDemo tvOS' , sdk : 'appletvsimulator' , destination : DESTINATIONS [ :tvos_sim ] )
74+ namespace :spm do
75+ desc 'Build using SPM'
76+ task :build do |task |
77+ Utils . print_header 'Compile using SPM'
78+ Utils . run ( 'swift build' , task , xcrun : true )
79+ end
80+
81+ desc 'Run SPM Unit Tests'
82+ task :test => :build do |task |
83+ Utils . print_header 'Run the unit tests using SPM'
84+ Utils . run ( 'swift test' , task , xcrun : true )
7785 end
7886end
7987
80- # TODO: "namespace :test" once we have Unit Tests
88+ namespace :swiftlint do
89+ desc "Install SwiftLint from pkg"
90+ task :install do
91+ next if system ( 'which swiftlint >/dev/null' )
92+ install_pkg ( 'https://github.com/realm/SwiftLint/releases/download/0.26.0/SwiftLint.pkg' )
93+ end
8194
82- namespace :pod do
83- desc "Lints the Reusable.podspec"
84- task :lint do |t |
85- run ( "pod lib lint --allow-warnings --quick" , xcpretty : false )
95+ desc "Run SwiftLint on the source code"
96+ task :run do
97+ run ( 'swiftlint lint --strict' , xcpretty : false )
8698 end
8799end
100+
101+ # TODO: "namespace :test" once we have Unit Tests
0 commit comments