fir-cli 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/README.md +15 -3
- data/fir-cli.gemspec +3 -5
- data/lib/fir/cli.rb +3 -0
- data/lib/fir/util/build_apk.rb +17 -13
- data/lib/fir/util/build_ipa.rb +0 -1
- data/lib/fir/util.rb +1 -1
- data/lib/fir/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 664504e23e1b1fcc58ff6b939d8f9dcc77f18b49
|
4
|
+
data.tar.gz: 6443da78833ee29a028db393113e02caa037eac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dad7e41ec18ba1d7c1de78f328a525bf5ad2b17f0a5e1ef19a0bd4360be01aa70168582a82afc6cfa9f04f1f1747b7574a1b0c3fff73e1dfc24993eb00e734e
|
7
|
+
data.tar.gz: 87aa90d1ebbe5dba4e7ef488b677b9e33372b4ba50c9ef1c98bebfd565cf382fdafd76a4fd482aa35ecd32af24086a34b2b5365cc49689857a8f01cd450e76e6
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -27,9 +27,12 @@ $ gem install fir-cli
|
|
27
27
|
|
28
28
|
**注意: 如果你的系统是 Mac OS X 10.11 以后的版本, 由于10.11引入了 `rootless`, 无法直接安装 fir-cli, 有以下三种解决办法:**
|
29
29
|
|
30
|
-
1\. 使用 [RVM](https://rvm.io/) 安装 Ruby, 再安装 fir-cli(推荐)
|
30
|
+
1\. 使用 [Homebrew](http://brew.sh/) 及 [RVM](https://rvm.io/) 安装 Ruby, 再安装 fir-cli(推荐)
|
31
31
|
|
32
32
|
```sh
|
33
|
+
# Install Homebrew:
|
34
|
+
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
35
|
+
|
33
36
|
# Install RVM:
|
34
37
|
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby
|
35
38
|
|
@@ -127,7 +130,7 @@ $ fir publish path/to/application -T YOUR_FIR_TOKEN
|
|
127
130
|
$ fir login
|
128
131
|
```
|
129
132
|
|
130
|
-
这时系统会提示输入用户 API token, 用户的 API token 可在 **[
|
133
|
+
这时系统会提示输入用户 API token, 用户的 API token 可在 **[这里](http://fir.im/apps/apitoken)** 的右上角查看
|
131
134
|
|
132
135
|
```sh
|
133
136
|
Please enter your fir.im API Token:
|
@@ -167,7 +170,17 @@ $ fir build_ipa path/to/workspace -w -S <scheme name>
|
|
167
170
|
#### 编译用 Gradle 打包 apk
|
168
171
|
|
169
172
|
```sh
|
173
|
+
# 简单打包
|
170
174
|
$ fir build_apk path/to/project
|
175
|
+
|
176
|
+
# 打包并上传
|
177
|
+
$ fir ba <project dir> [-o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
178
|
+
|
179
|
+
# 打包指定的 flavor
|
180
|
+
$ fir ba <project dir> [-f <flavor> -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
181
|
+
|
182
|
+
# 打包指定的 git branch
|
183
|
+
$ fir ba <git ssh url> [-B develop -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
171
184
|
```
|
172
185
|
|
173
186
|
#### 编译并且上传至 fir.im
|
@@ -231,4 +244,3 @@ $ fir upgrade
|
|
231
244
|
如果你觉得 fir-cli 对你有所帮助, 欢迎微信打赏支持作者:smile:
|
232
245
|
|
233
246
|
![](http://7rf35s.com1.z0.glb.clouddn.com/coffee.png)
|
234
|
-
|
data/fir-cli.gemspec
CHANGED
@@ -27,11 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
/_/ /___/_/ |_| \____/_____/___/
|
28
28
|
|
29
29
|
## 更新记录
|
30
|
-
### fir-cli 1.4.
|
31
|
-
-
|
32
|
-
-
|
33
|
-
- 支持远程 git 项目打包编译, enjoy.
|
34
|
-
- `$ fir bi/ba <git ssh url> -B develop -c <changelog> -p`
|
30
|
+
### fir-cli 1.4.5
|
31
|
+
- 增加 Android flavor 打包(感谢 [msdx](https://github.com/msdx) 的热心帮助)
|
32
|
+
- `$ fir ba <project dir> -f <flavor>`
|
35
33
|
- 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG
|
36
34
|
- [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源
|
37
35
|
- 欢迎 fork, issue 和 pull request
|
data/lib/fir/cli.rb
CHANGED
@@ -54,12 +54,15 @@ module FIR
|
|
54
54
|
|
55
55
|
$ fir ba <project dir> [-o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
56
56
|
|
57
|
+
$ fir ba <project dir> [-f <flavor> -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
58
|
+
|
57
59
|
$ fir ba <git ssh url> [-B develop -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
58
60
|
LONGDESC
|
59
61
|
map ['ba'] => :build_apk
|
60
62
|
method_option :branch, type: :string, aliases: '-B', desc: 'Set branch if project is a git repo, the default is `master`'
|
61
63
|
method_option :output, type: :string, aliases: '-o', desc: 'APK output path, the default is: BUILD_DIR/build/outputs/apk'
|
62
64
|
method_option :publish, type: :boolean, aliases: '-p', desc: 'true/false if publish to fir.im'
|
65
|
+
method_option :flavor, type: :string, aliases: '-f', desc: 'Set flavor if have productFlavors'
|
63
66
|
method_option :short, type: :string, aliases: '-s', desc: 'Set custom short link if publish to fir.im'
|
64
67
|
method_option :name, type: :string, aliases: '-n', desc: 'Set custom apk name when builded'
|
65
68
|
method_option :changelog, type: :string, aliases: '-c', desc: 'Set changelog if publish to fir.im, support string/file'
|
data/lib/fir/util/build_apk.rb
CHANGED
@@ -5,16 +5,14 @@ module FIR
|
|
5
5
|
|
6
6
|
def build_apk(*args, options)
|
7
7
|
initialize_build_common_options(args, options)
|
8
|
+
set_flavor(options)
|
8
9
|
|
9
10
|
Dir.chdir(@build_dir)
|
10
|
-
|
11
11
|
@build_cmd = initialize_apk_build_cmd
|
12
12
|
|
13
13
|
logger_info_and_run_build_command
|
14
14
|
|
15
15
|
output_apk
|
16
|
-
@builded_app_path = Dir["#{@output_path}/*.apk"].first
|
17
|
-
|
18
16
|
publish_build_app if options.publish?
|
19
17
|
|
20
18
|
logger_info_blank_line
|
@@ -22,11 +20,21 @@ module FIR
|
|
22
20
|
|
23
21
|
private
|
24
22
|
|
23
|
+
def set_flavor(options)
|
24
|
+
unless options.flavor.blank?
|
25
|
+
@flavor = options.flavor
|
26
|
+
unless @flavor =~ /^assemble(.+)/
|
27
|
+
@flavor = "assemble#{@flavor}Release"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
25
32
|
def initialize_apk_build_cmd
|
26
33
|
check_build_gradle_exist
|
27
34
|
|
28
|
-
|
29
|
-
|
35
|
+
cmd = "./gradlew build"
|
36
|
+
cmd = "./gradlew #{@flavor}" unless @flavor.blank?
|
37
|
+
cmd
|
30
38
|
end
|
31
39
|
|
32
40
|
def gradle_build_path
|
@@ -44,15 +52,11 @@ module FIR
|
|
44
52
|
|
45
53
|
check_no_output_apk
|
46
54
|
|
47
|
-
apk_info
|
48
|
-
|
49
|
-
if @name.blank?
|
50
|
-
apk_name = "#{apk_info[:name]}-#{apk_info[:version]}-Build-#{apk_info[:build]}"
|
51
|
-
else
|
52
|
-
apk_name = @name
|
53
|
-
end
|
55
|
+
apk_info = FIR.apk_info(@builded_apk)
|
56
|
+
@apk_name = @name.blank? ? "#{apk_info[:name]}-#{apk_info[:version]}-Build-#{apk_info[:build]}" : @name
|
54
57
|
|
55
|
-
|
58
|
+
@builded_app_path = "#{@output_path}/#{@apk_name}.apk"
|
59
|
+
FileUtils.cp(@builded_apk, @builded_app_path)
|
56
60
|
end
|
57
61
|
|
58
62
|
def check_no_output_apk
|
data/lib/fir/util/build_ipa.rb
CHANGED
data/lib/fir/util.rb
CHANGED
@@ -77,7 +77,7 @@ module FIR
|
|
77
77
|
logger.info '✈ -------------------------------------------- ✈'
|
78
78
|
end
|
79
79
|
|
80
|
-
def generate_rqrcode
|
80
|
+
def generate_rqrcode(string, png_file_path)
|
81
81
|
qrcode = ::RQRCode::QRCode.new(string.to_s)
|
82
82
|
qrcode.as_png(size: 500, border_modules: 2, file: png_file_path)
|
83
83
|
png_file_path
|
data/lib/fir/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fir-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaixSpirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -202,9 +202,8 @@ metadata: {}
|
|
202
202
|
post_install_message: "\n ______________ ________ ____\n /
|
203
203
|
____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
|
204
204
|
/\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
|
205
|
-
\ ## 更新记录\n ### fir-cli 1.4.
|
206
|
-
|
207
|
-
url> -B develop -c <changelog> -p`\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
|
205
|
+
\ ## 更新记录\n ### fir-cli 1.4.5\n - 增加 Android flavor 打包(感谢 [msdx](https://github.com/msdx)
|
206
|
+
的热心帮助)\n - `$ fir ba <project dir> -f <flavor>`\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
|
208
207
|
\ - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
|
209
208
|
request\n "
|
210
209
|
rdoc_options: []
|
@@ -222,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
221
|
version: '0'
|
223
222
|
requirements: []
|
224
223
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.4.
|
224
|
+
rubygems_version: 2.4.5
|
226
225
|
signing_key:
|
227
226
|
specification_version: 4
|
228
227
|
summary: fir.im command tool
|