Sha256: dc9dd7914c257b5250c97d2a8eaa0ac709860654481ab40db9679ecd538600b4

Contents?: true

Size: 811 Bytes

Versions: 8

Compression:

Stored size: 811 Bytes

Contents

module Rake
  module Funnel
    module Support
      module MSBuild
        class BuildTool
          class << self
            def find
              return 'xbuild' unless Rake::Win32.windows?

              require 'win32/registry'

              %w(14.0 12.0 4.0 3.5 2.0).collect { |version|
                key = "SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\#{version}"

                begin
                  ::Win32::Registry::HKEY_LOCAL_MACHINE.open(key) do |reg|
                    candidate = File.join(reg['MSBuildToolsPath'] || '', 'msbuild.exe')
                    next candidate if File.exist?(candidate)
                  end
                rescue
                  next
                end
              }.compact.first
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rake-funnel-0.18.0 lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.17.0 lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.16.1 lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.16.0 lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.15.0.pre lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.14.0.pre lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.13.0.pre lib/rake/funnel/support/msbuild/build_tool.rb
rake-funnel-0.12.0.pre lib/rake/funnel/support/msbuild/build_tool.rb