forked from open-telemetry/opentelemetry-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (42 loc) · 928 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
namespace :each do
task :bundle_install do
foreach_gem('bundle install')
end
task :bundle_update do
foreach_gem('bundle update')
end
task :test do
foreach_gem('bundle exec rake test')
end
task :yard do
foreach_gem('bundle exec rake yard')
end
task :rubocop do
foreach_gem('bundle exec rake rubocop')
end
task :default do
foreach_gem('bundle exec rake')
end
end
task each: 'each:default'
task default: [:each]
def foreach_gem(cmd)
Dir.glob("**/opentelemetry-*.gemspec") do |gemspec|
name = File.basename(gemspec, ".gemspec")
dir = File.dirname(gemspec)
puts "**** Entering #{dir}"
Dir.chdir(dir) do
if defined?(Bundler)
Bundler.with_clean_env do
sh(cmd)
end
else
sh(cmd)
end
end
end
end