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.
-
#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, xcodeproj_path = 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, xcodeproj_path = nil) ⇒ DeployGate::Xcode::Analyze
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/deploygate/xcode/analyze.rb', line 19 def initialize(workspaces, build_configuration = nil, target_scheme = nil, xcodeproj_path = nil) @workspaces = workspaces @build_configuration = build_configuration || DEFAULT_BUILD_CONFIGURATION @build_workspace = find_build_workspace(workspaces) @xcodeproj = xcodeproj_path.presence || find_xcodeproj(workspaces) 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 |
#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
46 47 48 49 50 51 52 53 |
# File 'lib/deploygate/xcode/analyze.rb', line 46 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
37 38 39 40 41 42 43 44 |
# File 'lib/deploygate/xcode/analyze.rb', line 37 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
66 67 68 69 70 71 72 73 |
# File 'lib/deploygate/xcode/analyze.rb', line 66 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
75 76 77 78 79 80 81 |
# File 'lib/deploygate/xcode/analyze.rb', line 75 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
57 58 59 60 61 62 63 64 |
# File 'lib/deploygate/xcode/analyze.rb', line 57 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
83 84 85 86 87 88 |
# File 'lib/deploygate/xcode/analyze.rb', line 83 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 |