-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (30 loc) · 1.09 KB
/
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
# TODO: see if I can bypass needing to prefix rake commands with `bundle exec` via this:
# ENV["BUNDLE_GEMFILE"] ||= File.expand_path("./Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
Bundler.require(*%i[dev build])
require "bundler/gem_tasks"
require "rubygems/package_task"
# noinspection RubyMismatchedArgumentType
ROOT_DIR = Pathname.new(__dir__)
ROOT_DIR.glob('lib/tasks/*.rake').each { |r| import r }
GEMSPECS = ROOT_DIR.glob('*.gemspec')
GEMSPECS.each do |gemspec|
spec = Bundler.load_gemspec(gemspec.to_s)
Gem::PackageTask.new(spec).define
end
begin
require "rubocop/rake_task"
RuboCop::RakeTask.new do |task|
task.requires << 'rubocop-rake'
end
task default: :rubocop
rescue LoadError
STDERR.puts "Rubocop not installed. Skipping associated tasks."
end
#require 'rake/extensiontask'
# TODO: figure out how to build/install the gem with precompiled binaries
# ...or at least debug why systemwide installation can be finnicky
#Rake::ExtensionTask.new(EXTENSION_NAME) do |ext|
# ext.lib_dir = "lib/#{EXTENSION_NAME}"
#end