Permalink
Browse files

Make allowances for those that want to build/test but do not have cro…

…ss compilers.
  • Loading branch information...
1 parent c52a60c commit 972bfb74317112cd4efd3a587f248780c2a7233a @copiousfreetime committed Oct 2, 2010
Showing with 24 additions and 17 deletions.
  1. +4 −1 tasks/config.rb
  2. +18 −16 tasks/distribution.rake
  3. +2 −0 tasks/extension.rake
View
@@ -93,7 +93,10 @@
#-----------------------------------------------------------------------
Configuration.for('extension') {
configs Configuration.for('packaging').files.ext.find_all { |x| %w[ mkrf_conf.rb extconf.rb ].include?(File.basename(x)) }
- cross_rbconfig ::YAML::load_file( File.expand_path("~/.rake-compiler/config.yml"))
+ cross_rbconfig Hash.new
+ if File.exist?( File.expand_path("~/.rake-compiler/config.yml")) then
+ cross_rbconfig ::YAML::load_file( File.expand_path("~/.rake-compiler/config.yml"))
+ end
}
#-----------------------------------------------------------------------
View
@@ -44,22 +44,24 @@ if pkg_config = Configuration.for_if_exist?("packaging") then
desc "reinstall gem"
task :reinstall => [:uninstall, :repackage, :install]
- desc "package up a windows gem"
- task :package_win => :clean do
- Configuration.for("extension").cross_rbconfig.keys.each do |rbconfig|
- v = rbconfig.split("-").last
- s = v.sub(/\.\d$/,'')
- sh "rake ext:build_win-#{v}"
- mkdir_p "lib/hitimes/#{s}", :verbose => true
- cp "ext/hitimes/hitimes_ext.so", "lib/hitimes/#{s}/", :verbose => true
- end
-
- Hitimes::SPECS.each do |spec|
- next if spec.platform == "ruby"
- spec.files += FileList["lib/hitimes/{1.8,1.9}/**.{dll,so}"]
- Gem::Builder.new( spec ).build
- mkdir "pkg" unless File.directory?( 'pkg' )
- mv Dir["*.gem"].first, "pkg"
+ if Configuration.for("extension").cross_rbconfig.size > 0 then
+ desc "package up a windows gem"
+ task :package_win => :clean do
+ Configuration.for("extension").cross_rbconfig.keys.each do |rbconfig|
+ v = rbconfig.split("-").last
+ s = v.sub(/\.\d$/,'')
+ sh "rake ext:build_win-#{v}"
+ mkdir_p "lib/hitimes/#{s}", :verbose => true
+ cp "ext/hitimes/hitimes_ext.so", "lib/hitimes/#{s}/", :verbose => true
+ end
+
+ Hitimes::SPECS.each do |spec|
+ next if spec.platform == "ruby"
+ spec.files += FileList["lib/hitimes/{1.8,1.9}/**.{dll,so}"]
+ Gem::Builder.new( spec ).build
+ mkdir "pkg" unless File.directory?( 'pkg' )
+ mv Dir["*.gem"].first, "pkg"
+ end
end
end
View
@@ -45,6 +45,8 @@ if ext_config = Configuration.for_if_exist?('extension') then
def build_win( version = "1.8.6" )
ext_config = Configuration.for("extension")
+ return nil unless ext_config.cross_rbconfig
+
rbconfig = ext_config.cross_rbconfig["rbconfig-#{version}"]
raise ArgumentError, "No cross compiler for version #{version}, we have #{ext_config.cross_rbconfig.keys.join(",")}" unless rbconfig
Hitimes::GEM_SPEC.extensions.each do |extension|

0 comments on commit 972bfb7

Please sign in to comment.