Class: Escalator::Command::Resign

Inherits:
Escalator::Command show all
Defined in:
lib/escalator/command/resign.rb

Defined Under Namespace

Classes: Help

Constant Summary

Constants inherited from Escalator::Command

DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Resign

Returns a new instance of Resign.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/escalator/command/resign.rb', line 81

def initialize argv
  @ipaPaths = argv.arguments!.select{ |arg| !arg.empty? }
  @key_id = argv.option "key-id", ""
  @issuer_id = argv.option "issuer-id", ""
  @keyfile_path = argv.option "keyfile-path", ""
  @apple_id = argv.option "apple-id", ""
  @user_password = argv.option "user-password", ""
  @bundle_identifier = argv.option "bundle-identifier", ""
  @short_version = argv.option "short-version", ""
  @bundle_version = argv.option "bundle-version", ""
  @bundle_name = argv.option "bundle-name", ""
  @display_name = argv.option "display-name", ""
  @executable_name = argv.option "executable-name", ""
  @iconAssets_path = argv.option "iconAssets-path", ""
  super
end

Instance Attribute Details

#apple_idObject (readonly)

Returns the value of attribute apple_id.



26
27
28
# File 'lib/escalator/command/resign.rb', line 26

def apple_id
  @apple_id
end

#bundle_identifierObject (readonly)

Returns the value of attribute bundle_identifier.



30
31
32
# File 'lib/escalator/command/resign.rb', line 30

def bundle_identifier
  @bundle_identifier
end

#bundle_nameObject (readonly)

Returns the value of attribute bundle_name.



36
37
38
# File 'lib/escalator/command/resign.rb', line 36

def bundle_name
  @bundle_name
end

#bundle_versionObject (readonly)

Returns the value of attribute bundle_version.



34
35
36
# File 'lib/escalator/command/resign.rb', line 34

def bundle_version
  @bundle_version
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



38
39
40
# File 'lib/escalator/command/resign.rb', line 38

def display_name
  @display_name
end

#executable_nameObject (readonly)

Returns the value of attribute executable_name.



40
41
42
# File 'lib/escalator/command/resign.rb', line 40

def executable_name
  @executable_name
end

#iconAssets_pathObject (readonly)

Returns the value of attribute iconAssets_path.



42
43
44
# File 'lib/escalator/command/resign.rb', line 42

def iconAssets_path
  @iconAssets_path
end

#ipaPathsObject (readonly)

Returns the value of attribute ipaPaths.



18
19
20
# File 'lib/escalator/command/resign.rb', line 18

def ipaPaths
  @ipaPaths
end

#issuer_idObject (readonly)

Returns the value of attribute issuer_id.



22
23
24
# File 'lib/escalator/command/resign.rb', line 22

def issuer_id
  @issuer_id
end

#key_idObject (readonly)

Returns the value of attribute key_id.



20
21
22
# File 'lib/escalator/command/resign.rb', line 20

def key_id
  @key_id
end

#keyfile_pathObject (readonly)

Returns the value of attribute keyfile_path.



24
25
26
# File 'lib/escalator/command/resign.rb', line 24

def keyfile_path
  @keyfile_path
end

#short_versionObject (readonly)

Returns the value of attribute short_version.



32
33
34
# File 'lib/escalator/command/resign.rb', line 32

def short_version
  @short_version
end

#user_passwordObject (readonly)

Returns the value of attribute user_password.



28
29
30
# File 'lib/escalator/command/resign.rb', line 28

def user_password
  @user_password
end

Class Method Details

.optionsObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/escalator/command/resign.rb', line 64

def self.options
  [
    ["--key-id=id", "id 为 Appstore Connect 用户访问密钥的 keyId"],
    ["--issuer-id=id", "id 为 Appstore Connect 用户访问密钥的 issuerId"],
    ["--keyfile-path=path", "path 为 Appstore Connect 用户访问密钥的 .p8 文件保存路径"],
    ["--user-password=password", "password 为当前电脑用户的访问密码"],
    ["--bundle-identifier=identifier", "identifier 为新的唯一标识符"],
    ["--short-version=version", "version 为新的版本号"],
    ["--bundle-version=version", "version 为新的 BuildID, 同一账号下处理多 IPA, 会自动叠加"],
    ["--apple-id=id", "id 为对应的苹果开发者账户, 如果含有 APP GROUP 推荐添加此字段, 默认: 无"],
    ["--bundle-name=name", "name 为新的包名, 默认: 不变"],
    ["--display-name=name", "name 为新的 APP 名称, 默认: 不变"],
    ["--executable-name=name", "name 为新的二进制文件名, 默认: 不变"],
    ["--iconAssets-path=path", "path 为包含新 AppIcon 的 .xcassets 资源文件路径, 默认: 无"]
  ].concat super
end

Instance Method Details

#help!(error_message = nil) ⇒ Object



126
127
128
# File 'lib/escalator/command/resign.rb', line 126

def help!(error_message = nil)
  invoked_command_class.help!(error_message, Help)
end

#runObject



130
131
132
# File 'lib/escalator/command/resign.rb', line 130

def run
  Escalator::Resign.run self
end

#validate!Object



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
# File 'lib/escalator/command/resign.rb', line 98

def validate!
  super
  if ipaPaths.empty?
    help! "未检测到 IPAPATH 参数"
  end
  if key_id.empty?
    help! "未检测到 --key-id 参数"
  end
  if issuer_id.empty?
    help! "未检测到 --issuer-id 参数"
  end
  if keyfile_path.empty?
    help! "未检测到 --keyfile-path 参数"
  end
  if user_password.empty?
    help! "未检测到 --user-password 参数"
  end
  if bundle_identifier.empty?
    help! "未检测到 --bundle-identifier 参数"
  end
  if short_version.empty?
    help! "未检测到 --short-version 参数"
  end
  if bundle_version.empty?
    help! "未检测到 --bundle-version 参数"
  end
end