Module: Sigh

Defined in:
sigh/lib/sigh/module.rb,
sigh/lib/sigh/repair.rb,
sigh/lib/sigh/resign.rb,
sigh/lib/sigh/runner.rb,
sigh/lib/sigh/manager.rb,
sigh/lib/sigh/options.rb,
sigh/lib/sigh/download_all.rb,
sigh/lib/sigh/local_manage.rb,
sigh/lib/sigh/commands_generator.rb

Defined Under Namespace

Classes: CommandsGenerator, DownloadAll, LocalManage, Manager, Options, Repair, Resign, Runner

Constant Summary collapse

Helper =

you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore

FastlaneCore::Helper
UI =
FastlaneCore::UI
ROOT =
Pathname.new(File.expand_path('../../..', __FILE__))

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



7
8
9
# File 'sigh/lib/sigh/module.rb', line 7

def config
  @config
end

Class Method Details

.certificate_types_for_profile_and_platform(platform:, profile_type:) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'sigh/lib/sigh/module.rb', line 73

def certificate_types_for_profile_and_platform(platform:, profile_type:)
  types = []

  case platform
  when 'ios', 'tvos'
    if profile_type == Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_DEVELOPMENT || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_DEVELOPMENT
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT,
        Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DEVELOPMENT
      ]
    elsif profile_type == Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_INHOUSE || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_INHOUSE
      # Enterprise accounts don't have access to Apple Distribution certificates
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION
      ]
    # handles case where the desired certificate type is adhoc but the account is an enterprise account
    # the apple dev portal api has a weird quirk in it where if you query for distribution certificates
    # for enterprise accounts, you get nothing back even if they exist.
    elsif (profile_type == Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_ADHOC || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_ADHOC) && Spaceship::ConnectAPI.client && Spaceship::ConnectAPI.client.in_house?
      # Enterprise accounts don't have access to Apple Distribution certificates
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION
      ]
    else
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DISTRIBUTION,
        Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DISTRIBUTION
      ]
    end

  when 'macos', 'catalyst'
    if profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DEVELOPMENT || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DEVELOPMENT
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT,
        Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DEVELOPMENT
      ]
    elsif profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_STORE || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_STORE
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DISTRIBUTION,
        Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DISTRIBUTION
      ]
    elsif profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DIRECT || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DIRECT
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION,
        Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION_G2
      ]
    elsif profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_INHOUSE || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_INHOUSE
      # Enterprise accounts don't have access to Apple Distribution certificates
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DISTRIBUTION
      ]
    else
      types = [
        Spaceship::ConnectAPI::Certificate::CertificateType::DISTRIBUTION,
        Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DISTRIBUTION
      ]
    end
  end

  types
end

.profile_type_for_config(platform:, in_house:, config:) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'sigh/lib/sigh/module.rb', line 37

def profile_type_for_config(platform:, in_house:, config:)
  profile_type = nil

  case platform.to_s
  when "ios"
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_STORE
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_INHOUSE if in_house
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_ADHOC if config[:adhoc]
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_DEVELOPMENT if config[:development]
  when "tvos"
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_STORE
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_INHOUSE if in_house
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_ADHOC if config[:adhoc]
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_DEVELOPMENT if config[:development]
  when "macos"
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_STORE
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_INHOUSE if in_house
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DEVELOPMENT if config[:development]
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DIRECT if config[:developer_id]
  when "catalyst"
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_STORE
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_INHOUSE if in_house
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DEVELOPMENT if config[:development]
    profile_type = Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DIRECT if config[:developer_id]
  end

  profile_type
end

.profile_type_for_distribution_type(platform:, distribution_type:) ⇒ Object



66
67
68
69
70
71
# File 'sigh/lib/sigh/module.rb', line 66

def profile_type_for_distribution_type(platform:, distribution_type:)
  config = { distribution_type.to_sym => true }
  in_house = distribution_type == "enterprise"

  self.profile_type_for_config(platform: platform, in_house: in_house, config: config)
end