Navigation Menu

Skip to content

Commit

Permalink
Unify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 6, 2015
1 parent 72839ce commit 2291813
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions Rakefile
Expand Up @@ -149,35 +149,34 @@ namespace :clean do
end

namespace :build do
architectures = [:x86, :x64]

namespace :windows do
ruby_versions = "2.0.0:2.1.6:2.2.2"

desc "Build gem for Windows i386"
task :x86 do
require "rake_compiler_dock"
rm_rf binary_dir
RakeCompilerDock.sh %Q[
bundle
rake clean
rake cross native gem RUBY_CC_VERSION=\"#{ruby_versions}\"
]
end

desc "Build gem for Windows x64"
task :x64 do
require "rake_compiler_dock"
rm_rf binary_dir
RakeCompilerDock.sh %Q[
bundle
rake clean
export RROONGA_USE_GROONGA_X64=true
rake cross native gem RUBY_CC_VERSION=\"#{ruby_versions}\"
]
architectures.each do |architecture|
desc "Build gem for Windows #{architecture}"
task architecture do
require "rake_compiler_dock"
rm_rf binary_dir
commands = [
"bundle",
"rake clean",
"rake cross native gem RUBY_CC_VERSION=#{ruby_versions}",
]
if architecture == :x64
commands.unshift("export RROONGA_USE_GROONGA_X64=true")
end
RakeCompilerDock.sh(commands.join(" && "))
end
end
end

desc "Build gems for Windows"
task :windows => ["windows:x86", "windows:x64"]
build_tasks = architectures.collect do |architecture|
"windows:#{architecture}"
end
task :windows => build_tasks
end

task :default => :test

0 comments on commit 2291813

Please sign in to comment.