module Dev class Paths < Hash def initialize ["v4.0.30319","v3.5","v3.0","v2.0.50727"].each { |v| f="C:/WINDOWS/Microsoft.NET/Framework/#{v}/MSBuild.exe" self[:msbuild]=f if File.exists?(f) && self[:msbuild].nil? f="C:/WINDOWS/Microsoft.NET/Framework/#{v}/RegAsm.exe" self[:regasm]=f if File.exists?(f) && self[:regasm].nil? } initialize_nunit initialize_vs end def initialize_vs dev="C:/Program Files (x86)/Microsoft Visual Studio 8/Common7/IDE/devenv.exe" self[:vs8]=dev if File.exists?(dev) && self[:vs8].nil? dev="C:/Program Files (x86)/Microsoft Visual Studio 9.0/Common7/IDE/devenv.exe" self[:vs9]=dev if File.exists?(dev) && self[:vs9].nil? dev="C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/devenv.exe" self[:vs10]=dev if File.exists?(dev) && self[:vs10].nil? dev="C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/devenv.exe" self[:vs11]=dev if File.exists?(dev) && self[:vs11].nil? end def initialize_nunit nunit="" nunitx86="" nunit_bin="" Dir.glob("#{Rake.original_dir()}/**/*.csproj").each { |f| text=File.read(f) text.scan(/dep\\([\w\d.\-\\]+)\\bin\\[\w\d.\-\\]+\\nunit.framework.dll/).each{ | nunit_bin_match | nunit_bin="#{Dev::Environment::dev_root}/dep/#{nunit_bin_match[0].to_s.gsub('\\','/')}" } } nunit="#{nunit_bin}/bin/nunit-console.exe" if nunit_bin.length > 3 && File.exists?("#{nunit_bin}/bin/nunit-console.exe") nunitx86="#{nunit_bin}/bin/nunit-console-x86.exe" if nunit_bin.length > 3 && File.exists?("#{nunit_bin}/bin/nunit-console-x86.exe") # Z:\dep\ThirdParty\NUnit\2.5.10.11092\bin\net-2.0 if nunit.length==0 || !File.exists?(nunit) ["2.6.0.12051","2.5.10.11092"].each{ |v| Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/nunit-console.exe").each{|f| nunit=f if File.exists?(f) && self[:nunit].nil? } if( !self.has_key?(:nunit) ) Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/*/nunit-console.exe").each{|f| self[:nunit]=f if File.exists?(f) && self[:nunit].nil? } end Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/nunit-console-x86.exe").each{|f| nunitx86=f if File.exists?(f) && self[:nunitx86].nil? } if( !self.has_key?(:nunit) ) Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/*/nunit-console-x86.exe").each{|f| self[:nunitx86]=f if File.exists?(f) && self[:nunitx86].nil? } end Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/net-2.0/nunit-console.exe").each{|f| nunit=f if File.exists?(f) && self[:nunit].nil? } Dir.glob("#{Dev::Environment.dev_root}/dep/*/NUnit/#{v}/bin/net-2.0/nunit-console-x86.exe").each{|f| nunitx86=f if File.exists?(f) && self[:nunitx86].nil? } } end self[:nunit_bin]=nunit_bin self[:nunit]=nunit self[:nunitx86]=nunitx86 end end # class Paths end # module Dev