From 6bdb32538b1f90189b8218ae0ef51d8e65cb2563 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 27 Sep 2013 17:15:02 -0700 Subject: use separate gemspec for windows - allows us to explicitly version pin in the gemspec on gem installs rather than getting different behavior from 'gem install' and 'bundle install' (gemspec vs. Gemfile). - the mingw deps had been in the Gemfile because it needed to be a group since gemspecs do not have groups. this builds two different gems for publication to rubygems instead. - see mixlib-shellout for the prototype of where this has been done (successfully). Conflicts: Gemfile --- Gemfile | 21 +-------------------- Rakefile | 16 ++++++++++++---- chef-x86-mingw32.gemspec | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 chef-x86-mingw32.gemspec diff --git a/Gemfile b/Gemfile index 371406cfde..1fe4580c0b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source "https://rubygems.org" - -gemspec +gemspec :name => "chef" gem "activesupport", "< 4.0.0", :group => :compat_testing, :platform => "ruby" @@ -18,24 +17,6 @@ group(:development, :test) do # gem 'pry' end -platforms :mswin, :mingw do - gem "systemu", "2.2.0" # CHEF-3718 - gem "ffi", "1.0.9" - gem "rdp-ruby-wmi", "0.3.1" - gem "windows-api", "0.4.0" - gem "windows-pr", "1.2.1" - gem "win32-api", "1.4.8" - gem "win32-dir", "0.3.7" - gem "win32-event", "0.5.2" - gem "win32-mutex", "0.3.1" - gem "win32-process", "0.6.5" - gem "win32-service", "0.7.2" -end - -platforms :mingw_18 do - gem "win32-open3", "0.3.2" -end - # If you want to load debugging tools into the bundle exec sandbox, # add these additional dependencies into chef/Gemfile.local eval(IO.read(__FILE__ + '.local'), binding) if File.exists?(__FILE__ + '.local') diff --git a/Rakefile b/Rakefile index 085887fab5..bdbaeda156 100644 --- a/Rakefile +++ b/Rakefile @@ -26,13 +26,12 @@ require './tasks/rspec.rb' GEM_NAME = "chef" -spec = eval(File.read("chef.gemspec")) - # This has to be here or else the docs get generated *after* the gem is created task :gem => 'docs:all' -Gem::PackageTask.new(spec) do |pkg| - pkg.gem_spec = spec +Dir[File.expand_path("../*gemspec", __FILE__)].reverse.each do |gemspec_path| + gemspec = eval(IO.read(gemspec_path)) + Gem::PackageTask.new(gemspec).define end begin @@ -60,6 +59,15 @@ task :uninstall do sh %{gem uninstall #{GEM_NAME} -x -v #{Chef::VERSION} } end +desc "Build it, tag it and ship it" +task :ship => :gem do + sh("git tag #{Chef::VERSION}") + sh("git push opscode --tags") + Dir[File.expand_path("../pkg/*.gem", __FILE__)].reverse.each do |built_gem| + sh("gem push #{built_gem}") + end +end + RONN_OPTS = "--manual='Chef Manual' --organization='Chef #{Chef::VERSION}' --date='#{Time.new.strftime('%Y-%m-%d')}'" namespace :docs do diff --git a/chef-x86-mingw32.gemspec b/chef-x86-mingw32.gemspec new file mode 100644 index 0000000000..c4e058d4c6 --- /dev/null +++ b/chef-x86-mingw32.gemspec @@ -0,0 +1,18 @@ +# x86-mingw32 Gemspec # +gemspec = eval(IO.read(File.expand_path("../chef.gemspec", __FILE__))) + +gemspec.platform = "x86-mingw32" + +gemspec.add_dependency "systemu", "2.2.0" # CHEF-3718 +gemspec.add_dependency "ffi", "1.0.9" +gemspec.add_dependency "rdp-ruby-wmi", "0.3.1" +gemspec.add_dependency "windows-api", "0.4.0" +gemspec.add_dependency "windows-pr", "1.2.1" +gemspec.add_dependency "win32-api", "1.4.8" +gemspec.add_dependency "win32-dir", "0.3.7" +gemspec.add_dependency "win32-event", "0.5.2" +gemspec.add_dependency "win32-mutex", "0.3.1" +gemspec.add_dependency "win32-process", "0.6.5" +gemspec.add_dependency "win32-service", "0.7.2" + +gemspec -- cgit v1.2.1