Module: SecureKeys::Globals
- Defined in:
- lib/core/globals/globals.rb
Class Method Summary collapse
-
.add_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be added.
-
.ci? ⇒ Bool
Source: github.com/fastlane/fastlane/blob/b626fb18597eee88de0e08beba77070e2fecc299/fastlane_core/lib/fastlane_core/helper.rb#L73 Check if the current build is running on a CI.
-
.circle_ci? ⇒ Bool
Check if the current build is running on CircleCI.
-
.default_key_access_identifier ⇒ String
Returns the default key access identifier.
-
.default_key_delimiter ⇒ String
Returns the default keys delimiter.
-
.generate_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be generated.
-
.ios_platforms ⇒ Array
Returns the supported iOS platforms.
-
.key_access_identifier ⇒ String
Returns the identifier to get all the key names.
-
.key_delimiter ⇒ String
Returns the keys delimiter.
-
.replace_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be replaced.
-
.secret_keys_source ⇒ Object
Determine the secret keys source based on the environment.
-
.secure_keys_xcframework_path ⇒ String
Returns the secure keys XCFramework path.
-
.verbose? ⇒ Bool
Check if the current instance is verbose.
-
.xcodeproj_path ⇒ String
Returns the Xcode project path.
Class Method Details
.add_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be added
54 55 56 57 58 |
# File 'lib/core/globals/globals.rb', line 54 def add_xcframework? Core::Console::Argument::Handler.fetch(key: %i[xcframework add]) .to_s .to_boolean end |
.ci? ⇒ Bool
Source: github.com/fastlane/fastlane/blob/b626fb18597eee88de0e08beba77070e2fecc299/fastlane_core/lib/fastlane_core/helper.rb#L73 Check if the current build is running on a CI
13 14 15 16 17 18 19 20 |
# File 'lib/core/globals/globals.rb', line 13 def ci? return true if circle_ci? # Check for Jenkins, Travis CI, ... environment variables %w[JENKINS_HOME JENKINS_URL TRAVIS CI APPCENTER_BUILD_ID TEAMCITY_VERSION GO_PIPELINE_NAME bamboo_buildKey GITLAB_CI XCS TF_BUILD GITHUB_ACTION GITHUB_ACTIONS BITRISE_IO BUDDY CODEBUILD_BUILD_ARN].any? do |current| ENV[current].to_s.to_boolean end || Core::Console::Argument::Handler.fetch(key: :ci).to_s.to_boolean end |
.circle_ci? ⇒ Bool
Check if the current build is running on CircleCI
24 25 26 |
# File 'lib/core/globals/globals.rb', line 24 def circle_ci? ENV.key?('CIRCLECI') end |
.default_key_access_identifier ⇒ String
Returns the default key access identifier
112 113 114 |
# File 'lib/core/globals/globals.rb', line 112 def default_key_access_identifier 'secure-keys' end |
.default_key_delimiter ⇒ String
Returns the default keys delimiter
118 119 120 |
# File 'lib/core/globals/globals.rb', line 118 def default_key_delimiter ',' end |
.generate_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be generated
38 39 40 41 42 |
# File 'lib/core/globals/globals.rb', line 38 def generate_xcframework? Core::Console::Argument::Handler.fetch(key: :generate) .to_s .to_boolean end |
.ios_platforms ⇒ Array
Returns the supported iOS platforms
83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/core/globals/globals.rb', line 83 def ios_platforms [ { name: 'iOS Simulator', path: 'iphonesimulator' }, { name: 'iOS', path: 'iphoneos' } ] end |
.key_access_identifier ⇒ String
Returns the identifier to get all the key names
98 99 100 101 |
# File 'lib/core/globals/globals.rb', line 98 def key_access_identifier Core::Console::Argument::Handler.fetch(key: :identifier, default: default_key_access_identifier) end |
.key_delimiter ⇒ String
Returns the keys delimiter
105 106 107 108 |
# File 'lib/core/globals/globals.rb', line 105 def key_delimiter Core::Console::Argument::Handler.fetch(key: :delimiter, default: default_key_delimiter) end |
.replace_xcframework? ⇒ Bool
Check if the SecureKeys XCFramework should be replaced
46 47 48 49 50 |
# File 'lib/core/globals/globals.rb', line 46 def replace_xcframework? Core::Console::Argument::Handler.fetch(key: %i[xcframework replace]) .to_s .to_boolean end |
.secret_keys_source ⇒ Object
Determine the secret keys source based on the environment
75 76 77 78 79 |
# File 'lib/core/globals/globals.rb', line 75 def secret_keys_source return SecureKeys::Core::Environment::CI.new if ci? SecureKeys::Core::Environment::Keychain.new end |
.secure_keys_xcframework_path ⇒ String
Returns the secure keys XCFramework path
69 70 71 |
# File 'lib/core/globals/globals.rb', line 69 def secure_keys_xcframework_path Dir.glob("**/#{Swift::KEYS_DIRECTORY}/#{Swift::XCFRAMEWORK_DIRECTORY}").first end |