fast_pack 0.3.2 → 0.3.5
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67dc8ee35cc30708896e0e1281bed29496fe587043dcd74fab145d13e75cc381
|
4
|
+
data.tar.gz: 842747c3508824971d1fdd512c07f627c2a0e69c9f90d950d03682342af9dff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c651e6cf66be5bd555c76d286605daa40a36bbf5c56997cbf130e4c8d412c4250d46e421218c1b2ac8bb6f1c502aa6b859838595aa2087670b570c646e0e338e
|
7
|
+
data.tar.gz: fe7bf395dfa1bca11e4174d194f7d15db23085606a790230f34fcc309f09bb6d844f706628a0e27d34fb1192aa6dca909117ff6a46c0dc119f077af871ebc8e6
|
@@ -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
|
-
puts "
|
44
|
-
|
76
|
+
puts "未找到目标文件目录"
|
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,25 @@ 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
|
101
|
-
|
102
|
-
url = log[/http:.*$/]
|
130
|
+
ipa_size = log[/包体积.*$/].split('=').last
|
131
|
+
url = log[/http:.*$/].to_s
|
103
132
|
array = log.split('%')
|
104
133
|
uki_config.upload_time = array.last.split("=").last.to_i
|
105
134
|
uki_config.build_time = Time.now.to_i - uki_config.build_time - uki_config.upload_time
|
106
135
|
uki_config.fir_url = url
|
136
|
+
uki_config.ipa_size = ipa_size
|
107
137
|
|
138
|
+
unless !url.empty?
|
139
|
+
puts("导出失败")
|
140
|
+
exit
|
141
|
+
end
|
142
|
+
|
143
|
+
puts("恭喜打包完成")
|
144
|
+
|
145
|
+
if uki_config.verbose?
|
146
|
+
puts(log)
|
147
|
+
end
|
148
|
+
|
108
149
|
send_notifi
|
109
150
|
end
|
110
151
|
|
@@ -120,7 +161,7 @@ class Shell_Command
|
|
120
161
|
}
|
121
162
|
|
122
163
|
hostname = Socket.gethostname
|
123
|
-
project_name = uki_config.
|
164
|
+
project_name = uki_config.group_name
|
124
165
|
project_env = uki_config.release ? "Release": "Debug"
|
125
166
|
project_dsym = uki_config.dsym ? "已上传": "无符号表"
|
126
167
|
|
@@ -158,6 +199,20 @@ class Shell_Command
|
|
158
199
|
"tag": "lark_md"
|
159
200
|
}
|
160
201
|
},
|
202
|
+
{
|
203
|
+
"is_short": true,
|
204
|
+
"text": {
|
205
|
+
"content": "**App版本**\n#{uki_config.app_version}.#{uki_config.build_version}",
|
206
|
+
"tag": "lark_md"
|
207
|
+
}
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"is_short": true,
|
211
|
+
"text": {
|
212
|
+
"content": "**包体积**\n#{uki_config.ipa_size}",
|
213
|
+
"tag": "lark_md"
|
214
|
+
}
|
215
|
+
},
|
161
216
|
{
|
162
217
|
"is_short": true,
|
163
218
|
"text": {
|
@@ -204,12 +259,15 @@ class Shell_Command
|
|
204
259
|
}
|
205
260
|
|
206
261
|
log = %x{
|
207
|
-
curl -X POST -H "Content-Type: application/json" -d '#{message.to_json}' "https://open.feishu.cn/open-apis/bot/v2/hook/
|
262
|
+
curl -X POST -H "Content-Type: application/json" -d '#{message.to_json}' "https://open.feishu.cn/open-apis/bot/v2/hook/71ee99db-27fa-45ee-8cba-3004037f34ea"
|
208
263
|
}
|
209
264
|
|
210
265
|
if uki_config.verbose?
|
211
266
|
puts(log)
|
212
267
|
end
|
268
|
+
|
269
|
+
exit
|
270
|
+
|
213
271
|
end
|
214
272
|
|
215
273
|
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.5
|
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
|