Permalink
Browse files

added ext/Rakefile as post-install build step for gem install right_l…

…ink on Windows
  • Loading branch information...
1 parent dbfe174 commit 8144ee36715df030b30d97465695a3e5896a3ff9 @smessier smessier committed Sep 6, 2012
Showing with 28 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +18 −0 ext/Rakefile
  3. +9 −1 right_link.gemspec
View
@@ -7,3 +7,4 @@ tags
.project
.loadpath
nbproject/
+pkg/
View
@@ -0,0 +1,18 @@
+require 'rubygems'
+require 'rake'
+
+desc "Builds any binaries local to right_link"
+task :default do
+ if RUBY_PLATFORM =~ /mswin|mingw/
+ task = 'build'
+ ms_build_path = "#{ENV['WINDIR']}\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe"
+ right_link_root = ::File.expand_path(::File.join(::File.dirname(__FILE__), '..'))
+ Dir.chdir(File.join(right_link_root, 'lib', 'chef', 'windows', 'ChefNodeCmdlet')) do
+ # Note that we can build C# components using msbuild instead of needing to
+ # have Developer Studio installed
+ build_command = "#{ms_build_path} ChefNodeCmdlet.sln /t:#{task} /p:configuration=Release > ChefNodeCmdlet.build.txt 2>&1"
+ puts "#{build_command}"
+ `#{build_command}`
+ end
+ end
+end
View
@@ -43,10 +43,18 @@ spec = Gem::Specification.new do |s|
Dir.glob('init/*') +
Dir.glob('actors/*.rb') +
Dir.glob('bin/*') +
- Dir.glob('lib/**/*.rb') +
+ Dir.glob('ext/Rakefile') +
+ Dir.glob('lib/chef/windows/**/*.cs') +
+ Dir.glob('lib/chef/windows/**/*.csproj') +
+ Dir.glob('lib/chef/windows/bin/*.dll') +
+ Dir.glob('lib/chef/windows/**/*.ps1') +
+ Dir.glob('lib/chef/windows/**/*.sln') +
+ Dir.glob('lib/chef/windows/**/*.txt') +
+ Dir.glob('lib/chef/windows/**/*.xml') +
Dir.glob('lib/**/*.pub') +
Dir.glob('scripts/*') +
Dir.glob('lib/instance/cook/*.crt')
s.executables = Dir.glob('bin/*').map { |f| File.basename(f) }
+ s.extensions = ["ext/Rakefile"]
end

0 comments on commit 8144ee3

Please sign in to comment.