fir-cli 1.1.9 → 1.2.0

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: 849113cc22122894e41d6f9fb313812fbd64c97b
4
- data.tar.gz: 001404da307f8e5150590a597dd187b2f55723d4
3
+ metadata.gz: 85cb3f2688de5e0dd74a001f357796100a54d6c8
4
+ data.tar.gz: eae5c2263e4feffdc6a19481f85a617e97359e91
5
5
  SHA512:
6
- metadata.gz: 316b2e5b3febc05fa320d66b8cec8d5e8da64c23ea1f5a3954cf14fd98621becf10ab1ed6c872ca764974a4b44a84d87bbbb7e59f42ec74163ee6d00e444cd5b
7
- data.tar.gz: 5474a245a6082418d90147169ef5595d6918d67c9de1a02df7a1ec9e0c5a50ced1408c10ea6371d493dde98ed8af98f41537b133ef1ca2d30234a925c3a111d3
6
+ metadata.gz: b1166ed1b1795df22622890b833fca45deb94be99bd476864725245c272958413ad79bdeaab2c5e3b9966750ca641c809f53928102df60e0c9597c2d7aa7d24c
7
+ data.tar.gz: 68d673c6d73dea305ff54dafe6c37f875893ee0e78f205a258522ddcaafec10c773337235c4a58087a7fb8c77416ba2fe1997a1d63bcfd86e8014b16779a698e
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 更新记录
2
2
 
3
+ ### FIR-CLI 1.2.0
4
+ - 支持 zip 符号表文件上传
5
+
3
6
  ### FIR-CLI 1.1.9
4
7
  - 修改显示上的一些小问题
5
8
 
data/fir-cli.gemspec CHANGED
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
28
28
  /_/ /___/_/ |_| \____/_____/___/
29
29
 
30
30
  ## 更新记录
31
- ### FIR-CLI 1.1.9
31
+ ### FIR-CLI 1.2.0
32
32
  - 完全兼容新版 API ✔
33
33
  - 请使用新版 API Token
34
34
  - 新版 API Token 查看地址: `http://fir.im/user/info`
35
35
  - 增加符号表上传指令, `fir mapping(alias m)`
36
- - 有以下三种方式上传符号表(目前已经支持 dSYM 和 txt 两种格式的符号表文件上传)
36
+ - 有以下三种方式上传符号表(目前已经支持 dSYM, txt zip 三种格式的符号表文件上传)
37
37
  - 1. 指定 version 和 build 上传: `fir m <mapping file path> -P <bughd project id> -v <app version> -b <app build> -T <your api token>`
38
38
  - 2. 在 publish 的时候自动上传: `fir p <app file path> -m <mapping file path> -P <bughd project id> -T <your api token>`
39
39
  - 3. 在 build_ipa 的时候自动上传: `fir b <project dir> -P <bughd project id> -M -p -T <your api token>`
@@ -134,18 +134,16 @@ module FIR
134
134
  end
135
135
  end
136
136
 
137
- private
138
-
139
- # convert ['a=1', 'b=2'] => { 'a' => '1', 'b' => '2' }
140
- def parse_ipa_custom_settings args
141
- hash = {}
142
- args.each do |setting|
143
- k, v = setting.split('=', 2).map(&:strip)
144
- hash[k] = v
145
- end
146
-
147
- hash
137
+ # convert ['a=1', 'b=2'] => { 'a' => '1', 'b' => '2' }
138
+ def parse_ipa_custom_settings args
139
+ hash = {}
140
+ args.each do |setting|
141
+ k, v = setting.split('=', 2).map(&:strip)
142
+ hash[k] = v
148
143
  end
149
144
 
145
+ hash
146
+ end
147
+
150
148
  end
151
149
  end
@@ -20,9 +20,9 @@ module FIR
20
20
  @full_version = find_or_create_bughd_full_version
21
21
 
22
22
  logger.info "Uploading mapping file......."
23
- logger_info_dividing_line
24
23
 
25
24
  upload_mapping_file
25
+ logger_info_dividing_line
26
26
 
27
27
  logger.info "Uploaded succeed: #{bughd_api[:domain]}/project/#{@proj}/settings"
28
28
  logger_info_blank_line
@@ -34,15 +34,7 @@ module FIR
34
34
  end
35
35
 
36
36
  def upload_mapping_file
37
- if File.is_dsym?(@file_path)
38
- tmp_file_path = "#{Dir.tmpdir}/#{File.basename(@file_path)}-fircli.dSYM"
39
- FileUtils.cp(@file_path, tmp_file_path)
40
- elsif File.is_txt?(@file_path)
41
- tmp_file_path = "#{Dir.tmpdir}/#{File.basename(@file_path)}-fircli.txt"
42
- FileUtils.cp(@file_path, tmp_file_path)
43
- else
44
- tmp_file_path = @file_path
45
- end
37
+ tmp_file_path = rename_and_zip_mapping_file
46
38
 
47
39
  url = bughd_api[:full_version_url] + "/#{@full_version[:id]}"
48
40
  patch url, file: File.new(tmp_file_path, 'rb'), project_id: @proj, uuid: uuid
@@ -61,5 +53,34 @@ module FIR
61
53
  @uuid ||= fetch_user_uuid(@token)
62
54
  end
63
55
 
56
+ def rename_and_zip_mapping_file
57
+ tmp_file_path = "#{Dir.tmpdir}/#{File.basename(@file_path)}-fircli"
58
+ FileUtils.cp(@file_path, tmp_file_path)
59
+
60
+ mapping_file_size = File.size?(tmp_file_path)
61
+
62
+ logger.info "Mapping file size - #{mapping_file_size}"
63
+
64
+ if mapping_file_size > 50*1000*1000
65
+ logger.info "Zipping mapping file......."
66
+
67
+ system("zip -qr #{tmp_file_path}.zip #{tmp_file_path}")
68
+
69
+ tmp_file_path = tmp_file_path + '.zip'
70
+
71
+ logger.info "Zipped Mapping file size - #{File.size?(tmp_file_path)}"
72
+ end
73
+
74
+ if File.is_dsym?(@file_path)
75
+ FileUtils.mv(tmp_file_path, tmp_file_path + '.dSYM')
76
+ tmp_file_path = tmp_file_path + '.dSYM'
77
+ elsif File.is_txt?(@file_path)
78
+ FileUtils.mv(tmp_file_path, tmp_file_path + '.txt')
79
+ tmp_file_path = tmp_file_path + '.txt'
80
+ end
81
+
82
+ tmp_file_path
83
+ end
84
+
64
85
  end
65
86
  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.1.9"
4
+ VERSION = "1.2.0"
5
5
  end
data/test/mapping_test.rb CHANGED
@@ -12,6 +12,7 @@ class MappingTest < Minitest::Test
12
12
  if ENV['TEST_MAPPING']
13
13
  assert FIR.mapping(default_dsym_mapping, options.merge(proj: default_bughd_project_ios_id))
14
14
  assert FIR.mapping(default_txt_mapping, options.merge(proj: default_bughd_project_android_id))
15
+ assert FIR.mapping(bigger_txt_mapping, options.merge(proj: default_bughd_project_android_id))
15
16
  end
16
17
  end
17
18
  end
data/test/test_helper.rb CHANGED
@@ -51,6 +51,10 @@ class Minitest::Test
51
51
  File.expand_path('../cases', __FILE__) + '/test_apk_txt'
52
52
  end
53
53
 
54
+ def bigger_txt_mapping
55
+ File.expand_path('../projects', __FILE__) + '/biggggger.txt'
56
+ end
57
+
54
58
  def default_device_udid
55
59
  "cf8b87e3f469d7b185fd64c057778aecbc2017a6"
56
60
  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.1.9
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FIR.im
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-13 00:00:00.000000000 Z
12
+ date: 2015-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -181,12 +181,12 @@ metadata: {}
181
181
  post_install_message: "\n ______________ ________ ____\n /
182
182
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
183
183
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
184
- \ ## 更新记录\n ### FIR-CLI 1.1.9\n - 完全兼容新版 API ✔\n - 请使用新版 API Token\n - 新版 API
184
+ \ ## 更新记录\n ### FIR-CLI 1.2.0\n - 完全兼容新版 API ✔\n - 请使用新版 API Token\n - 新版 API
185
185
  Token 查看地址: `http://fir.im/user/info`\n - 增加符号表上传指令, `fir mapping(alias m)`\n -
186
- 有以下三种方式上传符号表(目前已经支持 dSYM 和 txt 两种格式的符号表文件上传)\n - 1. 指定 version 和 build 上传: `fir
187
- m <mapping file path> -P <bughd project id> -v <app version> -b <app build> -T <your
188
- api token>`\n - 2. 在 publish 的时候自动上传: `fir p <app file path> -m <mapping file
189
- path> -P <bughd project id> -T <your api token>`\n - 3. 在 build_ipa 的时候自动上传:
186
+ 有以下三种方式上传符号表(目前已经支持 dSYM, txt zip 三种格式的符号表文件上传)\n - 1. 指定 version 和 build 上传:
187
+ `fir m <mapping file path> -P <bughd project id> -v <app version> -b <app build>
188
+ -T <your api token>`\n - 2. 在 publish 的时候自动上传: `fir p <app file path> -m <mapping
189
+ file path> -P <bughd project id> -T <your api token>`\n - 3. 在 build_ipa 的时候自动上传:
190
190
  `fir b <project dir> -P <bughd project id> -M -p -T <your api token>`\n - 支持 gradle
191
191
  打包 apk 文件并自动上传至 fir.im, `fir build_apk(alias ba)`\n - `fir ba <project dir> [-o
192
192
  <apk output dir> -c <changelog> -p -T <your api token>]`\n - [fir-cli](https://github.com/FIRHQ/fir-cli)