-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
227 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
source 'https://rubygems.org' | ||
|
||
gem 'cocoapods', '1.2.0' | ||
gem 'xcpretty' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (2.3.5) | ||
activesupport (4.2.8) | ||
i18n (~> 0.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
claide (1.0.1) | ||
cocoapods (1.2.0) | ||
activesupport (>= 4.0.2, < 5) | ||
claide (>= 1.0.1, < 2.0) | ||
cocoapods-core (= 1.2.0) | ||
cocoapods-deintegrate (>= 1.0.1, < 2.0) | ||
cocoapods-downloader (>= 1.1.3, < 2.0) | ||
cocoapods-plugins (>= 1.0.0, < 2.0) | ||
cocoapods-search (>= 1.0.0, < 2.0) | ||
cocoapods-stats (>= 1.0.0, < 2.0) | ||
cocoapods-trunk (>= 1.1.2, < 2.0) | ||
cocoapods-try (>= 1.1.0, < 2.0) | ||
colored (~> 1.2) | ||
escape (~> 0.0.4) | ||
fourflusher (~> 2.0.1) | ||
gh_inspector (~> 1.0) | ||
molinillo (~> 0.5.5) | ||
nap (~> 1.0) | ||
ruby-macho (~> 0.2.5) | ||
xcodeproj (>= 1.4.1, < 2.0) | ||
cocoapods-core (1.2.0) | ||
activesupport (>= 4.0.2, < 5) | ||
fuzzy_match (~> 2.0.4) | ||
nap (~> 1.0) | ||
cocoapods-deintegrate (1.0.1) | ||
cocoapods-downloader (1.1.3) | ||
cocoapods-plugins (1.0.0) | ||
nap | ||
cocoapods-search (1.0.0) | ||
cocoapods-stats (1.0.0) | ||
cocoapods-trunk (1.1.2) | ||
nap (>= 0.8, < 2.0) | ||
netrc (= 0.7.8) | ||
cocoapods-try (1.1.0) | ||
colored (1.2) | ||
escape (0.0.4) | ||
fourflusher (2.0.1) | ||
fuzzy_match (2.0.4) | ||
gh_inspector (1.0.3) | ||
i18n (0.8.1) | ||
minitest (5.10.1) | ||
molinillo (0.5.6) | ||
nanaimo (0.2.3) | ||
nap (1.1.0) | ||
netrc (0.7.8) | ||
rouge (1.11.1) | ||
ruby-macho (0.2.6) | ||
thread_safe (0.3.6) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
xcodeproj (1.4.2) | ||
CFPropertyList (~> 2.3.3) | ||
activesupport (>= 3) | ||
claide (>= 1.0.1, < 2.0) | ||
colored (~> 1.2) | ||
nanaimo (~> 0.2.3) | ||
xcpretty (0.2.4) | ||
rouge (~> 1.8) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
cocoapods (= 1.2.0) | ||
xcpretty | ||
|
||
BUNDLED WITH | ||
1.13.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,39 @@ | ||
# Used constants: | ||
# - WORKSPACE | ||
|
||
namespace :lint do | ||
desc 'Install swiftlint' | ||
task :install do |task| | ||
if !system('which swiftlint > /dev/null') | ||
url = 'https://github.com/realm/SwiftLint/releases/download/0.16.1/SwiftLint.pkg' | ||
tmppath = '/tmp/SwiftLint.pkg' | ||
next if system('which swiftlint > /dev/null') | ||
|
||
Utils.run([ | ||
"curl -Lo #{tmppath} #{url}", | ||
"sudo installer -pkg #{tmppath} -target /" | ||
], task) | ||
end | ||
url = 'https://github.com/realm/SwiftLint/releases/download/0.16.1/SwiftLint.pkg' | ||
tmppath = '/tmp/SwiftLint.pkg' | ||
|
||
Utils.run([ | ||
"curl -Lo #{tmppath} #{url}", | ||
"sudo installer -pkg #{tmppath} -target /" | ||
], task) | ||
end | ||
|
||
desc 'Lint the code' | ||
task :code => :install do |task| | ||
Utils.print_info 'Linting the code' | ||
Utils.run(%Q(swiftlint lint --no-cache --strict --path Sources), task) | ||
if File.directory?('Sources') | ||
desc 'Lint the code' | ||
task :code => :install do |task| | ||
Utils.print_header 'Linting the code' | ||
Utils.run(%Q(swiftlint lint --no-cache --strict --path Sources), task) | ||
end | ||
end | ||
|
||
desc 'Lint the tests' | ||
task :tests => :install do |task| | ||
Utils.print_info 'Linting the unit test code' | ||
Utils.run(%Q(swiftlint lint --no-cache --strict --path "#{TEST_PATH}"), task) | ||
Utils.print_header 'Linting the unit test code' | ||
Utils.run(%Q(swiftlint lint --no-cache --strict --path "Tests/#{WORKSPACE}Tests"), task) | ||
end | ||
|
||
if File.directory?('Tests/Expected') | ||
desc 'Lint the output' | ||
task :output => :install do |task| | ||
Utils.print_header 'Linting the template output code' | ||
Utils.run(%Q(swiftlint lint --no-cache --strict --path Tests/Expected), task) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
namespace :pod do | ||
desc 'Lint the Pod' | ||
task :lint do |task| | ||
Utils.print_info 'Linting the pod spec' | ||
Utils.run(%Q(pod lib lint "#{POD_NAME}.podspec" --quick), task) | ||
# Used constants: | ||
# - POD_NAME | ||
|
||
if defined?(POD_NAME) && File.file?("#{POD_NAME}.podspec") | ||
namespace :pod do | ||
desc 'Lint the Pod' | ||
task :lint do |task| | ||
Utils.print_header 'Linting the pod spec' | ||
Utils.run(%Q(bundle exec pod lib lint "#{POD_NAME}.podspec" --quick), task) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
namespace :spm do | ||
desc 'Build using SPM' | ||
task :build do |task| | ||
Utils.print_info 'Compile using SPM' | ||
Utils.run("swift build", task, xcrun: true) | ||
end | ||
# Used constants: | ||
# none | ||
|
||
if File.file?('Package.swift') | ||
namespace :spm do | ||
desc 'Build using SPM' | ||
task :build do |task| | ||
Utils.print_header 'Compile using SPM' | ||
Utils.run('swift build', task, xcrun: true) | ||
end | ||
|
||
desc 'Run SPM Unit Tests' | ||
task :test => :build do |task| | ||
Utils.print_info 'Run the unit tests using SPM' | ||
Utils.run("swift test", task, xcrun: true) | ||
desc 'Run SPM Unit Tests' | ||
task :test => :build do |task| | ||
Utils.print_header 'Run the unit tests using SPM' | ||
Utils.run('swift test', task, xcrun: true) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# Used constants: | ||
# - CONFIGURATION | ||
# - SCHEME_NAME | ||
# - WORKSPACE | ||
|
||
namespace :xcode do | ||
desc 'Build using Xcode' | ||
task :build do |task| | ||
Utils.print_info 'Compile using Xcode' | ||
Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{TARGET_NAME}" -configuration "#{CONFIGURATION}" build-for-testing), task, xcrun: true, xcpretty: true) | ||
Utils.print_header 'Compile using Xcode' | ||
Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{SCHEME_NAME}" -configuration "#{CONFIGURATION}" build-for-testing), task, xcrun: true, formatter: :xcpretty) | ||
end | ||
|
||
desc 'Run Xcode Unit Tests' | ||
task :test => :build do |task| | ||
Utils.print_info 'Run the unit tests using Xcode' | ||
Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{TARGET_NAME}" -configuration "#{CONFIGURATION}" test-without-building), task, xcrun: true, xcpretty: true) | ||
Utils.print_header 'Run the unit tests using Xcode' | ||
Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{SCHEME_NAME}" -configuration "#{CONFIGURATION}" test-without-building), task, xcrun: true, formatter: :xcpretty) | ||
end | ||
end |