lhj-tools 0.1.52 → 0.1.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhj/helper/app_version_info.rb +75 -0
- data/lib/lhj/helper/pgyer_helper.rb +5 -5
- data/lib/lhj/tools/version.rb +1 -1
- data/lib/lhj/tools.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b66a2c394691aa23ab4da26a83f5f9623e68c4355cb7f782916568f969a17b6d
|
4
|
+
data.tar.gz: 9b41f62a7770b26363f9db7b434f1e56b3fb3d72de4e5c78cd10f3f9478d5018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f1fcb3e75bf22881735c6e768d3c95cc0d506f89641edf52695565b700b7e7e92cebecaa7bef7a000f19279d487389597a1581b8e82e9146f5eb1e9ded789ee
|
7
|
+
data.tar.gz: 8b3900e23599f314e11205b488b0804e31e90f7080527c1f3635da9258ee1f13c8ee45b19e62657a7d9701edff2dc19b0fa2e657dbf137d9897a3c0d9cf01cb3
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_relative 'log_helper'
|
2
|
+
require_relative 'pgyer_shortcut_helper'
|
3
|
+
|
4
|
+
module Lhj
|
5
|
+
# version info
|
6
|
+
class AppVersionInfo
|
7
|
+
# @param [Symbol] env
|
8
|
+
def initialize(env, build_number, work_path)
|
9
|
+
@env = env
|
10
|
+
@build_number = build_number
|
11
|
+
@work_path = work_path
|
12
|
+
setup_config
|
13
|
+
end
|
14
|
+
|
15
|
+
def setup_config
|
16
|
+
number = build_app_version_no
|
17
|
+
Dir.chdir(@work_path) do
|
18
|
+
command = %(xcrun agvtool new-version -all #{number})
|
19
|
+
Actions.sh(command, log: false)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# build_app_version (build_app_version_no) (build: build_version)
|
24
|
+
def build_info
|
25
|
+
"#{build_app_version} (#{build_app_version_no}) (build: #{build_version})"
|
26
|
+
end
|
27
|
+
|
28
|
+
def build_app_version
|
29
|
+
# app version '1.0.0'
|
30
|
+
vers = []
|
31
|
+
Dir.glob("#{@work_path}/*.xcodeproj/*.pbxproj").each do |file|
|
32
|
+
File.readlines(file).each do |l|
|
33
|
+
if /MARKETING_VERSION.*(\d+\.\d+\.\d+)/ =~ l
|
34
|
+
ma = l.match(/(\d+\.\d+\.\d+)/)
|
35
|
+
vers << ma[0]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
vers[0]
|
40
|
+
end
|
41
|
+
|
42
|
+
def build_app_version_no
|
43
|
+
# xcode build version
|
44
|
+
# ${BUILD_NUMBER} of jenkins
|
45
|
+
@build_number || '1'
|
46
|
+
end
|
47
|
+
|
48
|
+
def build_version
|
49
|
+
# pu gong ying build number
|
50
|
+
client = Lhj::PgyerShortcut.new(@env)
|
51
|
+
version = 0
|
52
|
+
version = client.build_version.to_i if client.build_version
|
53
|
+
version += 1
|
54
|
+
version.to_s
|
55
|
+
end
|
56
|
+
|
57
|
+
def build_updated
|
58
|
+
time = Time.now
|
59
|
+
time.strftime('%Y-%m-%d %H:%M:%S')
|
60
|
+
end
|
61
|
+
|
62
|
+
def branch_name
|
63
|
+
Dir.chdir(@work_path) do
|
64
|
+
Lhj::LogHelper.instance.current_branch(@work_path)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def update_log
|
69
|
+
Dir.chdir(@work_path) do
|
70
|
+
Lhj::Actions.git_log_last_commits(' %an %ar - %s;', 3, :exclude_merges, 'short', false)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
@@ -64,11 +64,11 @@ module Lhj
|
|
64
64
|
@result = response.body
|
65
65
|
puts @result
|
66
66
|
puts 'upload success'
|
67
|
-
if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
67
|
+
# if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
|
68
|
+
# str = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
|
69
|
+
# str = Lhj::VikaHelper.trans_vika(str)
|
70
|
+
# @result['data']['appUpdateDescription'] = str
|
71
|
+
# end
|
72
72
|
rescue Faraday::TimeoutError
|
73
73
|
puts 'upload fail'
|
74
74
|
end
|
data/lib/lhj/tools/version.rb
CHANGED
data/lib/lhj/tools.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhj-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -335,6 +335,7 @@ files:
|
|
335
335
|
- lib/lhj/command/yapi/formatters/template/yapi.erb
|
336
336
|
- lib/lhj/config.rb
|
337
337
|
- lib/lhj/env.rb
|
338
|
+
- lib/lhj/helper/app_version_info.rb
|
338
339
|
- lib/lhj/helper/dingtalk_config.rb
|
339
340
|
- lib/lhj/helper/dingtalk_helper.rb
|
340
341
|
- lib/lhj/helper/git_branch_feature_config.rb
|