Class: Fastlane::Action

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

Direct Known Subclasses

Fastlane::Actions::AdbAction, Fastlane::Actions::AdbDevicesAction, Fastlane::Actions::AddExtraPlatformsAction, Fastlane::Actions::AddGitTagAction, Fastlane::Actions::AppStoreBuildNumberAction, Fastlane::Actions::AppaloosaAction, Fastlane::Actions::AppetizeAction, Fastlane::Actions::AppetizeViewingUrlGeneratorAction, Fastlane::Actions::AppiumAction, Fastlane::Actions::AppledocAction, Fastlane::Actions::ApteligentAction, Fastlane::Actions::ArtifactoryAction, Fastlane::Actions::AutomaticCodeSigningAction, Fastlane::Actions::BackupFileAction, Fastlane::Actions::BackupXcarchiveAction, Fastlane::Actions::BadgeAction, Fastlane::Actions::BuildAndUploadToAppetizeAction, Fastlane::Actions::BuildIosAppAction, Fastlane::Actions::BundleInstallAction, Fastlane::Actions::CaptureAndroidScreenshotsAction, Fastlane::Actions::CaptureIosScreenshotsAction, Fastlane::Actions::CarthageAction, Fastlane::Actions::ChangelogFromGitCommitsAction, Fastlane::Actions::ChatworkAction, Fastlane::Actions::CheckAppStoreMetadataAction, Fastlane::Actions::CleanBuildArtifactsAction, Fastlane::Actions::CleanCocoapodsCacheAction, Fastlane::Actions::ClearDerivedDataAction, Fastlane::Actions::ClipboardAction, Fastlane::Actions::ClocAction, Fastlane::Actions::CocoapodsAction, Fastlane::Actions::CommitGithubFileAction, Fastlane::Actions::CommitVersionBumpAction, Fastlane::Actions::CopyArtifactsAction, Fastlane::Actions::CrashlyticsAction, Fastlane::Actions::CreateAppOnlineAction, Fastlane::Actions::CreateKeychainAction, Fastlane::Actions::CreatePullRequestAction, Fastlane::Actions::DangerAction, Fastlane::Actions::DebugAction, Fastlane::Actions::DefaultPlatformAction, Fastlane::Actions::DeleteKeychainAction, 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::EnvironmentVariableAction, Fastlane::Actions::ErbAction, Fastlane::Actions::FlockAction, Fastlane::Actions::FrameScreenshotsAction, Fastlane::Actions::GcovrAction, Fastlane::Actions::GetBuildNumberAction, Fastlane::Actions::GetBuildNumberRepositoryAction, Fastlane::Actions::GetCertificatesAction, Fastlane::Actions::GetGithubReleaseAction, Fastlane::Actions::GetInfoPlistValueAction, Fastlane::Actions::GetIpaInfoPlistValueAction, Fastlane::Actions::GetProvisioningProfileAction, Fastlane::Actions::GetPushCertificateAction, Fastlane::Actions::GetVersionNumberAction, Fastlane::Actions::GitAddAction, Fastlane::Actions::GitBranchAction, Fastlane::Actions::GitCommitAction, Fastlane::Actions::GitPullAction, Fastlane::Actions::GitSubmoduleUpdateAction, Fastlane::Actions::GitTagExistsAction, Fastlane::Actions::GithubApiAction, Fastlane::Actions::GooglePlayTrackVersionCodesAction, Fastlane::Actions::GradleAction, 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::MinFastlaneVersionAction, Fastlane::Actions::ModifyServicesAction, Fastlane::Actions::NexusUploadAction, Fastlane::Actions::NotificationAction, Fastlane::Actions::NotifyAction, Fastlane::Actions::NumberOfCommitsAction, Fastlane::Actions::OclintAction, Fastlane::Actions::OnesignalAction, Fastlane::Actions::OptOutCrashReportingAction, Fastlane::Actions::OptOutUsageAction, Fastlane::Actions::PodLibLintAction, Fastlane::Actions::PodPushAction, Fastlane::Actions::PodioItemAction, Fastlane::Actions::PromptAction, Fastlane::Actions::PushGitTagsAction, Fastlane::Actions::PushToGitRemoteAction, Fastlane::Actions::PutsAction, Fastlane::Actions::ReadPodspecAction, Fastlane::Actions::RecreateSchemesAction, Fastlane::Actions::RegisterDeviceAction, Fastlane::Actions::RegisterDevicesAction, Fastlane::Actions::ResetGitRepoAction, Fastlane::Actions::ResetSimulatorContentsAction, Fastlane::Actions::ResignAction, Fastlane::Actions::RestoreFileAction, Fastlane::Actions::RocketAction, Fastlane::Actions::RsyncAction, Fastlane::Actions::RubyVersionAction, Fastlane::Actions::RunTestsAction, Fastlane::Actions::S3Action, Fastlane::Actions::SayAction, Fastlane::Actions::ScpAction, Fastlane::Actions::SetBuildNumberRepositoryAction, Fastlane::Actions::SetChangelogAction, Fastlane::Actions::SetGithubReleaseAction, Fastlane::Actions::SetInfoPlistValueAction, Fastlane::Actions::SetPodKeyAction, Fastlane::Actions::SetupCircleCiAction, Fastlane::Actions::SetupJenkinsAction, Fastlane::Actions::SetupTravisAction, Fastlane::Actions::ShAction, Fastlane::Actions::SkipDocsAction, Fastlane::Actions::SlackAction, Fastlane::Actions::SlatherAction, Fastlane::Actions::SonarAction, Fastlane::Actions::SplunkmintAction, Fastlane::Actions::SpmAction, Fastlane::Actions::SshAction, Fastlane::Actions::SwiftlintAction, Fastlane::Actions::SyncCodeSigningAction, Fastlane::Actions::TeamIdAction, Fastlane::Actions::TeamNameAction, Fastlane::Actions::TestfairyAction, 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::UpdatePlistAction, Fastlane::Actions::UpdateProjectCodeSigningAction, Fastlane::Actions::UpdateProjectProvisioningAction, Fastlane::Actions::UpdateProjectTeamAction, Fastlane::Actions::UpdateUrbanAirshipConfigurationAction, Fastlane::Actions::UpdateUrlSchemesAction, Fastlane::Actions::UploadSymbolsToCrashlyticsAction, Fastlane::Actions::UploadSymbolsToSentryAction, Fastlane::Actions::UploadToAppStoreAction, Fastlane::Actions::UploadToPlayStoreAction, Fastlane::Actions::UploadToTestflightAction, Fastlane::Actions::VerifyBuildAction, Fastlane::Actions::VerifyPodKeysAction, Fastlane::Actions::VerifyXcodeAction, Fastlane::Actions::VersionBumpPodspecAction, Fastlane::Actions::VersionGetPodspecAction, 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::XcversionAction, Fastlane::Actions::ZipAction

Constant Summary collapse

AVAILABLE_CATEGORIES =
[
  :testing,
  :building,
  :screenshots,
  :project,
  :code_signing,
  :documentation,
  :beta,
  :push,
  :production,
  :source_control,
  :notifications,
  :misc,
  :deprecated # This should be the last item
]
RETURN_TYPES =
[
  :string,
  :array_of_strings,
  :hash_of_strings,
  :hash,
  :bool,
  :int
]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.runnerObject

Returns the value of attribute runner.



32
33
34
# File 'fastlane/lib/fastlane/action.rb', line 32

def runner
  @runner
end

Class Method Details

.action_nameObject

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



122
123
124
# File 'fastlane/lib/fastlane/action.rb', line 122

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

.authorObject



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

def self.author
  nil
end

.authorsObject



90
91
92
# File 'fastlane/lib/fastlane/action.rb', line 90

def self.authors
  nil
end

.available_optionsObject



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

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

.categoryObject

Documentation category, available values defined in AVAILABLE_CATEGORIES



117
118
119
# File 'fastlane/lib/fastlane/action.rb', line 117

def self.category
  :undefined
end

.deprecated_notesObject

Describes how the user should handle deprecated an action if its deprecated Returns a string (or nil)



150
151
152
# File 'fastlane/lib/fastlane/action.rb', line 150

def self.deprecated_notes
  nil
end

.descriptionObject

Implement in subclasses



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

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

.detailsObject



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

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

.example_codeObject

Returns an array of string of sample usage of this action



106
107
108
# File 'fastlane/lib/fastlane/action.rb', line 106

def self.example_code
  nil
end

.is_supported?(platform) ⇒ Boolean

Returns:



94
95
96
97
98
99
100
101
102
103
# File 'fastlane/lib/fastlane/action.rb', line 94

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

.lane_contextObject



126
127
128
# File 'fastlane/lib/fastlane/action.rb', line 126

def self.lane_context
  Actions.lane_context
end

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

Allows the user to call an action from an action



131
132
133
134
# File 'fastlane/lib/fastlane/action.rb', line 131

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 `other_action.#{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



144
145
146
# File 'fastlane/lib/fastlane/action.rb', line 144

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

.outputObject



61
62
63
64
65
66
67
# File 'fastlane/lib/fastlane/action.rb', line 61

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_typeObject



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

def self.return_type
  # Describes what type of data is expected to be returned, see RETURN_TYPES
  nil
end

.return_valueObject



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

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

.run(params) ⇒ Object



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

def self.run(params)
end

.sample_return_valueObject



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

def self.sample_return_value
  # Very optional
  # You can return a sample return value, that might be returned by the actual action
  # This is currently only used when generating the documentation and running its tests
  nil
end

.shell_out_should_use_bundle_exec?Boolean

When shelling out from the actoin, should we use ‘bundle exec`?

Returns:



137
138
139
# File 'fastlane/lib/fastlane/action.rb', line 137

def self.shell_out_should_use_bundle_exec?
  return File.exist?('Gemfile') && !Helper.contained_fastlane?
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



112
113
114
# File 'fastlane/lib/fastlane/action.rb', line 112

def self.step_text
  self.action_name
end