fir-cli 0.2.3.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +13 -82
  3. data/CHANGELOG +36 -0
  4. data/Gemfile +3 -1
  5. data/LICENSE.txt +1 -1
  6. data/README.md +83 -103
  7. data/Rakefile +1 -0
  8. data/bin/fir +9 -11
  9. data/fir-cli.gemspec +47 -26
  10. data/lib/fir/api.yml +5 -0
  11. data/lib/fir/cli.rb +107 -0
  12. data/lib/fir/patches/bin/pngcrush +0 -0
  13. data/lib/fir/patches/native_patch.rb +199 -0
  14. data/lib/fir/patches/os_patch.rb +22 -0
  15. data/lib/fir/patches/parser_patch.rb +165 -0
  16. data/lib/fir/patches.rb +5 -0
  17. data/lib/fir/util/build.rb +158 -0
  18. data/lib/fir/util/info.rb +79 -0
  19. data/lib/fir/util/login.rb +17 -0
  20. data/lib/fir/util/publish.rb +103 -0
  21. data/lib/fir/util.rb +45 -0
  22. data/lib/fir/version.rb +5 -0
  23. data/lib/fir-cli.rb +3 -0
  24. data/lib/fir.rb +87 -0
  25. data/lib/fir_cli.rb +3 -0
  26. metadata +57 -109
  27. data/Gemfile.lock +0 -45
  28. data/fir-cli.rb +0 -27
  29. data/lib/fir-cli/version.rb +0 -5
  30. data/lib/fir-cli-commands/00-info.rb +0 -17
  31. data/lib/fir-cli-commands/00-login.rb +0 -30
  32. data/lib/fir-cli-commands/00-profile.rb +0 -31
  33. data/lib/fir-cli-commands/00-upgrade.rb +0 -15
  34. data/lib/fir-cli-commands/00-version.rb +0 -10
  35. data/lib/fir-cli-commands/01-config.rb +0 -17
  36. data/lib/fir-cli-commands/100-resign_codesign.rb +0 -59
  37. data/lib/fir-cli-commands/100-resign_tapbeta.rb +0 -85
  38. data/lib/fir-cli-commands/101-resign.rb +0 -26
  39. data/lib/fir-cli-commands/11-publish.rb +0 -73
  40. data/lib/fir-cli-commands/12-build_ipa.rb +0 -153
  41. data/lib/fir-cli.chk.rb +0 -33
  42. data/lib/fir-cli.core.rb +0 -96
  43. data/lib/fir-cli.fir.rb +0 -49
  44. data/lib/fir-cli.opt.rb +0 -35
  45. data/lib/fir-cli.output.rb +0 -55
  46. data/lib/fir-cli.utils.rb +0 -108
  47. data/lib/lagunitas.ext.rb +0 -56
  48. data/lib/lagunitas.patch.rb +0 -51
  49. data/lib/user_config.patch.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04154c446616e8eacac4ac9f0f22682a2bcaedc3
4
- data.tar.gz: ebd13d2d7eeb162070919c639158999ac4ea6a1f
3
+ metadata.gz: cdfcc4494b2c319d0bab3e4edc1dcd2135479129
4
+ data.tar.gz: 7c93f0486879317b7ca83cb6afc1e95810f1677d
5
5
  SHA512:
6
- metadata.gz: aaef251340151daaa73f356b4f93149b2ab41916dd54c28c0636a746af36949b5b540f80818692e5f9ce1d550edec6dc73fabb7045942bd377417f2c40749b2f
7
- data.tar.gz: 8485d33558ce9d6c5052dbfd5b08cac8175b975194fcb57b587c856ce3d00bcb3e19fa2dec9234ec8df3c8a50ffd15e57ad82bcb588d9a3206927c0a6d1d2022
6
+ metadata.gz: 9d50784764f1448a94699c83ab42f83b4b62fa15677e06a94a81afc66ad201d61fdabde87d9099c4c733d6323c0fb45609eeb3973f0083099f5bf912936f84c8
7
+ data.tar.gz: 1453ac85497d3416fc98fd3766b58f995d022553c35fb54f96b00703ba952fff7fae9b04c5c8e88d1870c867060ed41af4d7eebd2dff8d533389d7118ab183c5
data/.gitignore CHANGED
@@ -1,87 +1,18 @@
1
- # Created by https://www.gitignore.io
2
-
3
- ### Ruby ###
4
- *.gem
5
- *.rbc
6
- /.config
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
7
5
  /coverage/
8
- /InstalledFiles
6
+ /doc/
9
7
  /pkg/
10
8
  /spec/reports/
11
- /test/tmp/
12
- /test/version_tmp/
13
9
  /tmp/
14
- *.tags*
15
-
16
- ## Specific to RubyMotion:
17
- .dat*
18
- .repl_history
19
- build/
20
-
21
- ## Documentation cache and generated files:
22
- /.yardoc/
23
- /_yardoc/
24
- /doc/
25
- /rdoc/
26
-
27
- ## Environment normalisation:
28
- /.bundle/
29
- /lib/bundler/man/
30
-
31
- # for a library or gem, you might want to ignore these files since the code is
32
- # intended to run in multiple environments; otherwise, check them in:
33
- # Gemfile.lock
34
- # .ruby-version
35
- # .ruby-gemset
36
-
37
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
38
- .rvmrc
39
-
40
-
41
- ### Linux ###
42
- *~
43
-
44
- # KDE directory preferences
45
- .directory
46
-
47
-
48
- ### OSX ###
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .tags*
16
+ *.gem
17
+ Gemfile.lock
49
18
  .DS_Store
50
- .AppleDouble
51
- .LSOverride
52
-
53
- # Icon must end with two \r
54
- Icon
55
-
56
-
57
- # Thumbnails
58
- ._*
59
-
60
- # Files that might appear on external disk
61
- .Spotlight-V100
62
- .Trashes
63
-
64
- # Directories potentially created on remote AFP share
65
- .AppleDB
66
- .AppleDesktop
67
- Network Trash Folder
68
- Temporary Items
69
- .apdisk
70
-
71
-
72
- ### SublimeText ###
73
- # cache files for sublime text
74
- *.tmlanguage.cache
75
- *.tmPreferences.cache
76
- *.stTheme.cache
77
-
78
- # workspace files are user-specific
79
- *.sublime-workspace
80
-
81
- # project files should be checked into the repository, unless a significant
82
- # proportion of contributors will probably not be using SublimeText
83
- # *.sublime-project
84
-
85
- # sftp configuration file
86
- sftp-config.json
87
-
data/CHANGELOG ADDED
@@ -0,0 +1,36 @@
1
+ ## 更新记录
2
+ ### FIR-CLI 1.0.0
3
+ - 重大重构
4
+ - 优化启动及运行速度
5
+ - 增加各指令的 alias
6
+ - 增加全局参数, -T, -L, -V, -q, -h, 分别为 token, log, verbose, quite, help 参数
7
+ - 增加输入 log
8
+ - 修正部分系统安装失败问题
9
+ - 修正部分服务器安装出现编码失败问题
10
+ - 重写 ipa 解析器, 去除 `miniz.c`, 增加 pngcrash
11
+ - build_ipa 增加默认 build 路径, `fir b` 则默认 build 当前路径
12
+ - build_ipa 增加输出 dSYM 符号表文件
13
+ - build_ipa 增加输出 xcodebuild 的信息
14
+ - 去掉输出信息颜色, 方便查看 log
15
+ - 简化 --verbose 参数, 简化为 `--verbose --no-verbose`, 默认输出为 INFO
16
+
17
+ ### FIR-CLI 0.2.3
18
+ - 去除重签名功能, iOS 8.1.3 之后不支持重签名
19
+
20
+ ### FIR-CLI 0.2.2
21
+ - 修复 WARNING: The rest_client gem is deprecated
22
+
23
+ ### FIR-CLI 0.2.1
24
+ - 修正解析带空格的文件出租哦问题
25
+
26
+ ### FIR-CLI 0.2.0
27
+ - 新指令 `build_ipa`
28
+
29
+ ### FIR-CLI 0.1.8
30
+ - 支持 ruby 1.9.x
31
+ - 规范输出参数选项,支持无颜色信息输出
32
+ -`--verbose=v|vv|vvv`:设置输出级别
33
+ -`--quiet` 与 `--no-quiet`:设置是否不输出辅助信息
34
+ -`--color` 与 `--no-color`:设置输出是否携带颜色信息
35
+ - 修复 ipa 应用图标不清晰问题
36
+ - 增加切换配置文件功能:使用此功能可以在多个用户中切换使用
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
- source 'https://ruby.taobao.org/'
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fir.gemspec
2
4
  gemspec
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  GNU GENERAL PUBLIC LICENSE
2
2
  Version 3, 29 June 2007
3
3
 
4
- Copyright (C) 2014 Fly It Remotely LLC. <http://fir.im/>
4
+ Copyright (C) 2015 Fly It Remotely LLC. <http://fir.im/>
5
5
 
6
6
  Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
7
7
 
data/README.md CHANGED
@@ -1,157 +1,137 @@
1
1
  FIR.im CLI
2
2
  ---
3
- > FIR.im CLI 可以通过指令查看、上传、编译应用。
4
-
5
- ## 新指令 `build_ipa`
6
- > 这个指令对 `xcodebuild` 这个原生指令进行了包装,将常用的参数名简化,同时支持全部的自带参数和设置。
7
-
8
- ### 编译并获得 ipa
9
-
10
- ```
11
- $ fir build_ipa path/to/project -o path/to/output
12
- > 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
13
- > 正在编译
14
- > 正在打包 app: demo.app 到 path/to/output/demo.ipa
15
- > 完成
16
- ```
17
-
18
- ### 复杂一点
19
- ```
20
- $ fir build_ipa path/to/workspace -o path/to/output -w -C Release -s allTargets GCC_PREPROCESSOR_DEFINITIONS="FOO=bar"
21
- ```
22
-
23
- 该指令在指向的目录中,找到第一个 workspace 文件,对其进行编译。使用 `Release` 设置,编译策略为 `allTargets`,同时设置了预编译参数 `FOO`。
24
-
25
- ### 一步,从源代码到 FIR.im
26
- > 只需要多输入一个 -p
27
-
28
- ```
29
- $ fir build_ipa path/to/project -p
30
- > 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
31
- > 正在编译
32
- > 正在打包 app: demo.app 到 /var/folders/z7/7_cp03nx0535g0cd6ynfmxt80000gn/T/d20141218-13295-1oe0zlm/demo.ipa
33
- > 完成
34
- > 正在发布 demo.ipa
35
- > 正在解析 ipa 文件...
36
- > 正在获取 im.fir.demo@FIR.im 的应用信息...
37
- > 上传应用...
38
- > 上传应用成功
39
- > 正在更新 fir 的应用信息...
40
- > 更新成功
41
- > 正在更新 fir 的应用版本信息...
42
- > 更新成功
43
- > 正在获取 im.fir.demo@FIR.im 的应用信息...
44
- > http://fir.im/xxxx
45
- ```
3
+ > FIR.im CLI 可以通过指令查看, 上传, 编译应用
46
4
 
47
5
  ## 使用入门
48
6
  ### 从安装入手
49
7
 
50
- FIR.im CLI 使用 ruby 构建,只要安装相应 ruby gem 即可:
8
+ FIR.im CLI 使用 Ruby 构建,只要安装相应 ruby gem 即可:
51
9
 
52
10
  ```shell
53
- $ sudo gem install fir-cli
11
+ $ sudo gem install fir-cli --no-ri --no-rdoc
54
12
  ```
55
13
 
56
14
  安装后,你可以在命令行执行指令
57
15
 
58
16
  ```shell
59
17
  $ fir
60
- > 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
61
18
  Commands:
62
- fir build_ipa PATH [options] [settings] # 编译 ios app 项目
63
- fir config # 配置全局设置
64
- fir help [COMMAND] # Describe available commands or one specific command
65
- fir info APP_FILE_PATH # 获取应用文件的信息(支持 ipa 文件和 apk 文件)
66
- fir login # 登录
67
- fir profile # 切换配置文件
68
- fir publish APP_FILE_PATH # 将应用文件发布至 FIR.im(支持 ipa 文件和 apk 文件)
69
- fir upgrade # 更新 fir-cli 的所有组件
70
- fir version # 当前版本
71
- ```
19
+ fir build_ipa BUILD_DIR [options] [settings] # Build iOS app (alias: 'b').
20
+ fir help # Describe available commands or one specific command.
21
+ fir info APP_FILE_PATH # Show iOS/Android app's info, support ipa/apk file (aliases: 'i').
22
+ fir login # Login FIR.im (aliases: 'l').
23
+ fir publish APP_FILE_PATH # Publish iOS/Android app to FIR.im, support ipa/apk file (aliases: 'p').
24
+ fir upgrade # Upgrade FIR-CLI and quit (aliases: u).
25
+ fir version # Show FIR-CLI version number and quit (aliases: v)
26
+
27
+ Options:
28
+ -T, [--token=TOKEN] # User's token at FIR.im
29
+ -L, [--logfile=LOGFILE] # Path to writable logfile
30
+ -V, [--verbose], [--no-verbose] # Show verbose
31
+ # Default: true
32
+ -q, [--quiet], [--no-quiet] # Silence commands
33
+ -h, [--help], [--no-help] # Show this help message and quit
34
+ ```
35
+
36
+ ### 参数说明
37
+
38
+ - `alias <short command>` 意味着可以用 alias 别名来代替该指令, 例如 `fir b`
39
+ - `-T` 用户在 FIR.im 上的 token, `publish` 需要使用此参数
40
+ - `-L` 指定 FIR-CLI 的输出 log, 默认为 STDOUT
41
+ - `-V` Verbose, 默认为输出所有信息( INFO 和 ERROR), 如果设置 `--no-verbose`, 则只输出 ERROR 信息
42
+ - `-q` 静默模式, 默认关闭
43
+ - `-h` 查看帮助
72
44
 
73
45
  ### 发布一个应用
74
46
 
75
- 输入下面的指令便可轻松发布应用
47
+ 输入下面的指令便可轻松发布应用, 支持 ipa 和 apk 文件
76
48
 
77
49
  ```shell
78
- $ fir publish 应用路径
50
+ $ fir p path/to/application -T YOUR_FIR_TOKEN
79
51
  ```
80
52
 
81
- 这时系统会提示输入用户 token
53
+ 如果在此之前, 已经使用 `fir login` 命令登录过, 则可省略 `-T` 参数
82
54
 
83
55
  ```shell
84
- > 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
85
- > 正在解析 ipa 文件...
86
- > 正在获取 im.fir.juo@FIR.im 的应用信息...
87
- 请输入用户 token:
56
+ > I, [2015-02-28T23:14:40.312010 #36861] INFO -- : Publishing app.......
57
+ > I, [2015-02-28T23:14:45.312000 #36861] INFO -- : ✈ -------------------------------------------- ✈
58
+ > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Converting app's icon......
59
+ > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Uploading app's icon......
60
+ > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Uploading app......
61
+ > ..........
62
+ > I, [2015-02-28T23:14:46.312000 #36861] INFO -- : ✈ -------------------------------------------- ✈
63
+ > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Published succeed: http://fir.im/xxx
88
64
  ```
89
65
 
90
- 输入用户 token 后,系统会自动上传
66
+ ### 方便一点
67
+
68
+ 如果觉得每次都输入 `-T` 很不方便, 那么可使用 `login` 命令
91
69
 
92
70
  ```shell
93
- 请输入用户 token:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
94
- > 上传应用...
95
- > 上传应用成功
96
- > 正在更新 fir 的应用信息...
97
- > 更新成功
98
- > 正在更新 fir 的应用版本信息...
99
- > 更新成功
100
- > http://fir.im/xxxxx
71
+ $ fir l
101
72
  ```
102
73
 
103
- 用户 token 可在[这里](http://fir.im/user/info)查看
74
+ 这时系统会提示输入用户 token, 用户 token 可在[这里](http://fir.im/user/info)查看
104
75
 
105
- ### 方便一点
76
+ ```shell
77
+ > Please enter your FIR.im token:
78
+ > I, [2015-03-01T18:26:42.718715 #38624] INFO -- : Login succeed, current user's email: xxx@fir.im
106
79
 
107
- 如果觉得每次都输入用户 token 很不方便,那么可使用登录命令
80
+ ```
108
81
 
109
- ```shell
110
- $ fir login
82
+ ### 编译并获得 ipa
83
+ > 该指令 `build_ipa` 对 `xcodebuild` 原生指令进行了封装, 将常用的参数名简化, 支持全部的自带参数及设置, 同时输出符号表 .dSYM 文件.
84
+
85
+ ```
86
+ $ fir build_ipa path/to/project -o path/to/output
87
+ > I, [2015-02-28T23:14:33.501293 #36861] INFO -- : Building......
88
+ > I, [2015-02-28T23:14:33.501400 #36861] INFO -- : ✈ -------------------------------------------- ✈
89
+ > I, [2015-02-28T23:14:38.311632 #36861] INFO -- : Build settings from command line:
90
+ > ..........
91
+ > I, [2015-02-28T23:14:38.312012 #36861] INFO -- : Build Success
111
92
  ```
112
93
 
113
- 这时系统会提示输入用户 token
94
+ ### 复杂一点
95
+ ```
96
+ $ fir b path/to/workspace -o path/to/output -w -C Release -t allTargets GCC_PREPROCESSOR_DEFINITIONS="FOO=bar"
97
+ ```
98
+
99
+ 该指令在指向的目录中,找到第一个 workspace 文件,对其进行编译。使用 `Release` 设置,编译策略为 `allTargets`,同时设置了预编译参数 `FOO`。
100
+
101
+ ### 一步, 从源代码到 FIR.im
102
+ > 只需要输入 -p -T
114
103
 
115
- ```shell
116
- > 欢迎使用 FIR.im 命令行工具,如需帮助请输入: fir help
117
- 输入你的用户 token:
118
104
  ```
119
- 输入用户 token,系统会自动获取你的用户 email
120
- ```shell
121
- 输入你的用户 token:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
122
- > 设置用户邮件地址为: dy@fir.im
123
- > 当前登陆用户为:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
105
+ $ fir build_ipa path/to/project -o path/to/output -p -T YOUR_FIR_TOKEN
106
+ > I, [2015-02-28T23:14:33.501293 #36861] INFO -- : Building......
107
+ > I, [2015-02-28T23:14:33.501400 #36861] INFO -- : ✈ -------------------------------------------- ✈
108
+ > I, [2015-02-28T23:14:38.311632 #36861] INFO -- : Build settings from command line:
109
+ > ..........
110
+ > I, [2015-02-28T23:14:38.312012 #36861] INFO -- : Build Success
111
+ > I, [2015-02-28T23:14:40.312010 #36861] INFO -- : Publishing app.......
112
+ > I, [2015-02-28T23:14:45.312000 #36861] INFO -- : ✈ -------------------------------------------- ✈
113
+ > ..........
114
+ > I, [2015-02-28T23:14:46.312000 #36861] INFO -- : ✈ -------------------------------------------- ✈
115
+ > I, [2015-02-28T23:14:48.311900 #36861] INFO -- : Published succeed: http://fir.im/xxx
124
116
  ```
125
117
 
126
- ## 需要帮助?
118
+ ## 需要帮助?
127
119
 
128
120
  输入以下指令获取全面功能介绍
129
121
 
130
122
  ```shell
131
- $ fir help
123
+ $ fir -h
124
+ $ fir publish -h
132
125
  ```
133
126
 
134
- 如果还有疑问随时发邮件至[fir-cli](mailto:fir-cli@fir.im)
127
+ 如果还有疑问随时发邮件至[fir-cli](mailto: hi@fir.im)
135
128
 
136
129
  ## 永远使用最新功能
137
130
 
138
- 下面的指令会自动更新 fir-cli 及所有扩展命令至最新状态
131
+ 下面的指令会自动更新 FIR.im CLI
139
132
 
140
133
  ```shell
141
134
  $ fir upgrade
142
135
  ```
143
136
 
144
137
  随时更新以使用最新功能
145
-
146
- ## 更新记录
147
- ### FIR-cli 0.2.0
148
- - 新指令 `build_ipa`
149
-
150
- ### FIR-cli 0.1.8
151
- - 支持 ruby 1.9.x
152
- - 规范输出参数选项,支持无颜色信息输出
153
- -`--verbose=v|vv|vvv`:设置输出级别
154
- -`--quiet` 与 `--no-quiet`:设置是否不输出辅助信息
155
- -`--color` 与 `--no-color`:设置输出是否携带颜色信息
156
- - 修复 ipa 应用图标不清晰问题
157
- - 增加切换配置文件功能:使用此功能可以在多个用户中切换使用
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/fir CHANGED
@@ -1,16 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
- # coding: utf-8
2
+ # encoding: utf-8
3
3
 
4
- require 'fir-cli'
5
-
6
-
7
- Fir::Cli.find_extends.each { |g| require g }
4
+ require_relative '../lib/fir'
8
5
 
9
6
  begin
10
- Fir::Cli.start ARGV
11
- rescue Exception => e
12
- s = e.to_s
13
- s = ": #{s}" if !s.empty?
14
- puts "! #{Paint["错误#{s}", :red]}"
7
+ system "export LC_ALL=en_US.UTF-8;export LC_CTYPE=en_US.UTF-8;export LANG=en_US.UTF-8"
8
+ FIR::CLI.start ARGV
9
+ rescue => e
10
+ raise e if $DEBUG
11
+ STDERR.puts e.message
12
+ STDERR.puts e.backtrace.join("\n")
13
+ exit 1
15
14
  end
16
-
data/fir-cli.gemspec CHANGED
@@ -1,34 +1,55 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'fir-cli/version'
5
+ require 'fir/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "fir-cli"
9
+ spec.version = FIR::VERSION
10
+ spec.authors = ["FIR.im"]
11
+ spec.email = ["dev@fir.im"]
12
+ spec.date = Time.now.strftime("%Y-%m-%d")
13
+ spec.summary = %q{FIR.im command tool}
14
+ spec.description = %q{FIR.im command tool, support iOS and Android}
15
+ spec.homepage = "http://blog.fir.im/2014/fir_cli"
16
+ spec.license = "GPLv3"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
5
22
 
6
- Gem::Specification.new do |s|
7
- s.name = 'fir-cli'
8
- s.version = Fir::Cli::VERSION
9
- s.date = '2014-11-20'
10
- s.summary = 'FIR.im 命令行工具'
11
- s.description = 'FIR.im 命令行工具,支持 ios 和 android'
12
- s.homepage = 'http://blog.fir.im/2014/fir-cli'
13
- s.authors = ['FIR.im']
14
- s.email = 'fir-cli@fir.im'
15
- s.license = 'GPLv3'
23
+ spec.post_install_message = %q(
24
+ ______________ ________ ____
25
+ / ____/ _/ __ \ / ____/ / / _/
26
+ / /_ / // /_/ /_____/ / / / / /
27
+ / __/ _/ // _, _/_____/ /___/ /____/ /
28
+ /_/ /___/_/ |_| \____/_____/___/
16
29
 
17
- s.files = `git ls-files | grep -Ev ".dev."`.split("\n")
18
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
- s.require_paths << './'
30
+ ## 更新记录
31
+ ### FIR-CLI 1.0.0
32
+ - 重大重构
33
+ - 优化启动及运行速度
34
+ - 增加各指令的 alias
35
+ - 增加全局参数, -T, -L, -V, -q, -h, 分别为 token, log, verbose, quite, help 参数
36
+ - 增加输入 log
37
+ - 修正部分系统安装失败问题
38
+ - 修正部分服务器安装出现编码失败问题
39
+ - 重写 ipa 解析器, 去除 `miniz.c`, 增加 pngcrash
40
+ - build_ipa 增加默认 build 路径, `fir b` 则默认 build 当前路径
41
+ - build_ipa 增加输出 dSYM 符号表文件
42
+ - build_ipa 增加输出 xcodebuild 的信息
43
+ - 去掉输出信息颜色, 方便查看 log
44
+ - 简化 --verbose 参数, 简化为 `--verbose --no-verbose`, 默认输出为 INFO
45
+ )
21
46
 
22
- s.add_dependency 'lagunitas', '0.0.1'
23
- s.add_dependency 'user_config', '0.0.4'
24
- s.add_dependency 'pngdefry', '0.1.1'
25
- s.add_dependency 'rest-client', '~> 1.7'
26
- s.add_dependency 'paint', '~> 0.9'
27
- s.add_dependency 'thor', '~> 0.19'
28
- s.add_dependency 'ruby_apk', '~> 0.7'
29
- s.add_dependency 'highline', '~> 1.6'
30
- s.add_dependency 'rubyzip', '~> 0.9.9'
47
+ spec.add_development_dependency "bundler", "~> 1.7"
48
+ spec.add_development_dependency "rake", "~> 10.0"
49
+ spec.add_development_dependency "pry", "~> 0.11"
31
50
 
32
- s.add_development_dependency "bundler", "~> 1.7"
33
- s.add_development_dependency "rake", "~> 10.0"
51
+ spec.add_dependency "thor", "~> 0.19"
52
+ spec.add_dependency "CFPropertyList", "~> 2.3"
53
+ spec.add_dependency "rest-client", "~> 1.7"
54
+ spec.add_dependency "ruby_android", "~> 0.7"
34
55
  end
data/lib/fir/api.yml ADDED
@@ -0,0 +1,5 @@
1
+ base_url: 'http://fir.im'
2
+ me_url: 'http://fir.im/api/v2/user/me'
3
+ app_url: 'http://fir.im/api/v2/app'
4
+ uploading_info_url: 'http://fir.im/api/v2/app/info'
5
+ version_url: 'http://fir.im/api/v2/appVersion'
data/lib/fir/cli.rb ADDED
@@ -0,0 +1,107 @@
1
+ # encoding: utf-8
2
+
3
+ module FIR
4
+ class CLI < Thor
5
+ class_option :token, type: :string, aliases: "-T", desc: "User's token at FIR.im"
6
+ class_option :logfile, type: :string, aliases: "-L", desc: "Path to writable logfile"
7
+ class_option :verbose, type: :boolean, aliases: "-V", desc: "Show verbose", default: true
8
+ class_option :quiet, type: :boolean, aliases: "-q", desc: "Silence commands"
9
+ class_option :help, type: :boolean, aliases: "-h", desc: "Show this help message and quit"
10
+
11
+ desc "build_ipa BUILD_DIR [options] [settings]", "Build iOS app (alias: 'b')."
12
+ long_desc <<-LONGDESC
13
+ `build_ipa` command will auto build your project/workspace to an ipa package
14
+ and it also can auto publish your built ipa to FIR.im if use `-p` option.
15
+ Internally, it use `xcodebuild` to accomplish these things, use `man xcodebuild` to get more information.
16
+
17
+ Example:
18
+
19
+ $ fir b <project dir> [-C <configuration>] [-t <target name>] [-o <ipa output dir>] [settings] [-c <changelog>] [-p -T <your token>]
20
+
21
+ $ fir b <workspace dir> -w -s <scheme name> [-C <configuration>] [-t <target name>] [-o <ipa output dir>] [settings] [-c <changelog>] [-p -T <your token>]
22
+ LONGDESC
23
+ map ["b", "build"] => :build_ipa
24
+ method_option :workspace, type: :boolean, aliases: "-w", desc: "Set true/false if build workspace"
25
+ method_option :scheme, type: :string, aliases: "-s", desc: "Set the scheme NAME if build workspace"
26
+ method_option :configuration, type: :string, aliases: "-C", desc: "Use the build configuration NAME for building each target"
27
+ method_option :target, type: :string, aliases: "-t", desc: "Build the target specified by targetname"
28
+ method_option :output, type: :string, aliases: "-o", desc: "IPA output path, the default is: BUILD_DIR/build_ipa"
29
+ method_option :publish, type: :boolean, aliases: "-p", desc: "Set true/false if publish to FIR.im"
30
+ method_option :short, type: :string, aliases: "-s", desc: "Set custom short link if publish to FIR.im"
31
+ method_option :changelog, type: :string, aliases: "-c", desc: "Set changelog if publish to FIR.im"
32
+ def build_ipa *args
33
+ prepare :build_ipa
34
+
35
+ FIR.build_ipa(*args, options)
36
+ end
37
+
38
+ desc "info APP_FILE_PATH", "Show iOS/Android app's info, support ipa/apk file (aliases: 'i')."
39
+ map "i" => :info
40
+ method_option :all, type: :boolean, aliases: "-a", desc: "Show all information in application"
41
+ def info *args
42
+ prepare :info
43
+
44
+ FIR.info(*args, options)
45
+ end
46
+
47
+ desc "publish APP_FILE_PATH", "Publish iOS/Android app to FIR.im, support ipa/apk file (aliases: 'p')."
48
+ map "p" => :publish
49
+ method_option :short, type: :string, aliases: "-s", desc: "Set custom short link"
50
+ method_option :changelog, type: :string, aliases: "-c", desc: "Set changelog"
51
+ def publish *args
52
+ prepare :publish
53
+
54
+ FIR.publish(*args, options)
55
+ end
56
+
57
+ desc "login", "Login FIR.im (aliases: 'l')."
58
+ map "l" => :login
59
+ def login *args
60
+ prepare :login
61
+
62
+ token = options[:token] || args.first || ask("Please enter your FIR.im token:", :white, echo: true)
63
+ FIR.login(token)
64
+ end
65
+
66
+ desc "upgrade", "Upgrade FIR-CLI and quit (aliases: u)."
67
+ map "u" => :upgrade
68
+ def upgrade
69
+ prepare :upgrade
70
+ say "✈ Upgrade FIR-CLI (use `gem install fir-cli --no-ri --no-rdoc`)"
71
+ say `gem install fir-cli --no-ri --no-rdoc`
72
+ end
73
+
74
+ desc "version", "Show FIR-CLI version number and quit (aliases: v)"
75
+ map ["v", "-v", "--version"] => :version
76
+ def version
77
+ say "✈ FIR-CLI #{FIR::VERSION}"
78
+ end
79
+
80
+ desc "help", "Describe available commands or one specific command."
81
+ map Thor::HELP_MAPPINGS => :help
82
+ def help command = nil, subcommand = false
83
+ super
84
+ end
85
+
86
+ no_commands do
87
+ def invoke_command command, *args
88
+ logfile = options[:logfile].blank? ? STDOUT : options[:logfile]
89
+ logfile = '/dev/null' if options[:quiet]
90
+ FIR.logger = Logger.new(logfile)
91
+ FIR.logger.level = options[:verbose] ? Logger::INFO : Logger::ERROR
92
+ super
93
+ end
94
+ end
95
+
96
+ private
97
+
98
+ def prepare task
99
+ if options.help?
100
+ help(task.to_s)
101
+ raise SystemExit
102
+ end
103
+ $DEBUG = true if ENV["DEBUG"]
104
+ end
105
+
106
+ end
107
+ end
Binary file