Class: Fastlane::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/action.rb

Direct Known Subclasses

Fastlane::Actions::AdbAction, Fastlane::Actions::AdbDevicesAction, Fastlane::Actions::AddGitTagAction, Fastlane::Actions::AppaloosaAction, Fastlane::Actions::AppetizeAction, Fastlane::Actions::AppetizeViewingUrlGeneratorAction, Fastlane::Actions::AppiumAction, Fastlane::Actions::AppledocAction, Fastlane::Actions::AppstoreAction, Fastlane::Actions::ApteligentAction, Fastlane::Actions::ArtifactoryAction, Fastlane::Actions::BackupFileAction, Fastlane::Actions::BackupXcarchiveAction, Fastlane::Actions::BadgeAction, Fastlane::Actions::BuildAndUploadToAppetizeAction, Fastlane::Actions::BundleInstallAction, Fastlane::Actions::CarthageAction, Fastlane::Actions::CertAction, Fastlane::Actions::ChangelogFromGitCommitsAction, Fastlane::Actions::ChatworkAction, Fastlane::Actions::CleanBuildArtifactsAction, Fastlane::Actions::CleanCocoapodsCacheAction, Fastlane::Actions::ClearDerivedDataAction, Fastlane::Actions::ClipboardAction, Fastlane::Actions::ClocAction, Fastlane::Actions::CocoapodsAction, Fastlane::Actions::CommitVersionBumpAction, Fastlane::Actions::CopyArtifactsAction, Fastlane::Actions::CrashlyticsAction, Fastlane::Actions::CreateKeychainAction, Fastlane::Actions::CreatePullRequestAction, Fastlane::Actions::DangerAction, Fastlane::Actions::DebugAction, Fastlane::Actions::DefaultPlatformAction, Fastlane::Actions::DeleteKeychainAction, Fastlane::Actions::DeliverAction, Fastlane::Actions::DeploygateAction, Fastlane::Actions::DotgpgEnvironmentAction, Fastlane::Actions::DownloadAction, Fastlane::Actions::DownloadDsymsAction, Fastlane::Actions::DsymZipAction, Fastlane::Actions::EnsureGitBranchAction, Fastlane::Actions::EnsureGitStatusCleanAction, Fastlane::Actions::EnsureNoDebugCodeAction, Fastlane::Actions::EnsureXcodeVersionAction, Fastlane::Actions::ErbAction, Fastlane::Actions::FastlaneVersionAction, Fastlane::Actions::FlockAction, Fastlane::Actions::FrameitAction, Fastlane::Actions::GcovrAction, Fastlane::Actions::GetBuildNumberAction, Fastlane::Actions::GetBuildNumberRepositoryAction, Fastlane::Actions::GetGithubReleaseAction, Fastlane::Actions::GetInfoPlistValueAction, Fastlane::Actions::GetIpaInfoPlistValueAction, Fastlane::Actions::GetVersionNumberAction, Fastlane::Actions::GitAddAction, Fastlane::Actions::GitBranchAction, Fastlane::Actions::GitCommitAction, Fastlane::Actions::GitPullAction, Fastlane::Actions::GradleAction, Fastlane::Actions::GymAction, Fastlane::Actions::HgAddTagAction, Fastlane::Actions::HgCommitVersionBumpAction, Fastlane::Actions::HgEnsureCleanStatusAction, Fastlane::Actions::HgPushAction, Fastlane::Actions::HipchatAction, Fastlane::Actions::HockeyAction, Fastlane::Actions::IftttAction, Fastlane::Actions::ImportAction, Fastlane::Actions::ImportCertificateAction, Fastlane::Actions::ImportFromGitAction, Fastlane::Actions::IncrementBuildNumberAction, Fastlane::Actions::IncrementVersionNumberAction, Fastlane::Actions::InstallOnDeviceAction, Fastlane::Actions::InstallXcodePluginAction, Fastlane::Actions::InstallrAction, Fastlane::Actions::IpaAction, Fastlane::Actions::IsCiAction, Fastlane::Actions::JazzyAction, Fastlane::Actions::JiraAction, Fastlane::Actions::LaneContextAction, Fastlane::Actions::LastGitCommitAction, Fastlane::Actions::LastGitTagAction, Fastlane::Actions::LatestTestflightBuildNumberAction, Fastlane::Actions::LcovAction, Fastlane::Actions::MailgunAction, Fastlane::Actions::MakeChangelogFromJenkinsAction, Fastlane::Actions::MatchAction, Fastlane::Actions::NexusUploadAction, Fastlane::Actions::NotificationAction, Fastlane::Actions::NotifyAction, Fastlane::Actions::NumberOfCommitsAction, Fastlane::Actions::OclintAction, Fastlane::Actions::OnesignalAction, Fastlane::Actions::OptOutUsageAction, Fastlane::Actions::PemAction, Fastlane::Actions::PilotAction, Fastlane::Actions::PodLibLintAction, Fastlane::Actions::PodPushAction, Fastlane::Actions::PodioItemAction, Fastlane::Actions::ProduceAction, Fastlane::Actions::PromptAction, Fastlane::Actions::PushGitTagsAction, Fastlane::Actions::PushToGitRemoteAction, Fastlane::Actions::PutsAction, Fastlane::Actions::ReadPodspecAction, Fastlane::Actions::RecreateSchemesAction, Fastlane::Actions::RegisterDevicesAction, Fastlane::Actions::ResetGitRepoAction, Fastlane::Actions::ResetSimulatorsAction, Fastlane::Actions::ResignAction, Fastlane::Actions::RestoreFileAction, Fastlane::Actions::RocketAction, Fastlane::Actions::RsyncAction, Fastlane::Actions::S3Action, Fastlane::Actions::SayAction, Fastlane::Actions::ScanAction, Fastlane::Actions::ScpAction, Fastlane::Actions::ScreengrabAction, Fastlane::Actions::SetBuildNumberRepositoryAction, Fastlane::Actions::SetChangelogAction, Fastlane::Actions::SetGithubReleaseAction, Fastlane::Actions::SetInfoPlistValueAction, Fastlane::Actions::SetPodKeyAction, Fastlane::Actions::SetupJenkinsAction, Fastlane::Actions::SighAction, Fastlane::Actions::SkipDocsAction, Fastlane::Actions::SlackAction, Fastlane::Actions::SlatherAction, Fastlane::Actions::SnapshotAction, Fastlane::Actions::SonarAction, Fastlane::Actions::SplunkmintAction, Fastlane::Actions::SshAction, Fastlane::Actions::SupplyAction, Fastlane::Actions::SwiftlintAction, Fastlane::Actions::TeamIdAction, Fastlane::Actions::TeamNameAction, Fastlane::Actions::TestfairyAction, Fastlane::Actions::TestflightAction, Fastlane::Actions::TestmunkAction, Fastlane::Actions::TryoutsAction, Fastlane::Actions::TwitterAction, Fastlane::Actions::TypetalkAction, Fastlane::Actions::UnlockKeychainAction, Fastlane::Actions::UpdateAppGroupIdentifiersAction, Fastlane::Actions::UpdateAppIdentifierAction, Fastlane::Actions::UpdateFastlaneAction, Fastlane::Actions::UpdateIcloudContainerIdentifiersAction, Fastlane::Actions::UpdateInfoPlistAction, Fastlane::Actions::UpdateProjectCodeSigningAction, Fastlane::Actions::UpdateProjectProvisioningAction, Fastlane::Actions::UpdateProjectTeamAction, Fastlane::Actions::UpdateUrbanAirshipConfigurationAction, Fastlane::Actions::UpdateUrlSchemesAction, Fastlane::Actions::UploadSymbolsToCrashlyticsAction, Fastlane::Actions::UploadSymbolsToSentryAction, Fastlane::Actions::VerifyBuildAction, Fastlane::Actions::VerifyPodKeysAction, Fastlane::Actions::VerifyXcodeAction, Fastlane::Actions::VersionBumpPodspecAction, Fastlane::Actions::VersionGetPodspecAction, Fastlane::Actions::XcakeAction, Fastlane::Actions::XcarchiveAction, Fastlane::Actions::XcbuildAction, Fastlane::Actions::XccleanAction, Fastlane::Actions::XcexportAction, Fastlane::Actions::XcodeInstallAction, Fastlane::Actions::XcodeSelectAction, Fastlane::Actions::XcodeServerGetAssetsAction, Fastlane::Actions::XcodebuildAction, Fastlane::Actions::XcovAction, Fastlane::Actions::XctestAction, Fastlane::Actions::XctoolAction, Fastlane::Actions::ZipAction

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.runnerObject

Returns the value of attribute runner.



6
7
8
# File 'lib/fastlane/action.rb', line 6

def runner
  @runner
end

Class Method Details

.action_nameObject

instead of “AddGitAction”, this will return “add_git” to print it to the user



74
75
76
# File 'lib/fastlane/action.rb', line 74

def self.action_name
  self.name.split('::').last.gsub('Action', '').fastlane_underscore
end

.authorObject



43
44
45
# File 'lib/fastlane/action.rb', line 43

def self.author
  nil
end

.authorsObject



47
48
49
# File 'lib/fastlane/action.rb', line 47

def self.authors
  nil
end

.available_optionsObject



21
22
23
24
25
26
27
28
# File 'lib/fastlane/action.rb', line 21

def self.available_options
  # [
  #   FastlaneCore::ConfigItem.new(key: :ipa_path,
  #                                env_name: "CRASHLYTICS_IPA_PATH",
  #                                description: "Value Description")
  # ]
  nil
end

.descriptionObject

Implement in subclasses



13
14
15
# File 'lib/fastlane/action.rb', line 13

def self.description
  "No description provided".red
end

.detailsObject



17
18
19
# File 'lib/fastlane/action.rb', line 17

def self.details
  nil # this is your change to provide a more detailed description of this action
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
54
55
56
57
58
59
60
# File 'lib/fastlane/action.rb', line 51

def self.is_supported?(platform)
  # you can do things like
  #  true
  #
  #  platform == :ios
  #
  #  [:ios, :mac].include?(platform)
  #
  UI.crash!("Implementing `is_supported?` for all actions is mandatory. Please update #{self}")
end

.method_missing(method_sym, *arguments, &_block) ⇒ Object

Allows the user to call an action from an action



79
80
81
82
# File 'lib/fastlane/action.rb', line 79

def self.method_missing(method_sym, *arguments, &_block)
  UI.error("Unknown method '#{method_sym}'")
  UI.user_error!("To call another action from an action use `OtherAction.#{method_sym}` instead")
end

.other_actionObject

Return a new instance of the OtherAction action We need to do this, since it has to have access to the runner object



87
88
89
# File 'lib/fastlane/action.rb', line 87

def self.other_action
  return OtherAction.new(self.runner)
end

.outputObject



30
31
32
33
34
35
36
# File 'lib/fastlane/action.rb', line 30

def self.output
  # Return the keys you provide on the shared area
  # [
  #   ['IPA_OUTPUT_PATH', 'The path to the newly generated ipa file']
  # ]
  nil
end

.return_valueObject



38
39
40
41
# File 'lib/fastlane/action.rb', line 38

def self.return_value
  # Describes what this method returns
  nil
end

.run(params) ⇒ Object



9
10
# File 'lib/fastlane/action.rb', line 9

def self.run(params)
end

.sh(command, print_command: true, print_command_output: true, error_callback: nil) ⇒ Object

to allow a simple ‘sh` in the custom actions



69
70
71
# File 'lib/fastlane/action.rb', line 69

def self.sh(command, print_command: true, print_command_output: true, error_callback: nil)
  Fastlane::Actions.sh_control_output(command, print_command: print_command, print_command_output: print_command_output, error_callback: error_callback)
end

.step_textObject

Is printed out in the Steps: output in the terminal Return nil if you don’t want any logging in the terminal/JUnit Report



64
65
66
# File 'lib/fastlane/action.rb', line 64

def self.step_text
  self.action_name
end