fir-cli 1.2.0 → 1.2.1

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: 85cb3f2688de5e0dd74a001f357796100a54d6c8
4
- data.tar.gz: eae5c2263e4feffdc6a19481f85a617e97359e91
3
+ metadata.gz: 9aee1888db369ab39529842d3d3ddb39f6e6ad20
4
+ data.tar.gz: 7c171e7eb00066008f1742154a0ba39ef66fe4cb
5
5
  SHA512:
6
- metadata.gz: b1166ed1b1795df22622890b833fca45deb94be99bd476864725245c272958413ad79bdeaab2c5e3b9966750ca641c809f53928102df60e0c9597c2d7aa7d24c
7
- data.tar.gz: 68d673c6d73dea305ff54dafe6c37f875893ee0e78f205a258522ddcaafec10c773337235c4a58087a7fb8c77416ba2fe1997a1d63bcfd86e8014b16779a698e
6
+ metadata.gz: 1373d866a5fb18374e29ae3f0ae8e9e94a73b08d750d310a38c74fd26f961a9e0c8dda7ab491c1f3b1e9ad8bcde4024bf48d12eecc4257ddb4ae8faadabf5d1f
7
+ data.tar.gz: 46095a637cf33ceab9df0d03452a39fb04efa342e3072a8bed2808f2f745866b9043b2bc30758b500ee05233223df9e15302632c452b09b2f0c30a147e0a4b03
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 更新记录
2
2
 
3
+ ### FIR-CLI 1.2.1
4
+ - fix #12, 去掉 fir-cli_tmp 目录
5
+
3
6
  ### FIR-CLI 1.2.0
4
7
  - 支持 zip 符号表文件上传
5
8
 
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  FIR.im CLI
2
2
  ---
3
3
 
4
+
4
5
  ![Build Status Images](https://travis-ci.org/FIRHQ/fir-cli.svg)
5
6
  [![Code Climate](https://codeclimate.com/github/FIRHQ/fir-cli/badges/gpa.svg)](https://codeclimate.com/github/FIRHQ/fir-cli)
6
7
  [![Test Coverage](https://codeclimate.com/github/FIRHQ/fir-cli/badges/coverage.svg)](https://codeclimate.com/github/FIRHQ/fir-cli/coverage)
7
8
  [![Gem Version](https://badge.fury.io/rb/fir-cli.svg)](http://badge.fury.io/rb/fir-cli)
9
+ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FIRHQ/fir-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
8
10
 
9
11
  > FIR.im CLI 可以通过指令查看, 上传, 编译应用
10
12
 
@@ -37,18 +39,19 @@ sudo gem install fir-cli
37
39
  ```shell
38
40
  $ fir
39
41
  Commands:
40
- fir build_ipa BUILD_DIR [options] [settings] # Build iOS app (alias: 'b').
42
+ fir build_apk BUILD_DIR # Build Android app (alias: 'ba').
43
+ fir build_ipa BUILD_DIR [options] [settings] # Build iOS app (alias: 'bi').
41
44
  fir help # Describe available commands or one specific command.
42
45
  fir info APP_FILE_PATH # Show iOS/Android app's info, support ipa/apk file (aliases: 'i').
43
46
  fir login # Login FIR.im (aliases: 'l').
44
47
  fir mapping MAPPING_FILE_PATH # Upload app's mapping file to BugHD.com (aliases: 'm').
45
- fir me # Show current user info if user is logined (aliases: 'm').
48
+ fir me # Show current user info if user is logined.
46
49
  fir publish APP_FILE_PATH # Publish iOS/Android app to FIR.im, support ipa/apk file (aliases: 'p').
47
50
  fir upgrade # Upgrade FIR-CLI and quit (aliases: u).
48
51
  fir version # Show FIR-CLI version number and quit (aliases: v)
49
52
 
50
53
  Options:
51
- -T, [--token=TOKEN] # User's token at FIR.im
54
+ -T, [--token=TOKEN] # User's API Token at FIR.im
52
55
  -L, [--logfile=LOGFILE] # Path to writable logfile
53
56
  -V, [--verbose], [--no-verbose] # Show verbose
54
57
  # Default: true
@@ -76,14 +79,15 @@ $ fir p path/to/application -T YOUR_FIR_TOKEN
76
79
  如果在此之前, 已经使用 `fir login` 命令登录过, 则可省略 `-T` 参数
77
80
 
78
81
  ```shell
79
- > I, [2015-02-28T23:14:40.312010 #36861] INFO -- : Publishing app.......
80
- > I, [2015-02-28T23:14:45.312000 #36861] INFO -- : ✈ -------------------------------------------- ✈
81
- > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Converting app's icon......
82
- > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Uploading app's icon......
83
- > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Uploading app......
84
- > ..........
85
- > I, [2015-02-28T23:14:46.312000 #36861] INFO -- : --------------------------------------------
86
- > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Published succeed: http://fir.im/xxx
82
+ I, [2015-08-26T10:08:35.447209 #6774] INFO -- : Publishing app.......
83
+ I, [2015-08-26T10:08:35.447334 #6774] INFO -- : ✈ -------------------------------------------- ✈
84
+ I, [2015-08-26T10:08:35.514378 #6774] INFO -- : Fetching xxxx@FIR.im uploading info......
85
+ I, [2015-08-26T10:08:35.692616 #6774] INFO -- : Uploading app......
86
+ I, [2015-08-26T10:08:36.920226 #6774] INFO -- : Updating devices info......
87
+ I, [2015-08-26T10:08:37.075149 #6774] INFO -- : ✈ -------------------------------------------- ✈
88
+ I, [2015-08-26T10:08:37.075238 #6774] INFO -- : Fetch app info from FIR.im
89
+ I, [2015-08-26T10:08:37.235071 #6774] INFO -- : Published succeed: http://fir.im/xxxx
90
+ I, [2015-08-26T10:08:37.235155 #6774] INFO -- :
87
91
  ```
88
92
 
89
93
  ### 方便一点
@@ -97,9 +101,10 @@ $ fir l
97
101
  这时系统会提示输入用户 token, 用户 token 可在 **[这里](http://fir.im/user/info)** 查看
98
102
 
99
103
  ```shell
100
- > Please enter your FIR.im token:
101
- > I, [2015-03-01T18:26:42.718715 #38624] INFO -- : Login succeed, current user's email: xxx@fir.im
102
-
104
+ Please enter your FIR.im API Token:
105
+ I, [2015-08-26T10:10:28.235295 #6833] INFO -- : Login succeed, previous user's email: xxx@xxx.com
106
+ I, [2015-08-26T10:10:28.245083 #6833] INFO -- : Login succeed, current user's email: xxx@xxx.com
107
+ I, [2015-08-26T10:10:28.245152 #6833] INFO -- :
103
108
  ```
104
109
 
105
110
  ### 编译并获得 ipa
@@ -107,11 +112,14 @@ $ fir l
107
112
 
108
113
  ```
109
114
  $ fir build_ipa path/to/project -o path/to/output
110
- > I, [2015-02-28T23:14:33.501293 #36861] INFO -- : Building......
111
- > I, [2015-02-28T23:14:33.501400 #36861] INFO -- : ✈ -------------------------------------------- ✈
112
- > I, [2015-02-28T23:14:38.311632 #36861] INFO -- : Build settings from command line:
113
- > ..........
114
- > I, [2015-02-28T23:14:38.312012 #36861] INFO -- : Build Success
115
+ I, [2015-08-26T10:11:12.105103 #7167] INFO -- : Building......
116
+ I, [2015-08-26T10:11:12.105175 #7167] INFO -- : ✈ -------------------------------------------- ✈
117
+ I, [2015-08-26T10:11:18.500887 #7167] INFO -- : Build settings from command line:
118
+
119
+ ..........
120
+
121
+ I, [2015-08-26T10:11:18.535498 #7167] INFO -- : Build Success
122
+ I, [2015-08-26T10:11:18.535704 #7167] INFO -- :
115
123
  ```
116
124
 
117
125
  ### 复杂一点
@@ -139,16 +147,24 @@ $ fir ba path/to/project
139
147
 
140
148
  ```shell
141
149
  $ fir build_ipa path/to/project -o path/to/output -p -T YOUR_FIR_TOKEN
142
- > I, [2015-02-28T23:14:33.501293 #36861] INFO -- : Building......
143
- > I, [2015-02-28T23:14:33.501400 #36861] INFO -- : ✈ -------------------------------------------- ✈
144
- > I, [2015-02-28T23:14:38.311632 #36861] INFO -- : Build settings from command line:
145
- > ..........
146
- > I, [2015-02-28T23:14:38.312012 #36861] INFO -- : Build Success
147
- > I, [2015-02-28T23:14:40.312010 #36861] INFO -- : Publishing app.......
148
- > I, [2015-02-28T23:14:45.312000 #36861] INFO -- : -------------------------------------------- ✈
149
- > ..........
150
- > I, [2015-02-28T23:14:46.312000 #36861] INFO -- : -------------------------------------------- ✈
151
- > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Published succeed: http://fir.im/xxx
150
+ I, [2015-08-26T10:11:59.687221 #7273] INFO -- : Building......
151
+ I, [2015-08-26T10:11:59.687301 #7273] INFO -- : ✈ -------------------------------------------- ✈
152
+ I, [2015-08-26T10:12:00.868774 #7273] INFO -- : Build settings from command line:
153
+
154
+ ..........
155
+
156
+ I, [2015-08-26T10:12:00.893819 #7273] INFO -- : Build Success
157
+ I, [2015-08-26T10:12:00.894051 #7273] INFO -- :
158
+ I, [2015-08-26T10:12:01.026832 #7273] INFO -- : Publishing app.......
159
+ I, [2015-08-26T10:12:01.026905 #7273] INFO -- : --------------------------------------------
160
+ I, [2015-08-26T10:12:01.098759 #7273] INFO -- : Fetching im.fir.OnlyiPad@FIR.im uploading info......
161
+ I, [2015-08-26T10:12:01.249832 #7273] INFO -- : Uploading app......
162
+ I, [2015-08-26T10:12:01.859718 #7273] INFO -- : Updating devices info......
163
+ I, [2015-08-26T10:12:02.015517 #7273] INFO -- : ✈ -------------------------------------------- ✈
164
+ I, [2015-08-26T10:12:02.015588 #7273] INFO -- : Fetch app info from FIR.im
165
+ I, [2015-08-26T10:12:02.210391 #7273] INFO -- : Published succeed: http://fir.im/xxxx
166
+ I, [2015-08-26T10:12:02.210459 #7273] INFO -- :
167
+ I, [2015-08-26T10:12:02.210520 #7273] INFO -- :
152
168
  ```
153
169
 
154
170
  ### 上传符号表
data/fir-cli.gemspec CHANGED
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
28
28
  /_/ /___/_/ |_| \____/_____/___/
29
29
 
30
30
  ## 更新记录
31
- ### FIR-CLI 1.2.0
31
+ ### FIR-CLI 1.2.1
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 zip 三种格式的符号表文件上传)
36
+ - 有以下三种方式上传符号表(目前已经支持 dSYM txt 两种格式的符号表文件上传, 并自动处理大文件压缩)
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>`
data/lib/fir/cli.rb CHANGED
@@ -27,7 +27,7 @@ module FIR
27
27
  method_option :scheme, type: :string, aliases: "-S", desc: "Set the scheme NAME if build workspace"
28
28
  method_option :configuration, type: :string, aliases: "-C", desc: "Use the build configuration NAME for building each target"
29
29
  method_option :target, type: :string, aliases: "-t", desc: "Build the target specified by targetname"
30
- method_option :output, type: :string, aliases: "-o", desc: "IPA output path, the default is: BUILD_DIR/build_ipa"
30
+ method_option :output, type: :string, aliases: "-o", desc: "IPA output path, the default is: BUILD_DIR/fir_build_ipa"
31
31
  method_option :name, type: :string, aliases: "-n", desc: "IPA name, the default is: YOUR PROJECT NAME"
32
32
  method_option :publish, type: :boolean, aliases: "-p", desc: "true/false if publish to FIR.im"
33
33
  method_option :short, type: :string, aliases: "-s", desc: "Set custom short link if publish to FIR.im"
@@ -129,6 +129,7 @@ module FIR
129
129
  map "u" => :upgrade
130
130
  def upgrade
131
131
  prepare :upgrade
132
+
132
133
  say "✈ Upgrade FIR-CLI (use `gem install fir-cli --no-ri --no-rdoc`)"
133
134
  say `gem install fir-cli --no-ri --no-rdoc`
134
135
  end
@@ -149,6 +150,7 @@ module FIR
149
150
  def invoke_command command, *args
150
151
  logfile = options[:logfile].blank? ? STDOUT : options[:logfile]
151
152
  logfile = '/dev/null' if options[:quiet]
153
+
152
154
  FIR.logger = Logger.new(logfile)
153
155
  FIR.logger.level = options[:verbose] ? Logger::INFO : Logger::ERROR
154
156
  super
@@ -34,7 +34,7 @@ module FIR
34
34
  end
35
35
 
36
36
  def upload_mapping_file
37
- tmp_file_path = rename_and_zip_mapping_file
37
+ tmp_file_path = generate_temp_mapping_file
38
38
 
39
39
  url = bughd_api[:full_version_url] + "/#{@full_version[:id]}"
40
40
  patch url, file: File.new(tmp_file_path, 'rb'), project_id: @proj, uuid: uuid
@@ -53,24 +53,30 @@ module FIR
53
53
  @uuid ||= fetch_user_uuid(@token)
54
54
  end
55
55
 
56
- def rename_and_zip_mapping_file
56
+ def generate_temp_mapping_file
57
57
  tmp_file_path = "#{Dir.tmpdir}/#{File.basename(@file_path)}-fircli"
58
58
  FileUtils.cp(@file_path, tmp_file_path)
59
59
 
60
- mapping_file_size = File.size?(tmp_file_path)
60
+ tmp_file_path = zip_mapping_file(tmp_file_path)
61
+ tmp_file_path = dsym_or_txt_file(tmp_file_path)
61
62
 
62
- logger.info "Mapping file size - #{mapping_file_size}"
63
+ tmp_file_path
64
+ end
63
65
 
64
- if mapping_file_size > 50*1000*1000
66
+ def zip_mapping_file tmp_file_path
67
+ if File.size?(tmp_file_path) > 50*1000*1000
65
68
  logger.info "Zipping mapping file......."
66
69
 
67
70
  system("zip -qr #{tmp_file_path}.zip #{tmp_file_path}")
68
-
69
71
  tmp_file_path = tmp_file_path + '.zip'
70
72
 
71
73
  logger.info "Zipped Mapping file size - #{File.size?(tmp_file_path)}"
72
74
  end
73
75
 
76
+ tmp_file_path
77
+ end
78
+
79
+ def dsym_or_txt_file tmp_file_path
74
80
  if File.is_dsym?(@file_path)
75
81
  FileUtils.mv(tmp_file_path, tmp_file_path + '.dSYM')
76
82
  tmp_file_path = tmp_file_path + '.dSYM'
@@ -42,7 +42,7 @@ module FIR
42
42
 
43
43
  def contents
44
44
  return if @contents
45
- @contents = "fir-cli_tmp/ipa_files-#{Time.now.to_i}"
45
+ @contents = "#{Dir.tmpdir}/ipa_files-#{Time.now.to_i}"
46
46
 
47
47
  Zip::File.open(@path) do |zip_file|
48
48
  zip_file.each do |f|
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
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.2.0
4
+ version: 1.2.1
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-16 00:00:00.000000000 Z
12
+ date: 2015-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -181,15 +181,15 @@ metadata: {}
181
181
  post_install_message: "\n ______________ ________ ____\n /
182
182
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
183
183
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
184
- \ ## 更新记录\n ### FIR-CLI 1.2.0\n - 完全兼容新版 API ✔\n - 请使用新版 API Token\n - 新版 API
184
+ \ ## 更新记录\n ### FIR-CLI 1.2.1\n - 完全兼容新版 API ✔\n - 请使用新版 API Token\n - 新版 API
185
185
  Token 查看地址: `http://fir.im/user/info`\n - 增加符号表上传指令, `fir mapping(alias m)`\n -
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
- `fir b <project dir> -P <bughd project id> -M -p -T <your api token>`\n - 支持 gradle
191
- 打包 apk 文件并自动上传至 fir.im, `fir build_apk(alias ba)`\n - `fir ba <project dir> [-o
192
- <apk output dir> -c <changelog> -p -T <your api token>]`\n - [fir-cli](https://github.com/FIRHQ/fir-cli)
186
+ 有以下三种方式上传符号表(目前已经支持 dSYM txt 两种格式的符号表文件上传, 并自动处理大文件压缩)\n - 1. 指定 version 和
187
+ build 上传: `fir m <mapping file path> -P <bughd project id> -v <app version> -b <app
188
+ build> -T <your api token>`\n - 2. 在 publish 的时候自动上传: `fir p <app file path>
189
+ -m <mapping file path> -P <bughd project id> -T <your api token>`\n - 3. 在 build_ipa
190
+ 的时候自动上传: `fir b <project dir> -P <bughd project id> -M -p -T <your api token>`\n
191
+ \ - 支持 gradle 打包 apk 文件并自动上传至 fir.im, `fir build_apk(alias ba)`\n - `fir ba <project
192
+ dir> [-o <apk output dir> -c <changelog> -p -T <your api token>]`\n - [fir-cli](https://github.com/FIRHQ/fir-cli)
193
193
  已经开源, 欢迎 fork, issue 和 pull request\n "
194
194
  rdoc_options: []
195
195
  require_paths: