Class: Fastlane::Helper::SapfireHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/sapfire/helper/sapfire_helper.rb

Class Method Summary collapse

Class Method Details

.dotnet_specified?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/sapfire/helper/sapfire_helper.rb', line 4

def self.dotnet_specified?
  path = Actions.lane_context[Fastlane::Actions::SharedValues::SF_DOTNET_PATH] || ""
  path = File.expand_path(path) unless path.empty?

  if path.empty?
    UI.error("The path to dotnet executable is not specified")
    return false
  elsif !File.exist?(path)
    UI.error("File '#{path}' doesn't exist")
    return false
  elsif !path.end_with?("dotnet") && !path.end_with?("dotnet.exe")
    UI.error("The path to dotnet doesn't point to executable file: #{path}")
    return false
  end

  true
end

.kits_10_locationObject



40
41
42
43
44
45
46
47
# File 'lib/fastlane/plugin/sapfire/helper/sapfire_helper.rb', line 40

def self.kits_10_location
  require "win32/registry"

  Win32::Registry::HKEY_LOCAL_MACHINE.open("SOFTWARE\\Wow6432Node\\Microsoft\\Windows Kits\\Installed Roots") do |reg|
    value = reg["KitsRoot10"]
    return value.strip
  end
end

.msbuild_specified?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fastlane/plugin/sapfire/helper/sapfire_helper.rb', line 22

def self.msbuild_specified?
  path = Actions.lane_context[Fastlane::Actions::SharedValues::SF_MSBUILD_PATH] || ""
  path = File.expand_path(path) unless path.empty?

  if path.empty?
    UI.error("The path to MSBuild executable is not specified")
    return false
  elsif !File.exist?(path)
    UI.error("File '#{path}' doesn't exist")
    return false
  elsif !path.end_with?("MSBuild.dll") && !path.end_with?("MSBuild.exe")
    UI.error("The path to MSBuild doesn't point to executable or DLL file: #{path}")
    return false
  end

  true
end

.root_plugin_locationObject



49
50
51
52
# File 'lib/fastlane/plugin/sapfire/helper/sapfire_helper.rb', line 49

def self.root_plugin_location
  path = File.join(File.dirname(__dir__), "../../../../")
  File.expand_path(path)
end