diff --git a/rakelib/pod.rake b/rakelib/pod.rake index ce53d966..8224e820 100644 --- a/rakelib/pod.rake +++ b/rakelib/pod.rake @@ -1,7 +1,9 @@ -namespace :pod do - desc 'Lint the Pod' - task :lint do |task| - Utils.print_info 'Linting the pod spec' - Utils.run(%Q(bundle exec pod lib lint "#{POD_NAME}.podspec" --quick), task) +if File.file?('Podfile') + namespace :pod do + desc 'Lint the Pod' + task :lint do |task| + Utils.print_info 'Linting the pod spec' + Utils.run(%Q(bundle exec pod lib lint "#{POD_NAME}.podspec" --quick), task) + end end end diff --git a/rakelib/spm.rake b/rakelib/spm.rake index 3526e1f1..d88da894 100644 --- a/rakelib/spm.rake +++ b/rakelib/spm.rake @@ -1,13 +1,15 @@ -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 +if File.file?('Package.swift') + 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 - 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_info 'Run the unit tests using SPM' + Utils.run("swift test", task, xcrun: true) + end end end