Skip to content

Commit

Permalink
Modify rake task to prevent releasing a gem including binary files
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed May 17, 2023
1 parent 2f09a76 commit c0f0690
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,30 @@ require "bundler/gem_tasks"
require "rake/testtask"
require "etc" # make -j #{Etc.nprocessors}

# Test

task default: :test
Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end

# Release gem

# Prevent releasing the gem including htslib shared library.

task :check_shared_library_exist do
unless Dir.glob("vendor/*.{so,dylib}").empty?
magenta = "\e[35m"
clear = "\e[0m"
abort "#{magenta}Shared library exists in the vendor directory.#{clear}"
end
end

Rake::Task["release:guard_clean"].enhance(["check_shared_library_exist"])

# Build htslib

namespace :htslib do
desc "Building HTSlib"
task :build do
Expand Down

0 comments on commit c0f0690

Please sign in to comment.