diff --git a/Rakefile b/Rakefile index 0373bc99..a59f1b75 100644 --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,6 @@ WORKSPACE = 'StencilSwiftKit' TARGET_NAME = 'Tests' CONFIGURATION = 'Debug' POD_NAME = 'StencilSwiftKit' -TEST_PATH = "Tests/#{POD_NAME}Tests" task :default => 'xcode:test' diff --git a/rakelib/lint.rake b/rakelib/lint.rake index c6ac457f..6b69fbed 100644 --- a/rakelib/lint.rake +++ b/rakelib/lint.rake @@ -12,15 +12,25 @@ namespace :lint do end 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_info '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.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_info 'Linting the template output code' + Utils.run(%Q(swiftlint lint --no-cache --strict --path Tests/Expected), task) + end end end