Sha256: 5b605d9abbc5cc6d44b3e5d463a660b5cba85cf51c392eae0810c29ed2a1504c

Contents?: true

Size: 1.77 KB

Versions: 15

Compression:

Stored size: 1.77 KB

Contents

require 'bundler/gem_tasks'

task default: :test

require 'rake/extensiontask'
gem_spec = Gem::Specification.load("sassc.gemspec")

# HACK: Prevent rake-compiler from overriding required_ruby_version,
# because the shared library here is Ruby-agnostic.
# See https://github.com/rake-compiler/rake-compiler/issues/153
module FixRequiredRubyVersion
  def required_ruby_version=(*); end
end
Gem::Specification.send(:prepend, FixRequiredRubyVersion)

Rake::ExtensionTask.new('libsass', gem_spec) do |ext|
  ext.name = 'libsass'
  ext.ext_dir = 'ext'
  ext.lib_dir = 'lib/sassc'
  ext.cross_compile = true
  ext.cross_platform = %w[x86-mingw32 x64-mingw32]

  # Link C++ stdlib statically when building binary gems.
  ext.cross_config_options << '--enable-static-stdlib'

  ext.cross_config_options << '--disable-march-tune-native'

  ext.cross_compiling do |spec|
    spec.files.reject! { |path| File.fnmatch?('ext/*', path) }
  end
end

desc 'Compile all native gems via rake-compiler-dock (Docker)'
task 'gem:native' do
  require 'rake_compiler_dock'

  # The RUBY_CC_VERSION here doesn't matter for the final package.
  # Only one version should be specified, as the shared library is Ruby-agnostic.
  #
  # g++-multilib is installed for 64->32-bit cross-compilation.
  RakeCompilerDock.sh "sudo apt-get install -y g++-multilib && gem i rake bundler --no-document && bundle && "\
                      "rake clean && rake cross native gem MAKE='nice make -j`nproc`' "\
                      "RUBY_CC_VERSION=2.6.0 CLEAN=1"
end

CLEAN.include 'tmp', 'pkg', 'lib/sassc/libsass.{so,bundle}', 'ext/libsass/VERSION',
              'ext/*.{o,so,bundle}', 'ext/Makefile'

desc "Run all tests"
task test: 'compile:libsass' do
  $LOAD_PATH.unshift('lib', 'test')
  Dir.glob('./test/**/*_test.rb') { |f| require f }
end

Version data entries

15 entries across 11 versions & 2 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/Rakefile
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/Rakefile
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.1/Rakefile
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.0/Rakefile
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.1/Rakefile
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.0/Rakefile
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/Rakefile
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/Rakefile
sassc-2.2.1-x86-mingw32 Rakefile
sassc-2.2.1-x64-mingw32 Rakefile
sassc-2.2.1 Rakefile
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.2.0/Rakefile
sassc-2.2.0-x86-mingw32 Rakefile
sassc-2.2.0-x64-mingw32 Rakefile
sassc-2.2.0 Rakefile