-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
38 lines (30 loc) · 902 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'rake/clean'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
Dir.glob('**/*.rake').each do |task_file|
load(task_file)
end
CLEAN.include 'gems/**/tmp'
CLEAN.include 'gems/**/pkg'
CLEAN.include 'gems/aws-crt/bin'
desc 'Executes specs for a single gem, e.g. spec:aws-crt'
task 'spec:*' => :bin
rule(/spec:.+$/) do |task|
spec_dir = "gems/#{task.name.split(':').last}/spec"
sh("bundle exec rspec #{spec_dir}")
end
desc 'Execute all specs'
task :spec => :bin do
Dir.glob('**/spec').tap do |spec_file_list|
sh("bundle exec rspec #{spec_file_list.join(' ')}")
end
end
RuboCop::RakeTask.new(:rubocop) do |t|
config_file = File.join(File.dirname(__FILE__), '.rubocop.yml')
t.options = ['-E', '-S', '-c', config_file]
end
task :release => %i[clean spec] do
Rake::Task['gem:aws-crt'].invoke if ENV['GEM']
puts 'Release complete'
end