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::CreateAppOnManagedPlayStoreAction, 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::DownloadFromPlayStoreAction, 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::GetManagedPlayStorePublishingRightsAction, 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,
  :app_store_connect,
  :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.



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

def runner
  @runner
end

Class Method Details

.action_nameObject

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



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

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

.authorObject



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

def self.author
  nil
end

.authorsObject



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

def self.authors
  nil
end

.available_optionsObject



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

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



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

def self.category
  :undefined
end

.deprecated_notesObject

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



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

def self.deprecated_notes
  nil
end

.descriptionObject

Implement in subclasses



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

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

.detailsObject



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

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

.example_codeObject

Returns an array of string of sample usage of this action



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

def self.example_code
  nil
end

.is_supported?(platform) ⇒ Boolean

Returns:



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

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



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

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



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

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



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

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

.outputObject



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

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



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

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

.return_valueObject



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

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

.run(params) ⇒ Object



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

def self.run(params)
end

.sample_return_valueObject



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

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:



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

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



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

def self.step_text
  self.action_name
end