Sha256: fb5976da43401ce345ca0f549ddf30c37c38aa49eb1096ef0950b634e44f84cb

Contents?: true

Size: 1.46 KB

Versions: 21

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rubocop/rake_task"

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

task default: %i[spec rubocop]

task :compile do
  require_relative "ext/extconf"
end

task spec: :compile

desc "Build install-compilation gem"
task "gem:native:any" do
  sh "rake platform:any gem"
end

require "rubygems/package_task"

desc "Define the gem task to build on any platform (compile on install)"
task "platform:any" do
  spec = Gem::Specification::load("pngcheck.gemspec").dup
  task = Gem::PackageTask.new(spec)
  task.define
end

File.readlines(".cross_rubies", chomp: true).each do |platform|
  desc "Build pre-compiled gem for the #{platform} platform"
  task "gem:native:#{platform}" do
    sh "rake compile platform:#{platform} gem target_platform=#{platform}"
  end

  desc "Define the gem task to build on the #{platform} platform (binary gem)"
  task "platform:#{platform}" do
    spec = Gem::Specification::load("pngcheck.gemspec").dup
    spec.platform = Gem::Platform.new(platform)
    spec.files += Dir.glob("lib/pngcheck/*.{dll,so,dylib}")
    spec.extensions = []
    spec.dependencies.reject! { |d| d.name == "mini_portile2" }

    task = Gem::PackageTask.new(spec)
    task.define
  end
end

require "rake/clean"

CLOBBER.include("pkg")
CLEAN.include("ports",
              "tmp",
              "lib/pngcheck/*.dll",
              "lib/pngcheck/*.dylib",
              "lib/pngcheck/*.so")

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
pngcheck-0.2.6 Rakefile
pngcheck-0.2.6-x86_64-darwin Rakefile
pngcheck-0.2.6-arm64-darwin Rakefile
pngcheck-0.2.5 Rakefile
pngcheck-0.2.5-x86_64-darwin Rakefile
pngcheck-0.2.5-arm64-darwin Rakefile
pngcheck-0.2.4 Rakefile
pngcheck-0.2.4-x86_64-darwin Rakefile
pngcheck-0.2.4-arm64-darwin Rakefile
pngcheck-0.2.3 Rakefile
pngcheck-0.2.3-x86_64-darwin Rakefile
pngcheck-0.2.3-arm64-darwin Rakefile
pngcheck-0.2.2 Rakefile
pngcheck-0.2.2-x86_64-darwin Rakefile
pngcheck-0.2.2-arm64-darwin Rakefile
maxirmx_test_gem-0.2.1-x86_64-linux-musl Rakefile
maxirmx_test_gem-0.2.1-x86_64-linux Rakefile
pngcheck-0.2.1 Rakefile
pngcheck-0.2.1-x86_64-darwin Rakefile
pngcheck-0.2.1-arm64-darwin Rakefile