Skip to content

Instantly share code, notes, and snippets.

@laribee
Created October 17, 2008 19:23
Show Gist options
  • Select an option

  • Save laribee/17503 to your computer and use it in GitHub Desktop.

Select an option

Save laribee/17503 to your computer and use it in GitHub Desktop.
# rakefile.rb with new 'compile' task...
require 'build_tools'
task :compile do
msbuild :my_sln
end
# build_tools.rb
def msbuild(solution, opts={})
solution_dir = opts.has_key?(:path) ? opts[:path] : @props[:solution_path]
solution_path = File.join(solution_dir, "#{solution}.sln")
sh "#{@props[:tools][:msbuild]} #{solution_path}"
end
# next step? read from yml for easy multiple configs
def setup_defaults
@props = {}
@props[:solution_path] = '.\\'
@props[:tools] = {}
@props[:tools][:msbuild] = 'C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\\MSBuild.exe'
end
setup_defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment