Skip to content
Browse files

Make cross compiling to win32 work under OS X, w00t!

Automate release process some more.
  • Loading branch information...
1 parent 9d4f025 commit 4ad001ceab5f8e2142e0a66906889e32263880f0 @macournoyer macournoyer committed Sep 5, 2009
Showing with 17 additions and 16 deletions.
  1. +10 −1 Rakefile
  2. +7 −15 tasks/gem.rake
View
11 Rakefile
@@ -14,7 +14,13 @@ Dir['tasks/**/*.rake'].each { |rake| load rake }
task :default => :spec
-Rake::ExtensionTask.new('thin_parser', Thin::GemSpec)
+Rake::ExtensionTask.new('thin_parser', Thin::GemSpec) do |ext|
+ ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
+ ext.cross_platform = 'i386-mswin32' # forces the Windows platform instead of the default one
+ # configure options only for cross compile
+end
+
+CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM)
desc "Compile the Ragel state machines"
task :ragel do
@@ -25,3 +31,6 @@ task :ragel do
raise "Failed to compile Ragel state machine" unless File.exist? target
end
end
+
+desc "Release version #{Thin::VERSION::STRING} gems to rubyforge"
+task :release => [:clean, :cross, :native, :gem, :tag, "gem:upload"]
View
22 tasks/gem.rake
@@ -1,7 +1,7 @@
require 'rake/gempackagetask'
require 'yaml'
-WIN_SUFFIX = ENV['WIN_SUFFIX'] || 'i386-mswin32'
+WIN_SUFFIX = ENV['WIN_SUFFIX'] || 'x86-mswin32'
task :clean => :clobber_package
@@ -64,19 +64,11 @@ namespace :gem do
File.open("thin.gemspec", 'w') { |f| f << YAML.dump(Thin::GemSpec) }
end
- namespace :upload do
- desc 'Upload the precompiled win32 gem to code.macournoyer.com'
- task :win do
- upload "pkg/#{Thin::GemSpec.full_name}-#{WIN_SUFFIX}.gem", 'gems'
- system 'ssh macournoyer@code.macournoyer.com "cd code.macournoyer.com && gem generate_index"'
- end
-
- desc 'Upload gems (ruby & win32) to rubyforge.org'
- task :rubyforge => :gem do
- sh 'rubyforge login'
- sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}.gem"
- sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}.gem"
- sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}-#{WIN_SUFFIX}.gem"
- end
+ desc 'Upload gems (ruby & win32) to rubyforge.org'
+ task :upload => :gem do
+ sh 'rubyforge login'
+ sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}.gem"
+ sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}.gem"
+ sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{Thin::GemSpec.full_name}-#{WIN_SUFFIX}.gem"
end
end

0 comments on commit 4ad001c

Please sign in to comment.
Something went wrong with that request. Please try again.