class Fastlane::Actions::GetInfoPlistFilePathAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 96
def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ["Your GitHub/Twitter Name"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 58
def self.available_options
  # Define all options your action supports.
  
  # Below a few examples
  [
    FastlaneCore::ConfigItem.new(key: :xcodeproj,
                                 env_name: "FL_INFO_PLIST_PROJECT",
                                 description: "Optional, you must specify the path to your main Xcode project if it is not in the project root directory or if you have multiple *.xcodeproj's in the root directory",
                                 optional: true,
                                 verify_block: proc do |value|
                                  UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
                                  UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
                                end),
    FastlaneCore::ConfigItem.new(key: :target,
                                env_name: "FL_INFO_PLIST_TARGET",
                                conflicting_options: [:scheme],
                                description: "Specify a specific target if you have multiple per project, optional"),
    FastlaneCore::ConfigItem.new(key: :is_absolute,
                                 env_name: "FL_INFO_PLIST_TARGET",
                                 description: "Specify a specific target if you have multiple per project, optional",
                                 optional: true,
                                 is_string: false,
                                 default_value: false)
  ]
end
description() click to toggle source

@!group Documentation

# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 47
def self.description
  "A short description with <= 80 characters of what this action does"
end
details() click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 51
def self.details
  # Optional:
  # this is your chance to provide a more detailed description of this action
  "You can use this action to do cool things..."
end
find_project(params) click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 22
def self.find_project(params)
  project = Xcodeproj::Project.open(params[:xcodeproj])
  project
end
find_target(params) click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 27
def self.find_target(params)
  project = find_project(params)
  if params[:target]
    target = project.targets.detect { |t| t.name == params[:target] }
    target
  else
    # firstly we are trying to find modern application target
    target = project.targets.detect do |t|
      t.kind_of?(Xcodeproj::Project::Object::PBXNativeTarget) &&
        t.product_type == 'com.apple.product-type.application'
    end
    target = project.targets[0] if target.nil?
    target
  end
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 101
def self.is_supported?(platform)
  # you can do things like
  #
  #  true
  #
  #  platform == :ios
  #
  #  [:ios, :mac].include?(platform)
  #

  platform == :ios
end
output() click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 84
def self.output
  # Define the shared values you are going to provide
  # Example
  [
    ['GET_INFO_PLIST_FILE_PATH_CUSTOM_VALUE', 'A description of what this value contains']
  ]
end
return_value() click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 92
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/ci_apps/actions/get_info_plist_file_path.rb, line 11
def self.run(params)
  project = find_project(params)
  target = find_target(params)
  buildConfiguration = target.build_settings("Release")
  filePath = buildConfiguration["INFOPLIST_FILE"]
  if params[:is_absolute] then
    filePath = File.join(Pathname.new(project.path).parent.to_path, filePath)
  end
  filePath
end