-
Notifications
You must be signed in to change notification settings - Fork 81
/
Rakefile
23 lines (18 loc) · 841 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
# frozen_string_literal: true
require_relative '../../lib/version'
namespace :swiftlint do
desc 'Download and install swiftlint tool'
task :install do
next if ENV['DANGER_SKIP_SWIFTLINT_INSTALL'] == 'YES'
REPO = 'https://github.com/realm/SwiftLint'
VERSION = ENV['SWIFTLINT_VERSION'] || DangerSwiftlint::SWIFTLINT_VERSION
ASSET = 'portable_swiftlint.zip'
URL = "#{REPO}/releases/download/#{VERSION}/#{ASSET}"
DESTINATION = File.expand_path(File.join(File.dirname(__FILE__), 'bin'))
SCRIPT_PATH = File.expand_path(File.join(File.dirname(__FILE__)))
SWIFTLINT_MD5_HASH = DangerSwiftlint::SWIFTLINT_HASH
puts "Downloading swiftlint@#{VERSION}"
sh "#{SCRIPT_PATH}/downloadSwiftlint.sh -u #{URL} -d #{DESTINATION} -a #{ASSET} -dh #{SWIFTLINT_MD5_HASH}"
end
end
task default: 'swiftlint:install'