fir-cli-xsl 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +8 -0
- data/.dockerignore +2 -0
- data/.flow-plugin.yml +14 -0
- data/.gitignore +27 -0
- data/.travis.yml +23 -0
- data/CHANGELOG +194 -0
- data/Dockerfile +12 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +10 -0
- data/bin/console +11 -0
- data/bin/fir +14 -0
- data/bin/setup +7 -0
- data/doc/help.md +34 -0
- data/doc/info.md +44 -0
- data/doc/install.md +67 -0
- data/doc/login.md +19 -0
- data/doc/publish.md +35 -0
- data/doc/upgrade.md +7 -0
- data/fir-cli.gemspec +52 -0
- data/fir.sh +46 -0
- data/install.sh +210 -0
- data/lib/fir-cli.rb +3 -0
- data/lib/fir.rb +28 -0
- data/lib/fir/api.yml +7 -0
- data/lib/fir/cli.rb +192 -0
- data/lib/fir/patches.rb +10 -0
- data/lib/fir/patches/blank.rb +131 -0
- data/lib/fir/patches/concern.rb +146 -0
- data/lib/fir/patches/default_headers.rb +9 -0
- data/lib/fir/patches/hash.rb +79 -0
- data/lib/fir/patches/instance_variables.rb +30 -0
- data/lib/fir/patches/native_patch.rb +28 -0
- data/lib/fir/patches/os_patch.rb +28 -0
- data/lib/fir/patches/try.rb +102 -0
- data/lib/fir/util.rb +86 -0
- data/lib/fir/util/build_apk.rb +77 -0
- data/lib/fir/util/build_common.rb +93 -0
- data/lib/fir/util/build_ipa.rb +11 -0
- data/lib/fir/util/config.rb +43 -0
- data/lib/fir/util/http.rb +23 -0
- data/lib/fir/util/info.rb +38 -0
- data/lib/fir/util/login.rb +17 -0
- data/lib/fir/util/mapping.rb +98 -0
- data/lib/fir/util/me.rb +19 -0
- data/lib/fir/util/parser/apk.rb +46 -0
- data/lib/fir/util/parser/bin/pngcrush +0 -0
- data/lib/fir/util/parser/common.rb +24 -0
- data/lib/fir/util/parser/ipa.rb +188 -0
- data/lib/fir/util/parser/pngcrush.rb +23 -0
- data/lib/fir/util/publish.rb +293 -0
- data/lib/fir/version.rb +5 -0
- data/lib/fir/xcode_wrapper.sh +29 -0
- data/lib/fir_cli.rb +3 -0
- data/test/build_ipa_test.rb +17 -0
- data/test/cases/test_apk.apk +0 -0
- data/test/cases/test_apk_txt +1 -0
- data/test/cases/test_ipa.ipa +0 -0
- data/test/cases/test_ipa_dsym +0 -0
- data/test/info_test.rb +36 -0
- data/test/login_test.rb +12 -0
- data/test/mapping_test.rb +18 -0
- data/test/me_test.rb +17 -0
- data/test/publish_test.rb +44 -0
- data/test/test_helper.rb +98 -0
- metadata +84 -4
data/test/me_test.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class MeTest < Minitest::Test
|
4
|
+
|
5
|
+
def test_me
|
6
|
+
user_info = FIR.fetch_user_info(default_token)
|
7
|
+
|
8
|
+
FIR.write_config(email: user_info.fetch(:email, ''), token: default_token)
|
9
|
+
FIR.reload_config
|
10
|
+
|
11
|
+
me_info = FIR.fetch_user_info(FIR.current_token)
|
12
|
+
|
13
|
+
assert_equal default_email, me_info.fetch(:email, '')
|
14
|
+
|
15
|
+
assert FIR.me
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class PublishTest < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@options = {
|
7
|
+
token: default_token,
|
8
|
+
changelog: "test from fir-cli #{Time.now.to_i}"
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_simple_publish
|
13
|
+
assert FIR.publish(default_ipa, @options)
|
14
|
+
assert FIR.publish(default_apk, @options)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_update_app_info
|
18
|
+
short = SecureRandom.hex[3..9]
|
19
|
+
is_opened = (rand(100) % 2) == 0
|
20
|
+
|
21
|
+
update_info = { short: short, open: is_opened }
|
22
|
+
FIR.publish(default_ipa, @options.merge(update_info))
|
23
|
+
|
24
|
+
info = FIR.fetch_app_info
|
25
|
+
|
26
|
+
assert_equal short, info[:short]
|
27
|
+
assert_equal is_opened, info[:is_opened]
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_update_app_passwd
|
31
|
+
short = SecureRandom.hex[3..9]
|
32
|
+
is_opened = (rand(100) % 2) == 0
|
33
|
+
passwd = SecureRandom.hex[0..9]
|
34
|
+
|
35
|
+
update_info = { short: short, password: passwd, open: is_opened }
|
36
|
+
FIR.publish(default_ipa, @options.merge(update_info))
|
37
|
+
|
38
|
+
info = FIR.fetch_app_info
|
39
|
+
|
40
|
+
assert_equal short, info[:short]
|
41
|
+
assert_equal passwd, info[:passwd]
|
42
|
+
assert_equal false, info[:is_opened]
|
43
|
+
end
|
44
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# CodeClimate::TestReporter.start
|
4
|
+
require 'codeclimate-test-reporter'
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start
|
7
|
+
|
8
|
+
|
9
|
+
require 'minitest/autorun'
|
10
|
+
require 'ostruct'
|
11
|
+
require 'securerandom'
|
12
|
+
require 'fir'
|
13
|
+
|
14
|
+
FIR.logger = Logger.new(STDOUT)
|
15
|
+
|
16
|
+
class Minitest::Test
|
17
|
+
|
18
|
+
def default_token
|
19
|
+
'2dd8a99ef9d19c540bb583624b939960'
|
20
|
+
end
|
21
|
+
|
22
|
+
def default_email
|
23
|
+
'fir-cli_test@fir.im'
|
24
|
+
end
|
25
|
+
|
26
|
+
def default_apk
|
27
|
+
File.expand_path('../cases', __FILE__) + '/test_apk.apk'
|
28
|
+
end
|
29
|
+
|
30
|
+
def default_ipa
|
31
|
+
File.expand_path('../cases', __FILE__) + '/test_ipa.ipa'
|
32
|
+
end
|
33
|
+
|
34
|
+
def default_ipa_project
|
35
|
+
File.expand_path('../projects', __FILE__) + '/ipa'
|
36
|
+
end
|
37
|
+
|
38
|
+
def default_apk_project
|
39
|
+
File.expand_path('../projects', __FILE__) + '/apk'
|
40
|
+
end
|
41
|
+
|
42
|
+
def default_ipa_git_url
|
43
|
+
'git@github.com:NaixSpirit/build_ipa_example.git'
|
44
|
+
end
|
45
|
+
|
46
|
+
def default_apk_git_url
|
47
|
+
'git@github.com:NaixSpirit/build_apk_example.git'
|
48
|
+
end
|
49
|
+
|
50
|
+
def default_bughd_project_ios_id
|
51
|
+
'55bb2839692d647a46000004'
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_bughd_project_android_id
|
55
|
+
'55be454a692d351278000002'
|
56
|
+
end
|
57
|
+
|
58
|
+
def default_dsym_mapping
|
59
|
+
File.expand_path('../cases', __FILE__) + '/test_ipa_dsym'
|
60
|
+
end
|
61
|
+
|
62
|
+
def default_txt_mapping
|
63
|
+
File.expand_path('../cases', __FILE__) + '/test_apk_txt'
|
64
|
+
end
|
65
|
+
|
66
|
+
def bigger_txt_mapping
|
67
|
+
File.expand_path('../projects', __FILE__) + '/biggggger.txt'
|
68
|
+
end
|
69
|
+
|
70
|
+
def default_device_udid
|
71
|
+
'cf8b87e3f469d7b185fd64c057778aecbc2017a6'
|
72
|
+
end
|
73
|
+
|
74
|
+
def default_distribution_name
|
75
|
+
'iOSTeam Provisioning Profile: im.fir.* - Fly It Remotely LLC.'
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
# 跑完测试之后再发结果到Codelimate
|
82
|
+
# 测试CODECLIMATE_REPO_TOKEN: c454b9a54151b3ed3e18949279aec49d6a25bf507706815f99a919f1c01679ed
|
83
|
+
Minitest.after_run do
|
84
|
+
COVERAGE_FILE = "coverage/.resultset.json".freeze
|
85
|
+
if (repo_token = ENV["CODECLIMATE_REPO_TOKEN"]) && !repo_token.empty?
|
86
|
+
if File.exist?(COVERAGE_FILE)
|
87
|
+
begin
|
88
|
+
results = JSON.parse(File.read(COVERAGE_FILE))
|
89
|
+
rescue JSON::ParserError => e
|
90
|
+
$stderr.puts "Error encountered while parsing #{COVERAGE_FILE}: #{e}"
|
91
|
+
end
|
92
|
+
|
93
|
+
CodeClimate::TestReporter.run(results)
|
94
|
+
else
|
95
|
+
$stderr.puts "Coverage results not found"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fir-cli-xsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaixSpirit
|
@@ -154,10 +154,79 @@ dependencies:
|
|
154
154
|
description: fir.im command tool, support iOS and Android
|
155
155
|
email:
|
156
156
|
- atpking@gmail.com
|
157
|
-
executables:
|
157
|
+
executables:
|
158
|
+
- console
|
159
|
+
- fir
|
160
|
+
- setup
|
158
161
|
extensions: []
|
159
162
|
extra_rdoc_files: []
|
160
|
-
files:
|
163
|
+
files:
|
164
|
+
- ".codeclimate.yml"
|
165
|
+
- ".dockerignore"
|
166
|
+
- ".flow-plugin.yml"
|
167
|
+
- ".gitignore"
|
168
|
+
- ".travis.yml"
|
169
|
+
- CHANGELOG
|
170
|
+
- Dockerfile
|
171
|
+
- Gemfile
|
172
|
+
- LICENSE.txt
|
173
|
+
- README.md
|
174
|
+
- Rakefile
|
175
|
+
- bin/console
|
176
|
+
- bin/fir
|
177
|
+
- bin/setup
|
178
|
+
- doc/help.md
|
179
|
+
- doc/info.md
|
180
|
+
- doc/install.md
|
181
|
+
- doc/login.md
|
182
|
+
- doc/publish.md
|
183
|
+
- doc/upgrade.md
|
184
|
+
- fir-cli.gemspec
|
185
|
+
- fir.sh
|
186
|
+
- install.sh
|
187
|
+
- lib/fir-cli.rb
|
188
|
+
- lib/fir.rb
|
189
|
+
- lib/fir/api.yml
|
190
|
+
- lib/fir/cli.rb
|
191
|
+
- lib/fir/patches.rb
|
192
|
+
- lib/fir/patches/blank.rb
|
193
|
+
- lib/fir/patches/concern.rb
|
194
|
+
- lib/fir/patches/default_headers.rb
|
195
|
+
- lib/fir/patches/hash.rb
|
196
|
+
- lib/fir/patches/instance_variables.rb
|
197
|
+
- lib/fir/patches/native_patch.rb
|
198
|
+
- lib/fir/patches/os_patch.rb
|
199
|
+
- lib/fir/patches/try.rb
|
200
|
+
- lib/fir/util.rb
|
201
|
+
- lib/fir/util/build_apk.rb
|
202
|
+
- lib/fir/util/build_common.rb
|
203
|
+
- lib/fir/util/build_ipa.rb
|
204
|
+
- lib/fir/util/config.rb
|
205
|
+
- lib/fir/util/http.rb
|
206
|
+
- lib/fir/util/info.rb
|
207
|
+
- lib/fir/util/login.rb
|
208
|
+
- lib/fir/util/mapping.rb
|
209
|
+
- lib/fir/util/me.rb
|
210
|
+
- lib/fir/util/parser/apk.rb
|
211
|
+
- lib/fir/util/parser/bin/pngcrush
|
212
|
+
- lib/fir/util/parser/common.rb
|
213
|
+
- lib/fir/util/parser/ipa.rb
|
214
|
+
- lib/fir/util/parser/pngcrush.rb
|
215
|
+
- lib/fir/util/publish.rb
|
216
|
+
- lib/fir/version.rb
|
217
|
+
- lib/fir/xcode_wrapper.sh
|
218
|
+
- lib/fir_cli.rb
|
219
|
+
- test/build_ipa_test.rb
|
220
|
+
- test/cases/test_apk.apk
|
221
|
+
- test/cases/test_apk_txt
|
222
|
+
- test/cases/test_ipa.ipa
|
223
|
+
- test/cases/test_ipa_dsym
|
224
|
+
- test/info_test.rb
|
225
|
+
- test/login_test.rb
|
226
|
+
- test/mapping_test.rb
|
227
|
+
- test/me_test.rb
|
228
|
+
- test/publish_test.rb
|
229
|
+
- test/test_helper.rb
|
161
230
|
homepage: https://github.com/iamjia/fir-cli
|
162
231
|
licenses:
|
163
232
|
- MIT
|
@@ -189,4 +258,15 @@ rubygems_version: 2.7.7
|
|
189
258
|
signing_key:
|
190
259
|
specification_version: 4
|
191
260
|
summary: fir.im command tool
|
192
|
-
test_files:
|
261
|
+
test_files:
|
262
|
+
- test/build_ipa_test.rb
|
263
|
+
- test/cases/test_apk.apk
|
264
|
+
- test/cases/test_apk_txt
|
265
|
+
- test/cases/test_ipa.ipa
|
266
|
+
- test/cases/test_ipa_dsym
|
267
|
+
- test/info_test.rb
|
268
|
+
- test/login_test.rb
|
269
|
+
- test/mapping_test.rb
|
270
|
+
- test/me_test.rb
|
271
|
+
- test/publish_test.rb
|
272
|
+
- test/test_helper.rb
|