ykcitool 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ykfastlane/version.rb +1 -1
- metadata +3 -8
- 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: 7ade6c9be894cbaf72f231a5851ac67e28af8a2f5f44a1c500ab98dbb9237867
|
4
|
+
data.tar.gz: c8d203e5cf75ab22b59345a4d277c75796933346963820758ef5a6fc2411f893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a233ce17821a4c48ffec519819a634346b89112fc480b0e0a389b5afc632da6d0f8e2edf1c6103d123ace192612975903fa31782439142ff89f8cd3188a46040
|
7
|
+
data.tar.gz: d2e5c63ea0aaa515e8525b96827010dcb2f5fa842d578f2282d6a5fc528bf78d3b9a3bf4c11b1e0b843e41d4a575c7acf8c01d979cbed09f8f659caad66b92be
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stephen.chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-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,6 @@ files:
|
|
157
154
|
- lib/actions/git.rb
|
158
155
|
- lib/actions/init.rb
|
159
156
|
- lib/actions/pod.rb
|
160
|
-
- lib/actions/ykgit.rb
|
161
|
-
- lib/actions/ykservice_http.rb
|
162
157
|
- lib/interface.rb
|
163
158
|
- lib/ykfastlane/helper.rb
|
164
159
|
- lib/ykfastlane/tools.rb
|
@@ -182,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
177
|
- !ruby/object:Gem::Version
|
183
178
|
version: '0'
|
184
179
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
180
|
+
rubygems_version: 3.2.3
|
186
181
|
signing_key:
|
187
182
|
specification_version: 4
|
188
183
|
summary: iOS 打包工具.
|
@@ -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
|