gct 0.2.8 → 0.3.0
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/lib/gct/command/repo/add.rb +1 -1
- data/lib/gct/command/repo/update.rb +1 -1
- data/lib/gct/command/tag.rb +62 -0
- data/lib/gct/command.rb +1 -0
- data/lib/gct/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 234020953df6dd3d1f9a2844c5fdd7b06129f901aac392e6d8a1695add614678
|
4
|
+
data.tar.gz: 25d52ea8b3467f69db9865169d033fa042f46136b32dd25681e8ee16555ecc43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f2b677246254294754e4b8b25c15ba44df16e87abb513adeb9515463fc72f6bb523360d14608d7aebb83110511b31cf28357e4a731bc64df7b9f520a40985e3
|
7
|
+
data.tar.gz: 12ecd76daed4b90b7ef2d29da084d7658fc33fed7282e486f3519db0962e78cfff6422c684cb7960f9a8eff50e6c57f0044e452ae15691e0a83f3122ccbebff6
|
data/lib/gct/command/repo/add.rb
CHANGED
@@ -25,7 +25,7 @@ module Gct
|
|
25
25
|
|
26
26
|
def addRepo
|
27
27
|
puts "pod命令为:pod repo add iOSCRGTPodSource https://gi-dev.ccrgt.com/ios/iOSCRGTPodSource.git".green
|
28
|
-
system "pod repo add iOSCRGTPodSource https://gi-dev.ccrgt.com/ios/iOSCRGTPodSource.git
|
28
|
+
system "pod repo add iOSCRGTPodSource https://gi-dev.ccrgt.com/ios/iOSCRGTPodSource.git", exception: true
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -25,7 +25,7 @@ module Gct
|
|
25
25
|
|
26
26
|
def updateRepo
|
27
27
|
puts "pod命令为:pod repo update iOSCRGTPodSource".green
|
28
|
-
system "pod repo update iOSCRGTPodSource
|
28
|
+
system "pod repo update iOSCRGTPodSource", exception: true
|
29
29
|
puts "如果找不到 iOSCRGTPodSource 文件,先执行gct repo add".green
|
30
30
|
end
|
31
31
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Gct
|
2
|
+
class Command
|
3
|
+
class Tag < Command
|
4
|
+
|
5
|
+
self.summary = '添加tag'
|
6
|
+
self.description = <<-DESC
|
7
|
+
十进制增加tag版本
|
8
|
+
DESC
|
9
|
+
|
10
|
+
self.arguments = [
|
11
|
+
CLAide::Argument.new('TAG', false),
|
12
|
+
]
|
13
|
+
|
14
|
+
def initialize(argv)
|
15
|
+
@tag = argv.shift_argument
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def validate!
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
def run
|
24
|
+
get_now_tag
|
25
|
+
add_push_new_tag
|
26
|
+
end
|
27
|
+
|
28
|
+
def update_tag_podspec
|
29
|
+
# 更新podspec的版本号 @new_tag 创建MR推送到远端
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_now_tag
|
34
|
+
spec_file = Pathname.glob('*.podspec').first
|
35
|
+
raise "在 #{Dir.pwd} 目录下找不到podspec文件".red if spec_file.nil?
|
36
|
+
|
37
|
+
spec = Pod::Specification.from_file(spec_file)
|
38
|
+
@now_tag = spec.version
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_push_new_tag
|
42
|
+
@new_tag = @tag || autoAddTag(@now_tag.to_s)
|
43
|
+
update_tag_podspec
|
44
|
+
`git tag #{@new_tag}`
|
45
|
+
`git push origin #{@new_tag} || { exit 1; }`
|
46
|
+
end
|
47
|
+
|
48
|
+
def autoAddTag(tag)
|
49
|
+
tag_points = tag.to_s.split('.')
|
50
|
+
index = tag_points.length - 1
|
51
|
+
need_add_point = tag_points[index].to_i + 1
|
52
|
+
tag_points[index] = need_add_point == 10 ? 0 : need_add_point
|
53
|
+
while need_add_point == 10 && index > 0
|
54
|
+
index = index - 1
|
55
|
+
need_add_point = tag_points[index].to_i + 1
|
56
|
+
tag_points[index] = need_add_point == 10 && index != 0 ? 0 : need_add_point
|
57
|
+
end
|
58
|
+
tag_points.join('.')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
data/lib/gct/command.rb
CHANGED
data/lib/gct/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jieming
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/gct/command/repo/update.rb
|
142
142
|
- lib/gct/command/spec.rb
|
143
143
|
- lib/gct/command/spec/lint.rb
|
144
|
+
- lib/gct/command/tag.rb
|
144
145
|
- lib/gct/constant.rb
|
145
146
|
- lib/gct/version.rb
|
146
147
|
homepage: https://gi-dev.ccrgt.com/ios-thirdpart/gct
|