Sha256: ef21a1a2bdf8361526634987ed05380014ec02bfec78ac86fba8cb7bada480c0

Contents?: true

Size: 1.86 KB

Versions: 7

Compression:

Stored size: 1.86 KB

Contents

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
	
  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
	nunitx86="#{nunit_bin}/bin/nunit-console-x86.exe" if nunit_bin.length > 3

	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
	  }
	end

	self[:nunit_bin]=nunit_bin
	self[:nunit]=nunit
	self[:nunitx86]=nunitx86
  end
end # class Paths
end # module Dev

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dev-1.0.195 lib/dev/Paths.rb
dev-1.0.194 lib/dev/Paths.rb
dev-1.0.193 lib/dev/Paths.rb
dev-1.0.192 lib/dev/Paths.rb
dev-1.0.191 lib/dev/Paths.rb
dev-1.0.190 lib/dev/Paths.rb
dev-1.0.189 lib/dev/Paths.rb