Class: Fastlane::Actions::GetDeploymentTargetAction

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

Overview

Build an IPA binary

Class Method Summary collapse

Class Method Details

.authorsObject



41
42
43
# File 'lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb', line 41

def self.authors
  ["samdc@apadmi.com"]
end

.available_optionsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb', line 45

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :xcodeproj_path_or_dir,
                                 description: "Path to, or directory of xcode project file",
                                 type: String,
                                 default_value: ".",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :target,
                                 description: "The target who's deployment target you want",
                                 type: String,
                                 default_value: "app",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :configuration,
                                 description: "The configuration who's target you want",
                                 type: String,
                                 optional: true)
  ]
end

.descriptionObject



37
38
39
# File 'lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb', line 37

def self.description
  "Pulls the deployment target from the XCode project"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb', line 64

def self.is_supported?(platform)
  platform == :ios
end

.run(params) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb', line 13

def self.run(params)
  logger = FastLane::FastlaneLogger.new

  configuration = params[:configuration]
  project = Fastlane::Actions::GetVersionNumberAction.get_project!(
    params[:xcodeproj_path_or_dir]
  )

  logger.message("Searching for target #{params[:target]} in #{params[:xcodeproj_path_or_dir]}")
  target = Fastlane::Actions::GetVersionNumberAction.get_target!(
    project,
    params[:target]
  )

  target.build_configurations.each do |config|
    next unless configuration.nil? || config.name == configuration

    value = config.resolve_build_setting("IPHONEOS_DEPLOYMENT_TARGET")
    return value unless value.blank?
  end

  raise "Could not find deployment target for #{params[:xcodeproj_path_or_dir]} and #{params[:target]}"
end