Class: Fastlane::Actions::DotnetSelectAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



27
28
29
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 27

def self.authors
  ["CheeryLee"]
end

.categoryObject



41
42
43
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 41

def self.category
  :building
end

.descriptionObject



23
24
25
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 23

def self.description
  "Changes the dotnet executable to use"
end

.example_codeObject



35
36
37
38
39
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 35

def self.example_code
  [
    'dotnet_select("C:/Program\ Files/dotnet/dotnet.exe")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 31

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/sapfire/actions/dotnet_select_action.rb', line 10

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 dotnet executable required") if
    path.empty? || (!path.end_with?("dotnet") && !path.end_with?("dotnet.exe"))

  Actions.lane_context[SharedValues::SF_DOTNET_PATH] = path

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