Sha256: 022a5eba69779f7e4f30c5ee940e15178fcd067a125c28c7841a9836091807f5

Contents?: true

Size: 1.24 KB

Versions: 50

Compression:

Stored size: 1.24 KB

Contents

require "rake/extensiontask"
require "rake_compiler_dock"
require "minitest/test_task"

CLEAN.add("lib/**/*.{o,so,bundle}", "pkg")

cross_platforms = %w[
  aarch64-linux
  arm-linux
  arm64-darwin
  x64-mingw-ucrt
  x64-mingw32
  x86-linux
  x86-mingw32
  x86_64-darwin
  x86_64-linux
].freeze

ENV["RUBY_CC_VERSION"] = %w[3.3.0 3.2.0 3.1.0 3.0.0 2.7.0 2.6.0].join(":")

gemspec = Gem::Specification.load("argon2id.gemspec")

Gem::PackageTask.new(gemspec).define

Rake::ExtensionTask.new("argon2id", gemspec) do |e|
  e.cross_compile = true
  e.cross_platform = cross_platforms
end

Minitest::TestTask.create

begin
  require "ruby_memcheck"

  namespace :test do
    RubyMemcheck::TestTask.new(valgrind: :compile)
  end
rescue LoadError
  # Only define the test:valgrind task if ruby_memcheck is installed
end

namespace :gem do
  cross_platforms.each do |platform|
    desc "Compile and build native gem for #{platform}"
    task platform do
      RakeCompilerDock.sh <<~SCRIPT, platform: platform, verbose: true
        gem install bundler --no-document &&
        bundle &&
        bundle exec rake native:#{platform} pkg/#{gemspec.full_name}-#{Gem::Platform.new(platform)}.gem PATH="/usr/local/bin:$PATH"
      SCRIPT
    end
  end
end

task default: [:compile, :test]

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
argon2id-0.3.0 Rakefile
argon2id-0.3.0-x86_64-linux Rakefile
argon2id-0.3.0-x86_64-darwin Rakefile
argon2id-0.3.0-x86-mingw32 Rakefile
argon2id-0.3.0-x86-linux Rakefile
argon2id-0.3.0-x64-mingw32 Rakefile
argon2id-0.3.0-x64-mingw-ucrt Rakefile
argon2id-0.3.0-arm64-darwin Rakefile
argon2id-0.3.0-arm-linux Rakefile
argon2id-0.3.0-aarch64-linux Rakefile
argon2id-0.2.1 Rakefile
argon2id-0.2.1-x86_64-linux Rakefile
argon2id-0.2.1-x86_64-darwin Rakefile
argon2id-0.2.1-x86-mingw32 Rakefile
argon2id-0.2.1-x86-linux Rakefile
argon2id-0.2.1-x64-mingw32 Rakefile
argon2id-0.2.1-x64-mingw-ucrt Rakefile
argon2id-0.2.1-arm64-darwin Rakefile
argon2id-0.2.1-arm-linux Rakefile
argon2id-0.2.1-aarch64-linux Rakefile