Class: Fastlane::Actions::MsbuildSelectAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



34
35
36
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 34

def self.authors
  ["CheeryLee"]
end

.categoryObject



48
49
50
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 48

def self.category
  :building
end

.descriptionObject



30
31
32
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 30

def self.description
  "Changes the MSBuild executable to use. Useful if you have multiple installed versions."
end

.example_codeObject



42
43
44
45
46
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 42

def self.example_code
  [
    'msbuild_select("/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Community/Msbuild/Current/Bin/MSBuild.exe")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 38

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/plugin/sapfire/actions/msbuild_select_action.rb', line 12

def self.run(params)
  path = (params || []).first.to_s
  path = File.expand_path(path)

  UI.user_error!("File '#{path}' doesn't exist") unless File.exist?(path)
  UI.user_error!("Path to MSBuild executable or library required") if
    path.empty? || (!path.end_with?("MSBuild.exe") && !path.end_with?("MSBuild.dll"))

  Actions.lane_context[SharedValues::SF_MSBUILD_PATH] = path
  Actions.lane_context[SharedValues::SF_MSBUILD_TYPE] = if path.end_with?("MSBuild.exe")
                                                          Msbuild::MsbuildType::EXE
                                                        else
                                                          Msbuild::MsbuildType::LIBRARY
                                                        end

  UI.message("Setting MSBuild executable to '#{path}' for all next build steps")
end