require_relative './color.rb' require_relative './msbuild.rb' class Build < Array def initialize # Gem builds, `gem build dev_tasks.spec` Dir.glob('*.gemspec') {|f| self.add "gem build #{f}" } # .sln builds, `"C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "MySolution.sln" msbuild=MSBuild.new Dir.glob('**/*.sln'){|f| vs_version=MSBuild.get_vs_version(f) if File.exist? msbuild[vs_version] MSBuild.get_configurations(f).each{ |configuration| MSBuild.get_platforms(f).each{|platform| self.add "\"#{msbuild[vs_version]}\" \"#{f}\" /nologo /p:Configuration=#{configuration} /p:Platform=\"#{platform}\"" } #self.add "\"#{msbuild[vs_version]}\" \"#{f}\" /nologo /p:Configuration=#{configuration} /p:Platform=\"Any CPU\"" } #self.add "\"#{msbuild[vs_version]}\" \"#{f}\" /nologo /p:Configuration=Release /p:Platform=\"Any CPU\"" end } end #def self.msbuild # "C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\msbuild.exe" #end def add command self << command if(!include?(command)) end end