Sha256: e594e25ba7c4269f37e7ac50cbcd7914ef76b3e04382456140ec94f0749b101b

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

namespace :extconf do
  extension = File.basename(__FILE__, '.rake')
  ext_confs = Dir.glob("**/extconf.rb")

  task :compile => :compile_all do
    if Dir.glob("**/*.{o,so,dll,bundle}").length == 0
      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
      STDERR.puts "Gem actually failed to build.  Your system is"
      STDERR.puts "NOT configured properly to build langscan."
      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
      exit(1)
    end
  end

  task :compile_all do
    oks = []
    ngs = []
    ext_confs.each do |ext_conf|
      _ext = File.dirname(ext_conf)
      lang_name = File.basename(_ext)
      Dir.chdir(_ext) do
        ruby "extconf.rb"
        sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
          if !ok
            require "fileutils"
            FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
            ngs << lang_name
          else
            oks << lang_name
          end
        end
      end
    end
    oks.each do |lang_name|
      STDOUT.puts "#{lang_name}: SUCCESS"
    end
    ngs.each do |lang_name|
      STDERR.puts "#{lang_name}: FAILED"
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
langscan-1.2-x86-mswin32-60 tasks/extconf/langscan.rake