Class: DeployGate::Xcode::Analyze
- Inherits:
-
Object
- Object
- DeployGate::Xcode::Analyze
- Defined in:
- lib/deploygate/xcode/analyze.rb
Defined Under Namespace
Classes: BundleIdentifierDifferentError
Constant Summary collapse
- BASE_WORK_DIR_NAME =
'project.xcworkspace'
- DEFAULT_BUILD_CONFIGURATION =
'Release'
- PROVISIONING_STYLE_AUTOMATIC =
'Automatic'
- PROVISIONING_STYLE_MANUAL =
'Manual'
Instance Attribute Summary collapse
-
#build_workspace ⇒ Object
readonly
Returns the value of attribute build_workspace.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#scheme_workspace ⇒ Object
readonly
Returns the value of attribute scheme_workspace.
-
#workspaces ⇒ Object
readonly
Returns the value of attribute workspaces.
-
#xcodeproj ⇒ Object
readonly
Returns the value of attribute xcodeproj.
Instance Method Summary collapse
- #code_sign_identity ⇒ Object
- #code_sign_style ⇒ Object
- #developer_team ⇒ Object
- #initialize(workspaces, build_configuration = nil, target_scheme = nil) ⇒ DeployGate::Xcode::Analyze constructor
- #project_profile_info ⇒ Object
-
#target_bundle_identifier ⇒ String
TODO: Need to support UDID additions for watchOS and App Extension.
- #target_provisioning_profile ⇒ Object
Constructor Details
#initialize(workspaces, build_configuration = nil, target_scheme = nil) ⇒ DeployGate::Xcode::Analyze
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/deploygate/xcode/analyze.rb', line 19 def initialize(workspaces, build_configuration = nil, target_scheme = nil) @workspaces = workspaces @build_configuration = build_configuration || DEFAULT_BUILD_CONFIGURATION @scheme_workspace = find_scheme_workspace(workspaces) @build_workspace = find_build_workspace(workspaces) @xcodeproj = File.dirname(@scheme_workspace) config = FastlaneCore::Configuration.create(Gym::Options., { project: @xcodeproj }) Gym.config = config @project = FastlaneCore::Project.new(config) if @project.schemes.length > 1 && target_scheme && @project.schemes.include?(target_scheme) @project.[:scheme] = target_scheme else @project.select_scheme end @scheme = @project.[:scheme] end |
Instance Attribute Details
#build_workspace ⇒ Object (readonly)
Returns the value of attribute build_workspace.
4 5 6 |
# File 'lib/deploygate/xcode/analyze.rb', line 4 def build_workspace @build_workspace end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
4 5 6 |
# File 'lib/deploygate/xcode/analyze.rb', line 4 def scheme @scheme end |
#scheme_workspace ⇒ Object (readonly)
Returns the value of attribute scheme_workspace.
4 5 6 |
# File 'lib/deploygate/xcode/analyze.rb', line 4 def scheme_workspace @scheme_workspace end |
#workspaces ⇒ Object (readonly)
Returns the value of attribute workspaces.
4 5 6 |
# File 'lib/deploygate/xcode/analyze.rb', line 4 def workspaces @workspaces end |
#xcodeproj ⇒ Object (readonly)
Returns the value of attribute xcodeproj.
4 5 6 |
# File 'lib/deploygate/xcode/analyze.rb', line 4 def xcodeproj @xcodeproj end |
Instance Method Details
#code_sign_identity ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/deploygate/xcode/analyze.rb', line 47 def code_sign_identity identity = nil resolve_build_configuration do |build_configuration, target| identity = build_configuration.resolve_build_setting("CODE_SIGN_IDENTITY", target) end identity end |
#code_sign_style ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/deploygate/xcode/analyze.rb', line 38 def code_sign_style style = nil resolve_build_configuration do |build_configuration, target| style = build_configuration.resolve_build_setting("CODE_SIGN_STYLE", target) end style end |
#developer_team ⇒ Object
67 68 69 70 71 72 73 74 |
# File 'lib/deploygate/xcode/analyze.rb', line 67 def developer_team team = nil resolve_build_configuration do |build_configuration, target| team = build_configuration.resolve_build_setting("DEVELOPMENT_TEAM", target) end team end |
#project_profile_info ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/deploygate/xcode/analyze.rb', line 76 def project_profile_info gym = Gym::CodeSigningMapping.new(project: @project) { provisioningProfiles: gym.detect_project_profile_mapping } end |
#target_bundle_identifier ⇒ String
TODO: Need to support UDID additions for watchOS and App Extension
58 59 60 61 62 63 64 65 |
# File 'lib/deploygate/xcode/analyze.rb', line 58 def target_bundle_identifier bundle_identifier = nil resolve_build_configuration do |build_configuration, target| bundle_identifier = build_configuration.resolve_build_setting("PRODUCT_BUNDLE_IDENTIFIER", target) end bundle_identifier end |
#target_provisioning_profile ⇒ Object
84 85 86 87 88 89 |
# File 'lib/deploygate/xcode/analyze.rb', line 84 def target_provisioning_profile gym = Gym::CodeSigningMapping.new(project: @project) bundle_id = target_bundle_identifier Xcode::Export.provisioning_profile(bundle_id, nil, developer_team, gym.merge_profile_mapping[bundle_id.to_sym]) end |