summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2013-09-27 17:15:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2013-09-27 17:15:02 -0700
commitf6bba53945cb06846807ab70941674db1b35772a (patch)
tree1b6f381a96ed1652fc06fc22735c45439a8d3d8d
parent008973c3c0b5598eed5f8d649c3eb8c6adf9325a (diff)
downloadchef-f6bba53945cb06846807ab70941674db1b35772a.tar.gz
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).
-rw-r--r--Gemfile21
-rw-r--r--Rakefile16
-rw-r--r--chef-x86-mingw32.gemspec18
3 files changed, 31 insertions, 24 deletions
diff --git a/Gemfile b/Gemfile
index 21f7744ba6..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.3.1"
- gem "rdp-ruby-wmi", "0.3.1"
- gem "windows-api", "0.4.2"
- gem "windows-pr", "1.2.2"
- gem "win32-api", "1.4.8"
- gem "win32-dir", "0.4.1"
- gem "win32-event", "0.6.0"
- gem "win32-mutex", "0.4.0"
- gem "win32-process", "0.7.3"
- 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..5e57054127
--- /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.3.1"
+gemspec.add_dependency "rdp-ruby-wmi", "0.3.1"
+gemspec.add_dependency "windows-api", "0.4.2"
+gemspec.add_dependency "windows-pr", "1.2.2"
+gemspec.add_dependency "win32-api", "1.4.8"
+gemspec.add_dependency "win32-dir", "0.4.1"
+gemspec.add_dependency "win32-event", "0.6.0"
+gemspec.add_dependency "win32-mutex", "0.4.0"
+gemspec.add_dependency "win32-process", "0.7.3"
+gemspec.add_dependency "win32-service", "0.7.2"
+
+gemspec