fast_pack 0.3.3 → 0.3.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56b76321cbc99b6332e24ff16d35aa00200a23bccea0288640e97929c9bc4733
|
4
|
+
data.tar.gz: 990894a1d13a216970560cef95f4c240552d25b7ed3bf270f3b252862512f915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c15ba3e8418a94201d88bd419e406531e1ff5d8c9df4c7baf7f8472ff6f486df13ecfdf8145ebbb0f86f82a70711cec11c743ef5fa92088ca92cad037b59d9
|
7
|
+
data.tar.gz: b068e5065c2122006903ebbd0f427e020f30fa6552bf4a30b7398bba5f222450194edf1145b16654ac694164c7570d19888bc2115d5b81ea031b678814f5eaea
|
@@ -48,6 +48,8 @@ module Pod
|
|
48
48
|
|
49
49
|
def run
|
50
50
|
if verify_workspace_exists?
|
51
|
+
shell.export_xcode_env
|
52
|
+
|
51
53
|
if uki_config.no_build
|
52
54
|
#直接导出
|
53
55
|
shell.export
|
@@ -64,7 +66,7 @@ module Pod
|
|
64
66
|
uki_config.auto_work_space_name
|
65
67
|
unless uki_config.workspace_name
|
66
68
|
puts("大兄弟,请前往xxxx.workspace同级目录执行哦")
|
67
|
-
|
69
|
+
exit
|
68
70
|
end
|
69
71
|
|
70
72
|
return true
|
@@ -10,38 +10,71 @@ class Shell_Command
|
|
10
10
|
|
11
11
|
include Uki_config::Mixin
|
12
12
|
|
13
|
-
def
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
def export_xcode_env
|
14
|
+
puts("********************************************************* 开始导出Xcode环境变量")
|
15
|
+
|
16
|
+
log = %x{
|
17
|
+
rootPath=`pwd`
|
18
|
+
fireName="xcode_env.json"
|
19
|
+
full_path="${rootPath}/${fireName}"
|
20
|
+
if [ -f "$full_path" ]
|
21
|
+
then
|
22
|
+
echo "存在xcode_env.json"
|
23
|
+
else
|
24
|
+
echo "不存在xcode_env.json 创建一个"
|
25
|
+
touch ${full_path}
|
26
|
+
fi
|
27
|
+
|
28
|
+
if [ -f "$full_path" ]
|
29
|
+
then
|
30
|
+
echo `xcodebuild -showBuildSettings -json` > "$full_path"
|
31
|
+
fi
|
32
|
+
}
|
33
|
+
|
34
|
+
if !File.exist?(uki_config.xcode_env_path)
|
35
|
+
puts("当前目录未查找到xcode_env.json文件, 请检查执行目录")
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
|
39
|
+
json_from_file = File.read(uki_config.xcode_env_path)
|
40
|
+
uki_config.xcode_envs = JSON.parse(json_from_file).first
|
41
|
+
|
42
|
+
if uki_config.verbose?
|
43
|
+
puts(log)
|
44
|
+
end
|
18
45
|
|
19
|
-
|
46
|
+
end
|
20
47
|
|
21
|
-
|
22
|
-
echo "************************************* 编译失败 *************************************"
|
23
|
-
exit 1
|
24
|
-
fi
|
25
|
-
}
|
48
|
+
def build
|
26
49
|
|
27
|
-
puts
|
50
|
+
puts("********************************************************* 开始编译")
|
28
51
|
|
29
52
|
if uki_config.verbose?
|
30
|
-
|
53
|
+
puts("xcodebuild build -workspace #{uki_config.workspace} -scheme #{uki_config.scheme} -destination generic/platform=iOS -configuration #{uki_config.configuration} DEBUG_INFORMATION_FORMAT=#{uki_config.dsym_config} DWARF_DSYM_FOLDER_PATH=#{uki_config.dsym_path}")
|
31
54
|
end
|
55
|
+
|
56
|
+
log = %x{
|
57
|
+
xcodebuild build -workspace #{uki_config.workspace} -scheme #{uki_config.scheme} -destination generic/platform=iOS -configuration #{uki_config.configuration} DEBUG_INFORMATION_FORMAT=#{uki_config.dsym_config} DWARF_DSYM_FOLDER_PATH=#{uki_config.dsym_path}
|
58
|
+
}
|
32
59
|
|
33
|
-
|
34
|
-
|
35
|
-
|
60
|
+
if log[/BUILD SUCCEEDED/]
|
61
|
+
puts("********************************************************* 编译完成")
|
62
|
+
# 直接开始导出
|
63
|
+
self.export
|
64
|
+
elsif
|
65
|
+
puts("********************************************************* 失败")
|
66
|
+
exit
|
67
|
+
end
|
36
68
|
end
|
37
69
|
|
38
70
|
# 暂时先不copy到跟目录, 防止Git提交代码时提交上去
|
39
71
|
# 需安装Fir 不太友好
|
40
72
|
# 安装命令 sudo gem install fir-cli
|
41
73
|
def export
|
74
|
+
|
42
75
|
unless uki_config.build_exe_path
|
43
76
|
puts "未生成目标文件目录"
|
44
|
-
|
77
|
+
exit
|
45
78
|
end
|
46
79
|
|
47
80
|
puts %x{echo "********************************************************* 开始导出ipa"}
|
@@ -83,7 +116,8 @@ class Shell_Command
|
|
83
116
|
|
84
117
|
sizeM=`echo "scale=2; ${size}/1024.0/1024" | bc`
|
85
118
|
#sizeM="$((${size}/1000.0))
|
86
|
-
|
119
|
+
|
120
|
+
echo -e "包体积=${sizeM}m\n"
|
87
121
|
|
88
122
|
notification="Did uploaded to fir caost time:${SECONDS}s"
|
89
123
|
echo "===$notification===%"
|
@@ -93,18 +127,26 @@ class Shell_Command
|
|
93
127
|
echo "upload_time=${SECONDS}"
|
94
128
|
}
|
95
129
|
|
96
|
-
|
97
|
-
|
98
|
-
if uki_config.verbose?
|
99
|
-
puts(log)
|
100
|
-
end
|
130
|
+
ipa_size = log[/包体积.*$/].split('=').last
|
101
131
|
|
102
132
|
url = log[/http:.*$/]
|
103
133
|
array = log.split('%')
|
104
134
|
uki_config.upload_time = array.last.split("=").last.to_i
|
105
135
|
uki_config.build_time = Time.now.to_i - uki_config.build_time - uki_config.upload_time
|
106
136
|
uki_config.fir_url = url
|
137
|
+
uki_config.ipa_size = ipa_size
|
107
138
|
|
139
|
+
unless !url.empty?
|
140
|
+
puts("导出失败")
|
141
|
+
exit
|
142
|
+
end
|
143
|
+
|
144
|
+
puts("恭喜打包完成")
|
145
|
+
|
146
|
+
if uki_config.verbose?
|
147
|
+
puts(log)
|
148
|
+
end
|
149
|
+
|
108
150
|
send_notifi
|
109
151
|
end
|
110
152
|
|
@@ -120,7 +162,7 @@ class Shell_Command
|
|
120
162
|
}
|
121
163
|
|
122
164
|
hostname = Socket.gethostname
|
123
|
-
project_name = uki_config.
|
165
|
+
project_name = uki_config.group_name
|
124
166
|
project_env = uki_config.release ? "Release": "Debug"
|
125
167
|
project_dsym = uki_config.dsym ? "已上传": "无符号表"
|
126
168
|
|
@@ -158,6 +200,20 @@ class Shell_Command
|
|
158
200
|
"tag": "lark_md"
|
159
201
|
}
|
160
202
|
},
|
203
|
+
{
|
204
|
+
"is_short": true,
|
205
|
+
"text": {
|
206
|
+
"content": "**App版本**\n#{uki_config.app_version}.#{uki_config.build_version}",
|
207
|
+
"tag": "lark_md"
|
208
|
+
}
|
209
|
+
},
|
210
|
+
{
|
211
|
+
"is_short": true,
|
212
|
+
"text": {
|
213
|
+
"content": "**包体积**\n#{uki_config.ipa_size}",
|
214
|
+
"tag": "lark_md"
|
215
|
+
}
|
216
|
+
},
|
161
217
|
{
|
162
218
|
"is_short": true,
|
163
219
|
"text": {
|
@@ -204,12 +260,15 @@ class Shell_Command
|
|
204
260
|
}
|
205
261
|
|
206
262
|
log = %x{
|
207
|
-
curl -X POST -H "Content-Type: application/json" -d '#{message.to_json}' "https://open.feishu.cn/open-apis/bot/v2/hook/
|
263
|
+
curl -X POST -H "Content-Type: application/json" -d '#{message.to_json}' "https://open.feishu.cn/open-apis/bot/v2/hook/68c47d38-fc65-4cc5-a386-885a1fbff11b"
|
208
264
|
}
|
209
265
|
|
210
266
|
if uki_config.verbose?
|
211
267
|
puts(log)
|
212
268
|
end
|
269
|
+
|
270
|
+
exit
|
271
|
+
|
213
272
|
end
|
214
273
|
|
215
274
|
def self.instance
|
@@ -4,8 +4,6 @@ class Uki_config
|
|
4
4
|
# scheme info
|
5
5
|
PROJECT_SCHEME = ['UkiOverseas', 'miaohong'].freeze
|
6
6
|
|
7
|
-
# workspace name
|
8
|
-
PROJECT_WORKSPACENAME = ['UkiOverseas.xcworkspace', 'miaohong.xcworkspace']
|
9
7
|
|
10
8
|
# 是否展示详细信息
|
11
9
|
attr_accessor :verbose
|
@@ -25,22 +23,19 @@ class Uki_config
|
|
25
23
|
attr_accessor :upload_time
|
26
24
|
# 上传Url
|
27
25
|
attr_accessor :fir_url
|
26
|
+
# xcode环境变量
|
27
|
+
attr_accessor :xcode_envs
|
28
|
+
# 包体积
|
29
|
+
attr_accessor :ipa_size
|
28
30
|
|
29
31
|
alias_method :verbose?, :verbose
|
30
32
|
|
31
33
|
def scheme
|
32
|
-
|
33
|
-
return PROJECT_SCHEME.last
|
34
|
-
end
|
35
|
-
return PROJECT_SCHEME.first
|
34
|
+
return self.xcode_envs["target"]
|
36
35
|
end
|
37
36
|
|
38
37
|
def workspace
|
39
|
-
|
40
|
-
return PROJECT_WORKSPACENAME.last
|
41
|
-
end
|
42
|
-
|
43
|
-
return PROJECT_WORKSPACENAME.first
|
38
|
+
return self.workspace_name
|
44
39
|
end
|
45
40
|
|
46
41
|
def configuration
|
@@ -89,22 +84,44 @@ class Uki_config
|
|
89
84
|
|
90
85
|
Dir.foreach(@installation_root) do |entry|
|
91
86
|
if entry.end_with?('xcworkspace')
|
92
|
-
@workspace_name = entry
|
87
|
+
@workspace_name = entry
|
93
88
|
next
|
94
89
|
end
|
95
90
|
end
|
96
91
|
end
|
97
92
|
|
93
|
+
def app_version
|
94
|
+
buildSettings = self.xcode_envs["buildSettings"]
|
95
|
+
return buildSettings["MARKETING_VERSION"]
|
96
|
+
end
|
97
|
+
|
98
|
+
def build_version
|
99
|
+
buildSettings = self.xcode_envs["buildSettings"]
|
100
|
+
return buildSettings["CURRENT_PROJECT_VERSION"]
|
101
|
+
end
|
102
|
+
|
98
103
|
# 读取产物记录文件
|
99
104
|
def app_file_path
|
100
105
|
return File.join(@installation_root, "app_path")
|
101
106
|
end
|
102
107
|
|
103
|
-
|
104
|
-
|
108
|
+
# 产物路径
|
109
|
+
def build_exe_path
|
105
110
|
return IO.readlines(app_file_path).first
|
106
111
|
end
|
107
112
|
|
113
|
+
def group_name
|
114
|
+
unless @workspace_name == "miaohong.xcworkspace"
|
115
|
+
return "iOS海外极速打包完成"
|
116
|
+
end
|
117
|
+
|
118
|
+
return "iOS国内极速打包完成"
|
119
|
+
end
|
120
|
+
|
121
|
+
def xcode_env_path
|
122
|
+
return File.join(@installation_root, "xcode_env.json")
|
123
|
+
end
|
124
|
+
|
108
125
|
def self.instance
|
109
126
|
@instance ||= new
|
110
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 耿磊
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|