Class: Pindo::TaskSystem::IpaLocalResignTask
- Defined in:
- lib/pindo/module/task/model/resign/ipa_local_resign_task.rb
Overview
IPA 本地重签名任务使用新的证书和 Bundle ID 对 IPA 文件进行重签名
Instance Attribute Summary collapse
-
#build_type ⇒ Object
readonly
Returns the value of attribute build_type.
-
#bundle_id ⇒ Object
readonly
Returns the value of attribute bundle_id.
-
#ipa_file ⇒ Object
readonly
Returns the value of attribute ipa_file.
-
#ipa_path ⇒ Object
readonly
Returns the value of attribute ipa_path.
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #data_dependencies, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #started_at, #status, #task_key, #task_manager, #type
Class Method Summary collapse
- .default_retry_count ⇒ Object
- .default_retry_delay ⇒ Object
-
.default_retry_mode ⇒ Object
重试配置.
-
.task_type ⇒ Object
任务类型.
-
.task_type_name ⇒ Object
任务类型显示名称.
Instance Method Summary collapse
-
#initialize(ipa_path, ipa_file, bundle_id, options = {}) ⇒ IpaLocalResignTask
constructor
初始化重签名任务.
-
#validate ⇒ Object
验证任务参数.
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #data_param, #do_task, #execution_time, #finished?, #get_all_data_params, #get_all_data_params_by_key, #get_all_dependencies_results, #get_data_param, #get_data_param_by_key, #get_dependency_result, #get_dependency_task, #on, #primary_data_param, #reset_for_retry, #retryable?, #running?, #should_retry?, task_key
Constructor Details
#initialize(ipa_path, ipa_file, bundle_id, options = {}) ⇒ IpaLocalResignTask
初始化重签名任务
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 41 def initialize(ipa_path, ipa_file, bundle_id, = {}) @ipa_path = ipa_path # IPA 搜索路径 @ipa_file = ipa_file # 指定的 IPA 文件(nil 表示自动查找) @bundle_id = bundle_id # 目标 Bundle ID @build_type = [:build_type] || 'adhoc' @project_dir = [:project_dir] || Dir.pwd # 设置任务优先级 [:priority] ||= TaskPriority::HIGH super("重签名 IPA", ) end |
Instance Attribute Details
#build_type ⇒ Object (readonly)
Returns the value of attribute build_type.
9 10 11 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 9 def build_type @build_type end |
#bundle_id ⇒ Object (readonly)
Returns the value of attribute bundle_id.
9 10 11 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 9 def bundle_id @bundle_id end |
#ipa_file ⇒ Object (readonly)
Returns the value of attribute ipa_file.
9 10 11 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 9 def ipa_file @ipa_file end |
#ipa_path ⇒ Object (readonly)
Returns the value of attribute ipa_path.
9 10 11 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 9 def ipa_path @ipa_path end |
Class Method Details
.default_retry_count ⇒ Object
26 27 28 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 26 def self.default_retry_count 2 # 允许重试 2 次 end |
.default_retry_delay ⇒ Object
30 31 32 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 30 def self.default_retry_delay 5 # 延迟 5 秒 end |
.default_retry_mode ⇒ Object
重试配置
22 23 24 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 22 def self.default_retry_mode RetryMode::DELAYED end |
.task_type ⇒ Object
任务类型
12 13 14 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 12 def self.task_type :resign end |
.task_type_name ⇒ Object
任务类型显示名称
17 18 19 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 17 def self.task_type_name "重签名" end |
Instance Method Details
#validate ⇒ Object
验证任务参数
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/pindo/module/task/model/resign/ipa_local_resign_task.rb', line 55 def validate # 验证 Bundle ID unless @bundle_id && !@bundle_id.empty? @error = "缺少必需参数: bundle_id" return false end # 验证 build_type unless ['dev', 'adhoc'].include?(@build_type) @error = "无效的 build_type: #{@build_type}(必须是 'dev' 或 'adhoc')" return false end # 验证 ipa_path(当 ipa_file 为空时) if (@ipa_file.nil? || @ipa_file.empty?) unless @ipa_path && !@ipa_path.empty? @error = "缺少必需参数: ipa_path(当 ipa_file 未指定时)" return false end end true end |