ykcitool 0.4.9 → 0.4.11
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/README.md +5 -0
- data/bin/ykcitool +2 -2
- data/lib/actions/YKFastlaneExecute.rb +3 -3
- data/lib/actions/archive.rb +11 -11
- data/lib/actions/archiveHelper.rb +6 -6
- data/lib/actions/certificate.rb +7 -2
- data/lib/actions/git.rb +2 -2
- data/lib/actions/init.rb +13 -13
- data/lib/actions/pod.rb +4 -4
- data/lib/createPod/module.rb +17 -0
- data/lib/interface.rb +17 -10
- data/lib/ykfastlane/helper.rb +4 -4
- data/lib/ykfastlane/tools.rb +1 -1
- data/lib/ykfastlane/version.rb +2 -2
- metadata +6 -10
- data/lib/GitTools/git_analysis.rb +0 -109
- data/lib/HttpService/HttpServiceHelper.rb +0 -28
- data/lib/HttpService/git_tag_analysis_handler.rb +0 -20
- data/lib/actions/ykgit.rb +0 -28
- data/lib/actions/ykservice_http.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db248ffb0abe6676a820e456acb5dace6b4cfad0ccc07b8066860efbd13efa4b
|
4
|
+
data.tar.gz: d710dfa65d26be5bceae9106633e19ee0a67de6101e3ecf11b36e5108d71a607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8af0d106bdfb205fffab2cabee9de7496cb6fb2cc84ea436f4ecefce259ddde9eb784c38b7b928fec84b6fb8036c0406f906cd6f8abcfd31fec774a3d13e5d7
|
7
|
+
data.tar.gz: 749a71b8a8790fb3090f7158c7405c7fd663855943ab968499f2bd5aa6e16a591f76545745a0c2319becce5d6cdd5e5bafd356d9cddb31c2b770e78223198700
|
data/README.md
CHANGED
@@ -12,6 +12,11 @@ iOS 通用打包工具的终端门户工具
|
|
12
12
|
- [License](#license)
|
13
13
|
- [建议](#建议)
|
14
14
|
|
15
|
+
## 扩展工具
|
16
|
+
|
17
|
+
- 组件规范【[跳转](./ComponentStandard/ComponentStandard.md)】
|
18
|
+
- 组件模板工具 cocoapods-ykutility 【[跳转](https://rubygems.org/gems/cocoapods-ykutility)】
|
19
|
+
|
15
20
|
## Installation
|
16
21
|
|
17
22
|
本指令集适用与ruby 2.7.5 ~ 3.0.3
|
data/bin/ykcitool
CHANGED
@@ -14,7 +14,7 @@ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
|
14
14
|
# require "pry"
|
15
15
|
# Pry.start
|
16
16
|
require 'interface'
|
17
|
-
puts "call ykcitool:#{
|
17
|
+
puts "call ykcitool:#{YKCitool::VERSION}"
|
18
18
|
|
19
19
|
puts "ykcitool start"
|
20
|
-
|
20
|
+
YKCitool::Interface.start(ARGV)
|
@@ -3,7 +3,7 @@ require 'thor'
|
|
3
3
|
|
4
4
|
require "ykfastlane/helper"
|
5
5
|
|
6
|
-
module
|
6
|
+
module YKCitool
|
7
7
|
|
8
8
|
class SubCommandBase < Thor
|
9
9
|
class_option :verbose, :type => :boolean
|
@@ -71,7 +71,7 @@ module YKFastlane
|
|
71
71
|
dict = {}
|
72
72
|
dict.update(optionHash)
|
73
73
|
if optionHash[:wxwork_access_token].blank?
|
74
|
-
wxtoken =
|
74
|
+
wxtoken = YKCitool::Helper.load_config_value(YKCitool::Helper::K_wx_access_token)
|
75
75
|
dict.update({:wxwork_access_token => wxtoken})
|
76
76
|
end
|
77
77
|
|
@@ -79,7 +79,7 @@ module YKFastlane
|
|
79
79
|
command = "fastlane #{lane_name} #{option_str}" unless option_str.blank?
|
80
80
|
|
81
81
|
command_pre = "export LANG=en_US.UTF-8 && export LANGUAGE=en_US.UTF-8 && export LC_ALL=en_US.UTF-8 && which ruby"
|
82
|
-
command_pre << " && cd #{
|
82
|
+
command_pre << " && cd #{YKCitool::Helper.fastlane_script()}"
|
83
83
|
|
84
84
|
executeCommand(command_pre, command, lane_name)
|
85
85
|
end
|
data/lib/actions/archive.rb
CHANGED
@@ -3,15 +3,15 @@ require 'ykfastlane/version'
|
|
3
3
|
require 'ykfastlane/tools'
|
4
4
|
require 'ykfastlane/helper'
|
5
5
|
require 'actions/archiveHelper'
|
6
|
-
module
|
6
|
+
module YKCitool
|
7
7
|
|
8
|
-
class Archive <
|
9
|
-
include
|
8
|
+
class Archive < YKCitool::SubCommandBase
|
9
|
+
include YKCitool::ArchiveHelper
|
10
10
|
|
11
11
|
desc "display_product_path", "display archive output path"
|
12
12
|
|
13
13
|
def display_product_path()
|
14
|
-
|
14
|
+
YKCitool::Tools.UI(YKARCHIVE_PRODUCT_PATH)
|
15
15
|
end
|
16
16
|
|
17
17
|
no_commands {
|
@@ -22,7 +22,7 @@ module YKFastlane
|
|
22
22
|
K_archiveEnv_pgyer_api => options[:pgyer_api],
|
23
23
|
K_archiveEnv_pgyer_user => options[:pgyer_user]
|
24
24
|
}
|
25
|
-
self.update_archive_map(
|
25
|
+
self.update_archive_map(YKCitool::ArchiveHelper::K_archiveEnv_config_pgyer, pgyerinfo)
|
26
26
|
puts "archive update pgyer info success"
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ module YKFastlane
|
|
30
30
|
fir_info = {
|
31
31
|
K_archiveEnv_firApiToken => options[:fir_api_token]
|
32
32
|
}
|
33
|
-
self.update_archive_map(
|
33
|
+
self.update_archive_map(YKCitool::ArchiveHelper::K_archiveEnv_config_fir, fir_info)
|
34
34
|
puts "archive update fir info success"
|
35
35
|
end
|
36
36
|
|
@@ -39,7 +39,7 @@ module YKFastlane
|
|
39
39
|
K_archiveEnv_tf_account => options[:apple_account],
|
40
40
|
K_archiveEnv_tf_password => options[:apple_password]
|
41
41
|
}
|
42
|
-
self.update_archive_map(
|
42
|
+
self.update_archive_map(YKCitool::ArchiveHelper::K_archiveEnv_config_tf, tf_info)
|
43
43
|
puts "archive update tf info success"
|
44
44
|
end
|
45
45
|
end
|
@@ -55,7 +55,7 @@ module YKFastlane
|
|
55
55
|
def upload_tf()
|
56
56
|
puts "upload_tf"
|
57
57
|
if options[:user_name].blank? || options[:pass_word].blank?
|
58
|
-
apple_info = self.load_archive_config_dict(
|
58
|
+
apple_info = self.load_archive_config_dict(YKCitool::ArchiveHelper::K_archiveEnv_config_tf)
|
59
59
|
options.update(apple_dict)
|
60
60
|
end
|
61
61
|
|
@@ -77,7 +77,7 @@ module YKFastlane
|
|
77
77
|
def tf()
|
78
78
|
puts "archive_tf"
|
79
79
|
if options[:user_name].blank? || options[:pass_word].blank?
|
80
|
-
apple_dict = self.load_archive_config_dict(
|
80
|
+
apple_dict = self.load_archive_config_dict(YKCitool::ArchiveHelper::K_archiveEnv_config_tf)
|
81
81
|
if apple_dict != nil && apple_dict.blank?() == false
|
82
82
|
options.update(apple_dict)
|
83
83
|
end
|
@@ -102,7 +102,7 @@ module YKFastlane
|
|
102
102
|
puts "archive_pgyer"
|
103
103
|
|
104
104
|
if options[:pgyer_user].blank? || options[:pgyer_api].blank?
|
105
|
-
dict = self.load_archive_config_dict(
|
105
|
+
dict = self.load_archive_config_dict(YKCitool::ArchiveHelper::K_archiveEnv_config_pgyer)
|
106
106
|
options.update(dict)
|
107
107
|
end
|
108
108
|
|
@@ -123,7 +123,7 @@ module YKFastlane
|
|
123
123
|
def fir()
|
124
124
|
puts "archive_fir"
|
125
125
|
if options[:fir_api_token].blank?
|
126
|
-
dict = self.load_archive_config_dict(
|
126
|
+
dict = self.load_archive_config_dict(YKCitool::ArchiveHelper::K_archiveEnv_config_fir)
|
127
127
|
options.update(dict)
|
128
128
|
end
|
129
129
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'ykfastlane/version'
|
2
2
|
require 'ykfastlane/tools'
|
3
3
|
require 'ykfastlane/helper'
|
4
|
-
module
|
4
|
+
module YKCitool
|
5
5
|
|
6
6
|
module ArchiveHelper
|
7
7
|
YKARCHIVE_PRODUCT_PATH = File.expand_path(File.join(Dir.home, "iosYeahArchive"))
|
8
8
|
|
9
|
-
YKARCHIVE_ENV_PATH = File.join(
|
9
|
+
YKARCHIVE_ENV_PATH = File.join(YKCitool::YKFASTLANE_ENV_PATH, 'archive_config', 'archive_config.yml')
|
10
10
|
|
11
11
|
K_archiveEnv_config_tf = :test_flight
|
12
12
|
K_archiveEnv_tf_account = :user_name
|
@@ -20,20 +20,20 @@ module YKFastlane
|
|
20
20
|
K_archiveEnv_pgyer_api = :pgyer_api
|
21
21
|
|
22
22
|
def self.update_archive_map(key, value)
|
23
|
-
|
23
|
+
YKCitool::Tools.update_yml("", YKARCHIVE_ENV_PATH, key, value)
|
24
24
|
end
|
25
25
|
|
26
26
|
def update_archive_map(key, value)
|
27
|
-
|
27
|
+
YKCitool::Tools.update_yml("", YKARCHIVE_ENV_PATH, key, value)
|
28
28
|
end
|
29
29
|
|
30
30
|
def load_archive_config_dict(platform_name)
|
31
|
-
dict =
|
31
|
+
dict = YKCitool::Tools.load_yml_value(YKARCHIVE_ENV_PATH, platform_name)
|
32
32
|
return dict == nil ? {} : dict
|
33
33
|
end
|
34
34
|
|
35
35
|
def list_user_map()
|
36
|
-
|
36
|
+
YKCitool::Tools.display_yml(YKARCHIVE_ENV_PATH)
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
data/lib/actions/certificate.rb
CHANGED
@@ -3,8 +3,13 @@ require 'ykfastlane/helper'
|
|
3
3
|
require 'thor'
|
4
4
|
require 'openssl'
|
5
5
|
|
6
|
-
module
|
7
|
-
class Certificate <
|
6
|
+
module YKCitool
|
7
|
+
class Certificate < YKCitool::SubCommandBase
|
8
|
+
|
9
|
+
desc "list_config", "List all certificate and profiles info"
|
10
|
+
def list_config()
|
11
|
+
self.list_details_execute()
|
12
|
+
end
|
8
13
|
|
9
14
|
desc "sync_apple_profile", "sync and install mobile provision file from apple developer service"
|
10
15
|
option :user_name, :require => true, :type => :string, :aliases => :u, :desc => 'apple account'
|
data/lib/actions/git.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'actions/YKFastlaneExecute'
|
2
2
|
|
3
|
-
module
|
4
|
-
class Git <
|
3
|
+
module YKCitool
|
4
|
+
class Git < YKCitool::SubCommandBase
|
5
5
|
desc "analysis_commit", "analysis git commit"
|
6
6
|
option :path, :require => false, :type => :string, :aliases => :p, :desc => 'the path should be analysised'
|
7
7
|
|
data/lib/actions/init.rb
CHANGED
@@ -5,8 +5,8 @@ require 'json'
|
|
5
5
|
require 'actions/YKFastlaneExecute'
|
6
6
|
require 'actions/archiveHelper'
|
7
7
|
|
8
|
-
module
|
9
|
-
class Init <
|
8
|
+
module YKCitool
|
9
|
+
class Init < YKCitool::SubCommandBase
|
10
10
|
include Helper
|
11
11
|
|
12
12
|
desc "execute_configs", "execute configs that user defines"
|
@@ -34,7 +34,7 @@ module YKFastlane
|
|
34
34
|
|
35
35
|
option :wx_access_token, :aliases => :t, :type => :string, :desc => "enterprise wechat robot token"
|
36
36
|
|
37
|
-
option :profile_remote_url, :aliases => :r, :require => false, :type => :string, :desc => "profile & certificate git remote url, example:#{
|
37
|
+
option :profile_remote_url, :aliases => :r, :require => false, :type => :string, :desc => "profile & certificate git remote url, example:#{YKCitool::Helper.default_certificate_git_remote}"
|
38
38
|
|
39
39
|
option :pgyer_user, :aliases => :u, :type => :string, :required => false, :desc => 'pgyer 平台 user'
|
40
40
|
option :pgyer_api, :aliases => :a, :type => :string, :required => false, :desc => 'pgyer 平台 api, 配置链接: \033[0;32m https://appleid.apple.com/account/manage \e[0m'
|
@@ -49,9 +49,9 @@ module YKFastlane
|
|
49
49
|
require 'actions/archive'
|
50
50
|
puts("all_config:#{options}")
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
YKCitool::Init.new().config_execute(options)
|
53
|
+
YKCitool::Archive.new().platform_edit_user_execute(options)
|
54
|
+
YKCitool::Certificate.new().sync_git_execute(options) unless options[:profile_remote_url].blank?
|
55
55
|
end
|
56
56
|
|
57
57
|
desc 'define_fast_execute_path', "指定fastlane文件的路径,此处是为了调试fastlane脚本"
|
@@ -69,11 +69,11 @@ module YKFastlane
|
|
69
69
|
require 'actions/certificate'
|
70
70
|
require 'actions/archive'
|
71
71
|
|
72
|
-
|
72
|
+
YKCitool::Certificate.new().list_details_execute()
|
73
73
|
|
74
|
-
|
74
|
+
YKCitool::Archive.new().list_platform_user_execute()
|
75
75
|
Helper.display_config_yml
|
76
|
-
|
76
|
+
YKCitool::Archive.new().list_profiles_execute()
|
77
77
|
end
|
78
78
|
|
79
79
|
no_commands {
|
@@ -82,13 +82,13 @@ module YKFastlane
|
|
82
82
|
|
83
83
|
if options[:all] == true
|
84
84
|
self.sync_script_execute({})
|
85
|
-
|
85
|
+
YKCitool::Certificate.new().sync_git_execute({})
|
86
86
|
else
|
87
87
|
if options[:script] == true
|
88
88
|
self.sync_script_execute({})
|
89
89
|
end
|
90
90
|
if options[:profile] == true
|
91
|
-
|
91
|
+
YKCitool::Certificate.new().sync_git_execute({})
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -105,7 +105,7 @@ module YKFastlane
|
|
105
105
|
p_temp = p + "_temp"
|
106
106
|
FileUtils.remove_dir(p_temp, force: true)
|
107
107
|
|
108
|
-
cloneResult =
|
108
|
+
cloneResult = YKCitool::Tools.clone_git_repository(fastfile_remote, p_temp)
|
109
109
|
if cloneResult != 0
|
110
110
|
exit cloneResult
|
111
111
|
end
|
@@ -135,7 +135,7 @@ module YKFastlane
|
|
135
135
|
end
|
136
136
|
|
137
137
|
Helper.update_config('', Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
138
|
-
|
138
|
+
YKCitool::ArchiveHelper.update_archive_map(Helper::K_wx_access_token, options[:wx_access_token]) unless options[:wx_access_token].blank?
|
139
139
|
Helper.display_config_yml
|
140
140
|
end
|
141
141
|
}
|
data/lib/actions/pod.rb
CHANGED
@@ -2,8 +2,8 @@ require 'actions/YKFastlaneExecute'
|
|
2
2
|
require 'ykfastlane/helper'
|
3
3
|
require 'rails'
|
4
4
|
|
5
|
-
module
|
6
|
-
class Pod <
|
5
|
+
module YKCitool
|
6
|
+
class Pod < YKCitool::SubCommandBase
|
7
7
|
desc 'github_transfer', '迁移github三方库到移开gitlab.'
|
8
8
|
long_desc <<-LONGDESC
|
9
9
|
1. 需要在移开gitlab创建一个同名的git仓库.
|
@@ -18,11 +18,11 @@ module YKFastlane
|
|
18
18
|
def github_transfer()
|
19
19
|
puts "github_pod_transfer"
|
20
20
|
if options[:wxwork_access_token].blank?
|
21
|
-
wxtoken =
|
21
|
+
wxtoken = YKCitool::Helper.load_config_value(YKCitool::Helper::K_wx_access_token)
|
22
22
|
options[:wxwork_access_token] = wxtoken unless wxtoken.blank?
|
23
23
|
end
|
24
24
|
|
25
|
-
code =
|
25
|
+
code = YKCitool::YKFastlaneExecute.executeFastlaneLane("github_pod_transfer", options)
|
26
26
|
exit(code)
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'ykfastlane/helper'
|
3
|
+
require 'rails'
|
4
|
+
|
5
|
+
module YKCitool
|
6
|
+
class Module < YKCitool::SubCommandBase
|
7
|
+
include Helper
|
8
|
+
|
9
|
+
desc "standard", "创建标准组件"
|
10
|
+
option :name, :required => true, :type => :string, :aliases => :n, :desc => 'module name'
|
11
|
+
option :language, :required => true, :type => :string, :aliases => :l, :desc => 'module language objc/swift'
|
12
|
+
option :path, :required => false, :type => :string, :aliases => :p, :desc => 'module path'
|
13
|
+
def standard()
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/interface.rb
CHANGED
@@ -6,16 +6,18 @@ require 'actions/YKFastlaneExecute'
|
|
6
6
|
require 'actions/archive'
|
7
7
|
require 'actions/pod'
|
8
8
|
require 'actions/init'
|
9
|
+
require 'createPod/module'
|
9
10
|
require 'actions/certificate'
|
10
11
|
require 'thor'
|
11
12
|
|
12
|
-
module
|
13
|
+
module YKCitool
|
13
14
|
class Interface < Thor
|
14
15
|
include Thor::Actions
|
15
16
|
require_relative 'actions/YKFastlaneExecute'
|
16
|
-
include
|
17
|
+
include YKCitool::Helper
|
17
18
|
|
18
19
|
class_option :verbose, :type => :boolean
|
20
|
+
|
19
21
|
def self.exit_on_failure?
|
20
22
|
true
|
21
23
|
end
|
@@ -24,33 +26,38 @@ module YKFastlane
|
|
24
26
|
#
|
25
27
|
# def lanes()
|
26
28
|
# puts "lanes"
|
27
|
-
# code =
|
29
|
+
# code = YKCitool::YKFastlaneExecute.executeFastlaneLane("lanes", options)
|
28
30
|
# exit(code)
|
29
31
|
# end
|
30
32
|
|
31
33
|
desc "archive", "archive functions"
|
32
|
-
subcommand "archive",
|
34
|
+
subcommand "archive", YKCitool::Archive
|
33
35
|
|
34
36
|
# desc "pod", "cocoapods functions"
|
35
|
-
# subcommand "pod",
|
37
|
+
# subcommand "pod", YKCitool::Pod
|
36
38
|
|
37
39
|
desc "init", "init ykcitool"
|
38
|
-
subcommand "init",
|
40
|
+
subcommand "init", YKCitool::Init
|
39
41
|
|
40
42
|
desc "certificate", "manager ios certificate & profile files"
|
41
|
-
subcommand "certificate",
|
43
|
+
subcommand "certificate", YKCitool::Certificate
|
44
|
+
|
45
|
+
desc "module", "create module"
|
46
|
+
subcommand "module", YKCitool::Module
|
47
|
+
|
48
|
+
desc "update", "update ykcitool"
|
42
49
|
|
43
|
-
desc "update", "update ykcitool"
|
44
50
|
def update()
|
45
51
|
require 'actions/YKFastlaneExecute'
|
46
|
-
code =
|
52
|
+
code = YKCitool::YKFastlaneExecute.executeCommand("gem uninstall ykcitool -a -x", "gem install ykcitool", "")
|
47
53
|
exit! code unless code == 0
|
48
54
|
end
|
49
55
|
|
50
56
|
desc "uninstall", "uninstall self"
|
57
|
+
|
51
58
|
def uninstall()
|
52
59
|
require 'actions/YKFastlaneExecute'
|
53
|
-
code =
|
60
|
+
code = YKCitool::YKFastlaneExecute.executeCommand("gem uninstall ykcitool -a -x", "", "")
|
54
61
|
exit! code unless code == 0
|
55
62
|
end
|
56
63
|
|
data/lib/ykfastlane/helper.rb
CHANGED
@@ -2,16 +2,16 @@ require 'yaml'
|
|
2
2
|
require 'json'
|
3
3
|
require 'ykfastlane/tools'
|
4
4
|
require 'ykfastlane/version'
|
5
|
-
module
|
5
|
+
module YKCitool
|
6
6
|
module Helper
|
7
|
-
include
|
7
|
+
include YKCitool::Tools
|
8
8
|
'' '脚本当前工作路径' ''
|
9
9
|
YKRUNING_PATH = File.expand_path(Dir.pwd)
|
10
10
|
'' '配置文件放置路径' ''
|
11
|
-
YKCONFIG_PATH = File.expand_path(File.join(
|
11
|
+
YKCONFIG_PATH = File.expand_path(File.join(YKCitool::YKFASTLANE_ENV_PATH, 'evnConfig.yml'))
|
12
12
|
|
13
13
|
'' 'fastlane脚本放置路径' ''
|
14
|
-
YKFastlne_SCRIPT_PATH = File.expand_path(File.join(
|
14
|
+
YKFastlne_SCRIPT_PATH = File.expand_path(File.join(YKCitool::YKFASTLANE_ENV_PATH, 'ykfastlane_script'))
|
15
15
|
|
16
16
|
def self.load_config_yml()
|
17
17
|
Tools.load_yml(Helper::YKCONFIG_PATH)
|
data/lib/ykfastlane/tools.rb
CHANGED
data/lib/ykfastlane/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ykcitool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stephen.chen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -147,9 +147,6 @@ files:
|
|
147
147
|
- LICENSE.txt
|
148
148
|
- README.md
|
149
149
|
- bin/ykcitool
|
150
|
-
- lib/GitTools/git_analysis.rb
|
151
|
-
- lib/HttpService/HttpServiceHelper.rb
|
152
|
-
- lib/HttpService/git_tag_analysis_handler.rb
|
153
150
|
- lib/actions/YKFastlaneExecute.rb
|
154
151
|
- lib/actions/archive.rb
|
155
152
|
- lib/actions/archiveHelper.rb
|
@@ -157,8 +154,7 @@ files:
|
|
157
154
|
- lib/actions/git.rb
|
158
155
|
- lib/actions/init.rb
|
159
156
|
- lib/actions/pod.rb
|
160
|
-
- lib/
|
161
|
-
- lib/actions/ykservice_http.rb
|
157
|
+
- lib/createPod/module.rb
|
162
158
|
- lib/interface.rb
|
163
159
|
- lib/ykfastlane/helper.rb
|
164
160
|
- lib/ykfastlane/tools.rb
|
@@ -167,7 +163,7 @@ homepage: https://github.com/stephen5652/ykcitool.git
|
|
167
163
|
licenses:
|
168
164
|
- MIT
|
169
165
|
metadata: {}
|
170
|
-
post_install_message:
|
166
|
+
post_install_message:
|
171
167
|
rdoc_options: []
|
172
168
|
require_paths:
|
173
169
|
- lib
|
@@ -183,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
179
|
version: '0'
|
184
180
|
requirements: []
|
185
181
|
rubygems_version: 3.1.6
|
186
|
-
signing_key:
|
182
|
+
signing_key:
|
187
183
|
specification_version: 4
|
188
184
|
summary: iOS 打包工具.
|
189
185
|
test_files: []
|
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'ykfastlane/helper'
|
2
|
-
|
3
|
-
require 'git'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
module YKFastlane
|
7
|
-
module GitAnalysis
|
8
|
-
include Git
|
9
|
-
|
10
|
-
def self.commit_tag_diff(path)
|
11
|
-
git = Git::open(path)
|
12
|
-
last_tag = self.last_tag_on_branch(git)
|
13
|
-
tag_name = last_tag.name unless last_tag == nil
|
14
|
-
|
15
|
-
tag_commit = last_tag.log(1).last unless last_tag == nil
|
16
|
-
tag_commit = git.log(0x7fffffff).last if tag_commit == nil
|
17
|
-
tag_sha = tag_commit.sha unless tag_commit == nil
|
18
|
-
|
19
|
-
cur_commit = git.log(1).first
|
20
|
-
cur_sha = cur_commit.sha unless cur_commit == nil
|
21
|
-
|
22
|
-
diff = self.diff_between?(path, tag_sha, cur_sha)
|
23
|
-
|
24
|
-
result = {
|
25
|
-
:tag_name => tag_name,
|
26
|
-
}
|
27
|
-
result.update(diff)
|
28
|
-
result
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
def commit_tag_diff(path)
|
33
|
-
YKFastlane::GitAnalysis.commit_tag_diff(path)
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def self.sha_existed?(git, sha)
|
39
|
-
result = true
|
40
|
-
begin
|
41
|
-
start_type = git.lib.object_type(sha)
|
42
|
-
rescue Git::GitExecuteError => e
|
43
|
-
result = false
|
44
|
-
end
|
45
|
-
result
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.diff_between?(path, id_start, id_end)
|
49
|
-
git = Git::open(path)
|
50
|
-
|
51
|
-
# id_start = "0d5e5d4d7e8f8a9b" #debug code
|
52
|
-
# id_end = "2347682023948" #debug code
|
53
|
-
status = true
|
54
|
-
msg_arr = []
|
55
|
-
if self.sha_existed?(git, id_start) == false
|
56
|
-
status = false
|
57
|
-
msg_arr << id_start
|
58
|
-
end
|
59
|
-
|
60
|
-
if self.sha_existed?(git, id_end) == false
|
61
|
-
status = false
|
62
|
-
msg_arr << id_end
|
63
|
-
end
|
64
|
-
|
65
|
-
msg = "success"
|
66
|
-
msg = "diff check failed, since commit not existed: " + msg_arr.join(" ") unless status == true
|
67
|
-
|
68
|
-
diff = nil
|
69
|
-
if status
|
70
|
-
c_start = git.gcommit(id_start)
|
71
|
-
c_end = git.gcommit(id_end)
|
72
|
-
diff = git.diff(c_start, c_end) #Git::Diff
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
remotes = git.remotes
|
77
|
-
remote_dict = {}
|
78
|
-
remotes.each do |one|
|
79
|
-
#Git::Remote
|
80
|
-
remote_dict[one.name] = one.url
|
81
|
-
end
|
82
|
-
result = {
|
83
|
-
:status => status,
|
84
|
-
:message => msg,
|
85
|
-
:remote_info => remote_dict,
|
86
|
-
:start_commit => id_start,
|
87
|
-
:end_commit => id_end,
|
88
|
-
:stats => diff == nil ? {} : diff.stats,
|
89
|
-
}
|
90
|
-
|
91
|
-
puts("diff_detail:#{result.to_json}")
|
92
|
-
result
|
93
|
-
end
|
94
|
-
|
95
|
-
def self.last_tag_on_branch(git)
|
96
|
-
last_tag_name = nil
|
97
|
-
|
98
|
-
begin
|
99
|
-
last_tag_name = git.describe(nil, { :abbrev => 0 })
|
100
|
-
rescue Git::GitExecuteError => e
|
101
|
-
puts "find last tag failed:#{e}"
|
102
|
-
end
|
103
|
-
tag = git.tag(last_tag_name) unless last_tag_name.blank?
|
104
|
-
|
105
|
-
tag
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'ykfastlane/helper'
|
2
|
-
require 'actions/init'
|
3
|
-
|
4
|
-
require 'agoo'
|
5
|
-
module YKHttpModule
|
6
|
-
module YKHttpHelper
|
7
|
-
|
8
|
-
require 'HttpService/git_tag_analysis_handler'
|
9
|
-
|
10
|
-
def self.startService(port)
|
11
|
-
puts("should start http service at port:#{port}")
|
12
|
-
Agoo::Server.init(6464, 'root')
|
13
|
-
|
14
|
-
tag_diff = YKHttpModule::GitTagDiff.new
|
15
|
-
Agoo::Server.handle(:POST, "/tag_diff", tag_diff)
|
16
|
-
|
17
|
-
commit_diff = YKHttpModule::GitCommitDiff.new
|
18
|
-
Agoo::Server.handle(:GET, "/commit_diff", commit_diff)
|
19
|
-
|
20
|
-
Agoo::Server.start()
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.stopService()
|
25
|
-
puts("should stop http service")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module YKHttpModule
|
2
|
-
require 'GitTools/git_analysis'
|
3
|
-
|
4
|
-
class GitTagDiff
|
5
|
-
def call(req)
|
6
|
-
puts("tag_diff[#{self}]:#{req}")
|
7
|
-
[ 200, { }, [ "#{req}" ] ]
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class GitCommitDiff
|
12
|
-
def call(req)
|
13
|
-
puts("commit_diff[#{self}]:#{req}")
|
14
|
-
YKFastlane::Init.new().list_all_configs
|
15
|
-
path = Dir.pwd
|
16
|
-
result = YKFastlane::GitAnalysis.commit_tag_diff(path)
|
17
|
-
[ 200, { }, [ "#{result}" ] ]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/actions/ykgit.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'actions/YKFastlaneExecute'
|
2
|
-
|
3
|
-
module YKFastlane
|
4
|
-
class YKGit < YKFastlane::SubCommandBase
|
5
|
-
require "GitTools/git_analysis"
|
6
|
-
include YKFastlane::GitAnalysis
|
7
|
-
|
8
|
-
desc "diff_to_tag", "analysis git commit"
|
9
|
-
option :path, :require => false, :type => :string, :aliases => :p, :desc => 'the path should be analysised'
|
10
|
-
|
11
|
-
def diff_to_tag()
|
12
|
-
self.analysis_git_commit_execute(options)
|
13
|
-
end
|
14
|
-
|
15
|
-
no_commands do
|
16
|
-
def analysis_git_commit_execute(options)
|
17
|
-
puts("analysis git commit info execute:#{options}")
|
18
|
-
path = options[:path].blank? ? Dir.pwd : File.expand_path(options[:path])
|
19
|
-
puts("path:#{path}")
|
20
|
-
diff_hash = self.commit_tag_diff(path)
|
21
|
-
|
22
|
-
YKFastlane::Tools.UI(diff_hash.to_json)
|
23
|
-
diff_hash
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'actions/YKFastlaneExecute'
|
2
|
-
|
3
|
-
module YKFastlane
|
4
|
-
|
5
|
-
class YKServiceHttp < YKFastlane::SubCommandBase
|
6
|
-
require 'HttpService/HttpServiceHelper'
|
7
|
-
include YKHttpModule::YKHttpHelper
|
8
|
-
|
9
|
-
desc "start", "start ykfastlane service"
|
10
|
-
def start()
|
11
|
-
self.start_execute(options)
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "stop", "stop ykfastlane service"
|
15
|
-
def stop()
|
16
|
-
self.stop_execute(options)
|
17
|
-
end
|
18
|
-
|
19
|
-
no_commands do
|
20
|
-
def start_execute(options)
|
21
|
-
puts("start service execute")
|
22
|
-
YKHttpModule::YKHttpHelper.startService(8080)
|
23
|
-
end
|
24
|
-
|
25
|
-
def stop_execute(options)
|
26
|
-
puts("stop service execute")
|
27
|
-
YKHttpModule::YKHttpHelper.stopService
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|