Class: Pindo::Command::Appstore::Quswark
- Inherits:
-
Pindo::Command::Appstore
- Object
- CLAide::Command
- Pindo::Command
- Pindo::Command::Appstore
- Pindo::Command::Appstore::Quswark
- Defined in:
- lib/pindo/command/appstore/quswark.rb
Constant Summary
Constants inherited from Pindo::Command
DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS
Instance Attribute Summary
Attributes inherited from Pindo::Command
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Quswark
constructor
A new instance of Quswark.
- #run ⇒ Object
Methods inherited from Pindo::Command
command_name, #initialize_options, run, use_cache?, #validate!
Methods included from Funlog::Mixin
Methods included from Pindoconfig::Mixin
Constructor Details
#initialize(argv) ⇒ Quswark
Returns a new instance of Quswark.
37 38 39 40 |
# File 'lib/pindo/command/appstore/quswark.rb', line 37 def initialize(argv) super @additional_args = argv.remainder! end |
Class Method Details
.options ⇒ Object
31 32 33 34 35 |
# File 'lib/pindo/command/appstore/quswark.rb', line 31 def self. [ ].concat(super) end |
Instance Method Details
#run ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/pindo/command/appstore/quswark.rb', line 42 def run project_dir = Dir.pwd config_file = File.join(project_dir, "config.json") # 加载配置 config_parser = Pindo::IosConfigParser.instance config_parser.load_config(config_file: config_file) config_json = config_parser.config_json if config_json.nil? || config_json.empty? raise Informative, "配置未加载,请检查配置文件: #{config_file}" end # 始终使用 release 模式 build_type = 'release' # 根据配置决定使用 Quark 还是 Swark if config_json['project_info']['xcode_build_type'] && config_json["project_info"]["xcode_build_type"].include?("quark") success = Pindo::XcodeSwarkHelper.quark_run( project_dir: project_dir, config_json: config_json, build_type: build_type ) unless success raise Informative, "Quark 配置失败,请检查日志" end else # 默认使用 Swark success = Pindo::XcodeSwarkHelper.swark_run( project_dir: project_dir, config_json: config_json, build_type: build_type ) unless success raise Informative, "Swark 配置失败,请检查日志" end end end |