fir-cli 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 950b4ea3196bb693db53fc7ca7fdc00c74aa2b71
4
- data.tar.gz: 4004385a955dfc2679db2383a5e9f8060619de89
3
+ metadata.gz: 81eb6326b7b1e1ff334ee9d2c0277dcf9e40430f
4
+ data.tar.gz: ff5a608d1a33177c964b5a16ef54606f6c08ddb2
5
5
  SHA512:
6
- metadata.gz: 6fa36221d880aa52c85f20f68abffa8041207ce02c9db4ba589c575454bb5a17c1bfc9de139ec42faef61e5b4a99ebb603831107557bd296f68ca5d1b0fb1ac1
7
- data.tar.gz: 3a8811213616a2c9d7868ef8de12c8345d7ed367e3606f3792e99566f357cdca9ff30f14053b4c5fb6755766f3ae7bef72603c1adb7e6cf084e348dc723f9dc5
6
+ metadata.gz: edefb7042202cbc3f1f633c7640b2e731b6e1b12adff12cd318d89f79f52eab14b7bbcc99930c0919819b05a40a0a5b41543248879d3227ba666531dd6907899
7
+ data.tar.gz: befd4d052fc98329a999a3305558134bd74eb389051ff5aa60ab2b849814aed9e5ec92e7492d761d2f7b198eacc46c9f0b9f61a65d691c896be31f003b7d3ceb
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 更新记录
2
2
 
3
+ ### fir-cli 1.3.2
4
+ - 支持打包提供 app watch 的应用
5
+
3
6
  ### fir-cli 1.3.1
4
7
  - 暂时修复多个 target 的 build 打包 app 的 bug
5
8
 
data/fir-cli.gemspec CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
  /_/ /___/_/ |_| \____/_____/___/
28
28
 
29
29
  ## 更新记录
30
- ### fir-cli 1.3.1
31
- - 暂时修复多个 target 的 build 打包 app bug
30
+ ### fir-cli 1.3.2
31
+ - 已经支持打包提供 app watch 的应用
32
32
  - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG
33
33
  - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源
34
34
  - 欢迎 fork, issue 和 pull request
@@ -45,7 +45,12 @@ module FIR
45
45
  logger.info 'Building......'
46
46
  logger_info_dividing_line
47
47
 
48
- logger.info `#{@build_cmd}`
48
+ status = system(@build_cmd)
49
+
50
+ unless status
51
+ logger.error 'Build failed'
52
+ exit 1
53
+ end
49
54
  end
50
55
 
51
56
  # split ['a=1', 'b=2'] => { 'a' => '1', 'b' => '2' }
@@ -45,24 +45,45 @@ module FIR
45
45
  end
46
46
 
47
47
  def output_ipa_and_dsym
48
- Dir.chdir(@build_tmp_dir) do
49
- apps = Dir['*.app'].sort_by(&:size)
50
- check_no_output_app(apps)
48
+ apps = Dir["#{@build_tmp_dir}/*.app"].sort_by(&:size)
49
+ check_no_output_app(apps)
51
50
 
52
- temp_ipa = zip_app2ipa(File.join(@build_tmp_dir, apps.first))
53
- ipa_info = FIR.ipa_info(temp_ipa)
54
- ipa_name = "#{ipa_info[:name]}-#{ipa_info[:version]}-build-#{ipa_info[:build]}"
55
- dsym_name = "#{@output_path}/#{ipa_info[:name]}.app.dSYM"
51
+ @temp_ipa = "#{@build_tmp_dir}/#{Time.now.to_i}.ipa"
52
+ archive_ipa(apps)
56
53
 
57
- @builded_app_path = "#{@output_path}/#{ipa_name}.ipa"
54
+ check_archived_ipa_is_exist
55
+ rename_ipa_and_dsym
58
56
 
59
- FileUtils.mv(temp_ipa, @builded_app_path, force: true)
60
- if File.exist?(dsym_name)
61
- FileUtils.mv(dsym_name, "#{@output_path}/#{ipa_name}.app.dSYM", force: true)
62
- end
57
+ logger.info 'Build Success'
58
+ end
59
+
60
+ def archive_ipa(apps)
61
+ logger.info 'Archiving......'
62
+ logger_info_dividing_line
63
+
64
+ @xcrun_cmd = "xcrun -sdk iphoneos PackageApplication -v #{apps.join(' ')} -o #{@temp_ipa}"
65
+ puts @xcrun_cmd if $DEBUG
66
+ logger.info `#{@xcrun_cmd}`
67
+ end
68
+
69
+ def check_archived_ipa_is_exist
70
+ unless File.exist?(@temp_ipa)
71
+ logger.error 'Archive failed'
72
+ exit 1
63
73
  end
74
+ end
64
75
 
65
- logger.info 'Build Success'
76
+ def rename_ipa_and_dsym
77
+ ipa_info = FIR.ipa_info(@temp_ipa)
78
+ ipa_name = "#{ipa_info[:name]}-#{ipa_info[:version]}-build-#{ipa_info[:build]}"
79
+ dsym_name = "#{@output_path}/#{ipa_info[:name]}.app.dSYM"
80
+
81
+ @builded_app_path = "#{@output_path}/#{ipa_name}.ipa"
82
+
83
+ FileUtils.mv(@temp_ipa, @builded_app_path, force: true)
84
+ if File.exist?(dsym_name)
85
+ FileUtils.mv(dsym_name, "#{@output_path}/#{ipa_name}.app.dSYM", force: true)
86
+ end
66
87
  end
67
88
 
68
89
  def upload_build_dsym_mapping_file
@@ -124,20 +145,5 @@ module FIR
124
145
  exit 1
125
146
  end
126
147
  end
127
-
128
- def zip_app2ipa(app_path)
129
- ipa_path = Tempfile.new(['temp', '.ipa']).path
130
-
131
- Dir.mktmpdir do |tmpdir|
132
- Dir.chdir(tmpdir) do
133
- Dir.mkdir('Payload')
134
- FileUtils.cp_r(app_path, 'Payload')
135
- system("rm -rf #{ipa_path}") if File.file?(ipa_path)
136
- system("zip -qr #{ipa_path} Payload")
137
- end
138
- end
139
-
140
- ipa_path
141
- end
142
148
  end
143
149
  end
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '1.3.1'
4
+ VERSION = '1.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
@@ -196,9 +196,9 @@ metadata: {}
196
196
  post_install_message: "\n ______________ ________ ____\n /
197
197
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
198
198
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
199
- \ ## 更新记录\n ### fir-cli 1.3.1\n - 暂时修复多个 target 的 build 打包 app bug\n - 详细更新记录,
200
- 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n - [fir-cli](https://github.com/FIRHQ/fir-cli)
201
- 已经开源\n - 欢迎 fork, issue 和 pull request\n "
199
+ \ ## 更新记录\n ### fir-cli 1.3.2\n - 已经支持打包提供 app watch 的应用\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
200
+ \ - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
201
+ request\n "
202
202
  rdoc_options: []
203
203
  require_paths:
204
204
  - lib