lhj-tools 0.1.51 → 0.1.54

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
  SHA256:
3
- metadata.gz: de06842336189852e95b075ad1453d775ba3c6772d4a65992137231184d4fbb3
4
- data.tar.gz: 39afffe676c83d5813cfa161fe9973099783198452695e84441a15caaad9cd26
3
+ metadata.gz: ba3c81ae4e0b59daafc45266b2b3fea814b1a15547eb0501b3e2bba19b167240
4
+ data.tar.gz: 5c818f2bffe07c9e3f5ef50544f82ecc4303f2b020099ba0064cf93f12575723
5
5
  SHA512:
6
- metadata.gz: d8f6b7401acebd536537b2230222a67bb2f35ff544a5b5a6c23732176a1d221617e4ddf7eefe1f17d0a8195230722b708581b350cab33c3e2027badf4406cd30
7
- data.tar.gz: 7957577a7f52e83aca575f09300e01b78e2737db0844c72ace6d4103546386c40e967ecb2cef7d4b5f758b81cac11892b5db77f26cdf7690f75edd682e915424
6
+ metadata.gz: a87a98b3150d9763a7e41f153a3af6ef8291e7ae1074c8c12fd6f51fafc4ed36557605bb484d13d2b3ae5e9a58b0ffac69b95af951f15023bc1a90e06ddd78a5
7
+ data.tar.gz: 20d3838363aa11ce08db7e18f5ff5efb24abcb627e2b3ab1b8c15c72bbf0d0555eda8d8a8742ddd892fda9ecbef387904480616173faccc011d57808bfe05ef5
@@ -0,0 +1,43 @@
1
+ require 'lhj/config'
2
+ require 'highline'
3
+ require 'lhj/helper/pod_repo_config'
4
+
5
+ module Lhj
6
+ class Command
7
+ # sync code to pod
8
+ class SyncPodCode < Command
9
+ self.summary = '同步代码到目标目录'
10
+
11
+ def initialize(argv)
12
+ @cli = HighLine.new
13
+ super
14
+ end
15
+
16
+ def begin_title
17
+ '读取映射文件~/.lhj/pod_config.yml'
18
+ end
19
+
20
+ def handle
21
+ sync
22
+ end
23
+
24
+ def sync
25
+ config_file = File.join(Lhj::Config.instance.home_dir, 'pod_config.yml')
26
+ arr = YAML.load_file(config_file)
27
+ arr.each_index { |i| puts "#{i}.#{arr[i]['pod']}".yellow }
28
+ idx = @cli.ask('请选择哪一个库同步: '.green).strip.to_i
29
+ src = arr[idx]['main_path']
30
+ dest = arr[idx]['pod_path']
31
+ FileUtils.cp_r(src, dest, remove_destination: true)
32
+ puts '1.从主工程复制代码到pod库成功'.green
33
+
34
+ Dir.chdir(dest) do
35
+
36
+ Actions.sh('git add .')
37
+ puts '2.git add成功'.green
38
+
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
data/lib/lhj/command.rb CHANGED
@@ -27,6 +27,7 @@ module Lhj
27
27
  require 'lhj/command/http'
28
28
  require 'lhj/command/sync_pod_repo'
29
29
  require 'lhj/command/sync_pod_version'
30
+ require 'lhj/command/sync_pod_code'
30
31
  require 'lhj/command/pgyer_upload'
31
32
  require 'lhj/command/duplicate_imageset'
32
33
  require 'lhj/command/jenkins_build'
@@ -0,0 +1,66 @@
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
+ end
13
+
14
+ # build_app_version (build_app_version_no) (build: build_version)
15
+ def build_info
16
+ "#{build_app_version} (#{build_app_version_no}) (build: #{build_version})"
17
+ end
18
+
19
+ def build_app_version
20
+ # app version '1.0.0'
21
+ vers = []
22
+ Dir.glob("#{@work_path}/*.xcodeproj/*.pbxproj").each do |file|
23
+ File.readlines(file).each do |l|
24
+ if /MARKETING_VERSION.*(\d+\.\d+\.\d+)/ =~ l
25
+ ma = l.match(/(\d+\.\d+\.\d+)/)
26
+ vers << ma[0]
27
+ end
28
+ end
29
+ end
30
+ vers[0]
31
+ end
32
+
33
+ def build_app_version_no
34
+ # xcode build version
35
+ # ${BUILD_NUMBER} of jenkins
36
+ @build_number || '1'
37
+ end
38
+
39
+ def build_version
40
+ # pu gong ying build number
41
+ client = Lhj::PgyerShortcut.new(@env)
42
+ version = 0
43
+ version = client.build_version.to_i if client.build_version
44
+ version += 1
45
+ version.to_s
46
+ end
47
+
48
+ def build_updated
49
+ time = Time.now
50
+ time.strftime('%Y-%m-%d %H:%M:%S')
51
+ end
52
+
53
+ def branch_name
54
+ Dir.chdir(@work_path) do
55
+ Lhj::LogHelper.instance.current_branch(@work_path)
56
+ end
57
+ end
58
+
59
+ def update_log
60
+ Dir.chdir(@work_path) do
61
+ Lhj::Actions.git_log_last_commits(' %an %ar - %s;', 3, :exclude_merges, 'short', false)
62
+ end
63
+ end
64
+
65
+ end
66
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.51"
5
+ VERSION = "0.1.54"
6
6
  end
7
7
  end
data/lib/lhj/tools.rb CHANGED
@@ -21,6 +21,7 @@ module Lhj
21
21
  require 'lhj/helper/git_helper'
22
22
  require 'lhj/helper/log_helper'
23
23
  require 'lhj/helper/vika_helper'
24
+ require 'lhj/helper/app_version_info'
24
25
 
25
26
  class Error < StandardError; end
26
27
 
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.51
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-18 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -320,6 +320,7 @@ files:
320
320
  - lib/lhj/command/refactor_rename.rb
321
321
  - lib/lhj/command/rename_image.rb
322
322
  - lib/lhj/command/reverse_import.rb
323
+ - lib/lhj/command/sync_pod_code.rb
323
324
  - lib/lhj/command/sync_pod_repo.rb
324
325
  - lib/lhj/command/sync_pod_version.rb
325
326
  - lib/lhj/command/template.rb
@@ -334,6 +335,7 @@ files:
334
335
  - lib/lhj/command/yapi/formatters/template/yapi.erb
335
336
  - lib/lhj/config.rb
336
337
  - lib/lhj/env.rb
338
+ - lib/lhj/helper/app_version_info.rb
337
339
  - lib/lhj/helper/dingtalk_config.rb
338
340
  - lib/lhj/helper/dingtalk_helper.rb
339
341
  - lib/lhj/helper/git_branch_feature_config.rb