pindo 4.9.3 → 4.9.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 +4 -4
- data/lib/pindo/client/pgyerclient.rb +1 -1
- data/lib/pindo/command/dev/autobuild.rb +52 -118
- data/lib/pindo/command/dev/build.rb +39 -54
- data/lib/pindo/command/dev/debug.rb +6 -4
- data/lib/pindo/command/dev/repoinit.rb +60 -0
- data/lib/pindo/command/dev/tag.rb +27 -13
- data/lib/pindo/command/dev.rb +1 -2
- data/lib/pindo/command/ios/autobuild.rb +41 -29
- data/lib/pindo/command/ios/build.rb +26 -21
- data/lib/pindo/command/ipa/import.rb +1 -1
- data/lib/pindo/command/pgyer/apptest.rb +18 -7
- data/lib/pindo/command/pgyer/comment.rb +15 -3
- data/lib/pindo/command/pgyer/download.rb +15 -3
- data/lib/pindo/command/pgyer/login.rb +14 -4
- data/lib/pindo/command/pgyer/resign.rb +20 -4
- data/lib/pindo/command/pgyer/upload.rb +58 -12
- data/lib/pindo/command/unity/ipa.rb +8 -8
- data/lib/pindo/module/build/buildhelper.rb +89 -0
- data/lib/pindo/version.rb +1 -1
- metadata +3 -8
- data/lib/pindo/command/dev/applovin.rb +0 -223
- data/lib/pindo/command/dev/autoresign.rb +0 -143
- data/lib/pindo/command/dev/confusecode.rb +0 -127
- data/lib/pindo/command/dev/confuseproj.rb +0 -111
- data/lib/pindo/command/dev/createbuild.rb +0 -156
- data/lib/pindo/command/dev/pgyercert.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96b5085007e7368d7739d4788df1167fa8cb5e04c156000724eaf3ea2376acfa
|
4
|
+
data.tar.gz: 31712cdc4a2ff51d8be3d2992446ef2a2411ec300408eaf1b51a2ad270d598eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00b1e474bc20dfe842d866c5a5ee8be8d22f0ba4497fa6fff7b20cc29a98c4bfbdc596ae5b88cf55d6dbd60775ca0c581fd035c95d8888c79336e0c0401a805d
|
7
|
+
data.tar.gz: 39dc2e638e6235f771cde216b3e2788039633856e908706c8d014003ad67f0ea9f1be8b883f14afa5969a0a5e25bc9a8a53bcb53d65dbd987e7633c2c5be40eb
|
@@ -12,23 +12,50 @@ module Pindo
|
|
12
12
|
|
13
13
|
include Appselect
|
14
14
|
|
15
|
+
# 命令的简要说明 - 自动编译并发布工程
|
15
16
|
self.summary = '自动编译工程,并支持上传ipa到测试网站'
|
16
17
|
|
18
|
+
# 命令的详细说明,包含用法示例
|
17
19
|
self.description = <<-DESC
|
18
|
-
|
20
|
+
自动编译工程并支持上传到测试平台。
|
21
|
+
|
22
|
+
支持功能:
|
23
|
+
|
24
|
+
* 自动编译工程
|
25
|
+
|
26
|
+
* 上传到测试平台
|
27
|
+
|
28
|
+
* 发送测试通知
|
29
|
+
|
30
|
+
* 支持多种编译模式
|
31
|
+
|
32
|
+
使用示例:
|
33
|
+
|
34
|
+
$ pindo dev autobuild # 使用开发证书编译
|
35
|
+
|
36
|
+
$ pindo dev autobuild --deploy # 使用发布bundle id
|
37
|
+
|
38
|
+
$ pindo dev autobuild --adhoc # 使用adhoc证书编译
|
39
|
+
|
40
|
+
$ pindo dev autobuild --proj=myapp # 指定项目名称
|
41
|
+
|
42
|
+
$ pindo dev autobuild --upload # 上传编译包
|
43
|
+
|
44
|
+
$ pindo dev autobuild --send # 发送测试通知
|
19
45
|
DESC
|
20
46
|
|
47
|
+
# 命令的参数列表
|
21
48
|
self.arguments = [
|
22
|
-
|
23
49
|
]
|
24
50
|
|
51
|
+
# 命令的选项列表
|
25
52
|
def self.options
|
26
53
|
[
|
27
|
-
['--deploy',
|
28
|
-
['--adhoc',
|
29
|
-
['--proj',
|
30
|
-
['--upload',
|
31
|
-
['--send',
|
54
|
+
['--deploy', '默认用开发的bundle id,用法:pindo dev autobuild --deploy'],
|
55
|
+
['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书编译'],
|
56
|
+
['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略)'],
|
57
|
+
['--upload', '是否上传编译后的ipa'],
|
58
|
+
['--send', '上传到之后是否发送测试信息'],
|
32
59
|
].concat(super)
|
33
60
|
end
|
34
61
|
|
@@ -57,125 +84,32 @@ module Pindo
|
|
57
84
|
|
58
85
|
pindo_unity_project_dir = Dir.pwd
|
59
86
|
build_helper = Pindo::BuildHelper.share_instance
|
60
|
-
|
61
|
-
raise Informative, "当前目录不是iOS工程,请在iOS工程根目录下执行此命令"
|
62
|
-
end
|
63
|
-
|
64
|
-
if @args_upload_flag
|
65
|
-
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_unity_project_dir)
|
66
|
-
if is_need_add_tag
|
67
|
-
Pindo::Command::Dev::Tag::run(tag_action_parms)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
mainapp_bundleid= nil
|
72
|
-
if @args_deploy_flag
|
73
|
-
mainapp_bundleid = get_selected_deploy_bundleid()
|
74
|
-
else
|
75
|
-
mainapp_bundleid = get_selected_dev_bundleid()
|
76
|
-
end
|
87
|
+
pindo_unity_project_dir = Dir.pwd
|
77
88
|
|
78
|
-
app_info_obj = nil
|
79
|
-
if @args_upload_flag
|
80
|
-
proj_name = @args_proj_name
|
81
|
-
app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
|
82
|
-
end
|
83
89
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
Pindo::Command::Deploy::Pullconfig::run(args_temp)
|
89
|
-
|
90
|
-
project_dir = Dir.pwd
|
91
|
-
Dir.chdir(project_dir)
|
92
|
-
config_json_file = File.join(project_dir,"config.json")
|
93
|
-
Debug::modify_cert_with_project(project_dir:project_dir, config_file:config_json_file)
|
94
|
-
|
95
|
-
if File.exist?(File.join(project_dir, "Podfile"))
|
96
|
-
|
97
|
-
args_temp = []
|
98
|
-
args_temp << config_json_file
|
99
|
-
Pindo::Command::Lib::Update::run([])
|
100
|
-
|
101
|
-
begin
|
102
|
-
if File.exist?(File.join(project_dir, "Podfile.lock"))
|
103
|
-
FileUtils.rm_rf(File.join(project_dir, "Podfile.lock"))
|
104
|
-
end
|
105
|
-
if File.exist?(File.join(project_dir,"Pods"))
|
106
|
-
FileUtils.rm_rf(File.join(project_dir, "Pods"))
|
107
|
-
end
|
108
|
-
puts "正在执行pod deintegrate..."
|
109
|
-
system 'pod deintegrate'
|
110
|
-
puts "正在执行pod install..."
|
111
|
-
system 'pod install'
|
112
|
-
rescue => error
|
113
|
-
puts(error.to_s)
|
114
|
-
raise Informative, "pod install失败!!先pod install 完成后成编译 !"
|
115
|
-
end
|
116
|
-
|
117
|
-
Dir.chdir(project_dir)
|
118
|
-
pod_lock_file = File.join(project_dir, "Podfile.lock")
|
119
|
-
if !File.exist?(pod_lock_file)
|
120
|
-
raise Informative, "pod install失败!!先pod install 完成后成编译 !"
|
121
|
-
end
|
122
|
-
|
123
|
-
end
|
124
|
-
|
90
|
+
build_helper = Pindo::BuildHelper.share_instance
|
91
|
+
project_type = build_helper.project_type(pindo_unity_project_dir)
|
125
92
|
|
126
93
|
args_temp = []
|
127
|
-
if @
|
128
|
-
|
94
|
+
args_temp << "--proj=#{@args_proj_name}" if @args_proj_name
|
95
|
+
args_temp << "--upload" if @args_upload_flag
|
96
|
+
args_temp << "--send" if @args_send_flag
|
97
|
+
args_temp << "--adhoc" if @args_adhoc_flag
|
98
|
+
args_temp << "--deploy" if @args_deploy_flag
|
99
|
+
|
100
|
+
case project_type
|
101
|
+
when :ios
|
102
|
+
puts "iOS工程, 请使用 pindo ios autobuild"
|
103
|
+
Pindo::Command::Ios::Autobuild::run(args_temp)
|
104
|
+
when :android
|
105
|
+
puts "Android工程, 请使用 pindo android autobuild"
|
106
|
+
when :unity
|
107
|
+
raise Informative, "Unity工程, 请使用 pindo unity ipa 或者pindo unity apk"
|
129
108
|
else
|
130
|
-
|
109
|
+
raise Informative, "当前目录不是工程目录,不能编译"
|
131
110
|
end
|
132
111
|
|
133
|
-
project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
|
134
|
-
if !project_fullname.nil?
|
135
|
-
project_obj = Xcodeproj::Project.open(project_fullname)
|
136
|
-
project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
137
|
-
if !project_build_platform.nil? && project_build_platform.eql?("macosx")
|
138
|
-
@args_macos_flag = true
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
if @args_macos_flag
|
143
|
-
args_temp << "--macos"
|
144
|
-
end
|
145
|
-
|
146
|
-
Pindo::Command::Deploy::Cert::run(args_temp)
|
147
|
-
|
148
|
-
Dir.chdir(project_dir)
|
149
|
-
Pindo::Command::Deploy::Build::run(args_temp)
|
150
|
-
|
151
|
-
|
152
|
-
pindo_new_project_dir = Dir.pwd
|
153
|
-
build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
|
154
|
-
ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
155
|
-
|
156
|
-
if !ipa_file_upload.nil? && !app_info_obj.nil?
|
157
|
-
description = nil
|
158
|
-
if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
|
159
|
-
description = File.read(File.join(pindo_new_project_dir, ".release_info"))
|
160
|
-
else
|
161
|
-
if File.exist?(File.join(pindo_new_project_dir, ".git"))
|
162
|
-
description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
|
163
|
-
end
|
164
|
-
end
|
165
|
-
result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
|
166
|
-
if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
|
167
|
-
msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
|
168
|
-
PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
|
169
|
-
if @args_send_flag
|
170
|
-
PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
system "open #{project_dir}"
|
176
|
-
|
177
112
|
end
|
178
|
-
|
179
113
|
end
|
180
114
|
end
|
181
115
|
end
|
@@ -3,24 +3,43 @@ require 'fileutils'
|
|
3
3
|
require 'json'
|
4
4
|
require 'xcodeproj'
|
5
5
|
require 'gym'
|
6
|
+
require 'pindo/module/build/buildhelper'
|
6
7
|
|
7
8
|
module Pindo
|
8
9
|
class Command
|
9
10
|
class Dev < Command
|
10
11
|
class Build < Dev
|
11
12
|
|
12
|
-
|
13
|
+
# 命令的简要说明 - 编译工程并上传测试
|
13
14
|
self.summary = '编译工程,并支持上传ipa到测试网站'
|
14
15
|
|
16
|
+
# 命令的详细说明,包含用法示例
|
15
17
|
self.description = <<-DESC
|
16
|
-
|
18
|
+
编译工程并支持上传到测试平台。
|
19
|
+
|
20
|
+
支持功能:
|
21
|
+
|
22
|
+
* 编译工程
|
23
|
+
|
24
|
+
* 上传到测试平台
|
25
|
+
|
26
|
+
* 发送测试通知
|
27
|
+
|
28
|
+
使用示例:
|
29
|
+
|
30
|
+
$ pindo dev build # 仅编译
|
31
|
+
|
32
|
+
$ pindo dev build --upload # 编译并上传
|
33
|
+
|
34
|
+
$ pindo dev build --send # 编译并发送通知
|
35
|
+
|
36
|
+
$ pindo dev build --proj=myapp # 指定项目名称
|
17
37
|
DESC
|
18
38
|
|
39
|
+
# 命令的参数列表
|
19
40
|
self.arguments = [
|
20
|
-
|
21
41
|
]
|
22
42
|
|
23
|
-
|
24
43
|
def self.options
|
25
44
|
[
|
26
45
|
['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo dev build --proj=aichatv4'],
|
@@ -47,62 +66,28 @@ module Pindo
|
|
47
66
|
def run
|
48
67
|
|
49
68
|
pindo_unity_project_dir = Dir.pwd
|
50
|
-
build_helper = Pindo::BuildHelper.share_instance
|
51
|
-
unless build_helper.ios_project?(pindo_unity_project_dir)
|
52
|
-
raise Informative, "当前目录不是iOS工程,请在iOS工程根目录下执行此命令"
|
53
|
-
end
|
54
|
-
if @args_upload_flag
|
55
|
-
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_unity_project_dir)
|
56
|
-
if is_need_add_tag
|
57
|
-
Pindo::Command::Dev::Tag::run(tag_action_parms)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
|
62
|
-
app_info_obj = nil
|
63
|
-
if @args_upload_flag
|
64
|
-
proj_name = @args_proj_name
|
65
|
-
app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
|
66
|
-
end
|
67
69
|
|
70
|
+
build_helper = Pindo::BuildHelper.share_instance
|
71
|
+
project_type = build_helper.project_type(pindo_unity_project_dir)
|
68
72
|
|
69
73
|
args_temp = []
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
|
85
|
-
unless !description.nil? && description.length > 10
|
86
|
-
description = nil
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
|
92
|
-
if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
|
93
|
-
msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
|
94
|
-
|
95
|
-
PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
|
96
|
-
if @args_send_flag
|
97
|
-
PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
|
98
|
-
end
|
99
|
-
end
|
74
|
+
args_temp << "--proj=#{@args_proj_name}" if @args_proj_name
|
75
|
+
args_temp << "--upload" if @args_upload_flag
|
76
|
+
args_temp << "--send" if @args_send_flag
|
77
|
+
case project_type
|
78
|
+
when :ios
|
79
|
+
puts "iOS 工程, 请使用 pindo ios build"
|
80
|
+
Pindo::Command::Ios::Build::run(args_temp)
|
81
|
+
when :android
|
82
|
+
puts "Android 工程, 请使用 pindo android build"
|
83
|
+
Pindo::Command::Android::Build::run(args_temp)
|
84
|
+
when :unity
|
85
|
+
raise Informative, "Unity 工程, 请使用 pindo unity ipa 或者pindo unity apk"
|
86
|
+
else
|
87
|
+
raise Informative, "当前目录不是工程目录,不能编译"
|
100
88
|
end
|
101
89
|
|
102
|
-
|
103
90
|
end
|
104
|
-
|
105
|
-
|
106
91
|
end
|
107
92
|
end
|
108
93
|
end
|
@@ -9,8 +9,10 @@ module Pindo
|
|
9
9
|
|
10
10
|
include XcodeCertHelper
|
11
11
|
|
12
|
+
# 命令的简要说明 - 更新证书并设置工程
|
12
13
|
self.summary = '更新证书并使用新证书设置工程'
|
13
14
|
|
15
|
+
# 命令的详细说明,包含用法示例
|
14
16
|
self.description = <<-DESC
|
15
17
|
更新证书并使用新证书设置工程。
|
16
18
|
|
@@ -30,15 +32,17 @@ module Pindo
|
|
30
32
|
|
31
33
|
$ pindo dev debug --deploy # 使用发布bundle id
|
32
34
|
|
33
|
-
$ pindo dev debug --adhoc
|
35
|
+
$ pindo dev debug --adhoc # 使用adhoc证书
|
34
36
|
|
35
|
-
$ pindo dev debug --macos
|
37
|
+
$ pindo dev debug --macos # 使用macOS证书
|
36
38
|
DESC
|
37
39
|
|
40
|
+
# 命令的参数列表
|
38
41
|
self.arguments = [
|
39
42
|
# 暂无参数
|
40
43
|
]
|
41
44
|
|
45
|
+
# 命令的选项列表
|
42
46
|
def self.options
|
43
47
|
[
|
44
48
|
['--deploy', '使用发布bundle id(默认使用开发bundle id)'],
|
@@ -149,10 +153,8 @@ module Pindo
|
|
149
153
|
|
150
154
|
end
|
151
155
|
|
152
|
-
|
153
156
|
end
|
154
157
|
|
155
|
-
|
156
158
|
end
|
157
159
|
end
|
158
160
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'highline/import'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Pindo
|
5
|
+
class Command
|
6
|
+
class Dev < Command
|
7
|
+
class Repoinit < Dev
|
8
|
+
|
9
|
+
include Pindo::Githelper
|
10
|
+
|
11
|
+
# 命令的简要说明 - 初始化git仓库配置
|
12
|
+
self.summary = '初始化git仓库中git cliff的配置'
|
13
|
+
|
14
|
+
# 命令的详细说明,包含用法示例
|
15
|
+
self.description = <<-DESC
|
16
|
+
初始化git仓库中git cliff的配置。
|
17
|
+
|
18
|
+
支持功能:
|
19
|
+
|
20
|
+
* 初始化git cliff配置
|
21
|
+
|
22
|
+
* 生成配置文件
|
23
|
+
|
24
|
+
使用示例:
|
25
|
+
|
26
|
+
$ pindo dev repoinit # 初始化配置
|
27
|
+
DESC
|
28
|
+
|
29
|
+
# 命令的参数列表
|
30
|
+
self.arguments = []
|
31
|
+
|
32
|
+
def self.options
|
33
|
+
[
|
34
|
+
].concat(super)
|
35
|
+
end
|
36
|
+
|
37
|
+
def initialize(argv)
|
38
|
+
@mode = argv.option('mode') || 'minor'
|
39
|
+
@force_retag = argv.flag?('retag', false)
|
40
|
+
|
41
|
+
unless ['major', 'minor', 'patch'].include?(@mode)
|
42
|
+
raise Informative, "mode参数必须是 major, minor 或 patch"
|
43
|
+
end
|
44
|
+
|
45
|
+
super
|
46
|
+
@additional_args = argv.remainder!
|
47
|
+
end
|
48
|
+
|
49
|
+
def run
|
50
|
+
|
51
|
+
pindo_project_dir = Dir.pwd
|
52
|
+
build_helper = Pindo::BuildHelper.share_instance
|
53
|
+
build_helper.check_check_and_install_cliff(pindo_project_dir)
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -5,23 +5,36 @@ module Pindo
|
|
5
5
|
class Command
|
6
6
|
class Dev < Command
|
7
7
|
class Tag < Dev
|
8
|
+
# 命令的简要说明 - 发布代码并添加tag
|
8
9
|
self.summary = '发布代码,添加tag,添加发布信息,并合并到发布分支'
|
10
|
+
|
11
|
+
# 命令的详细说明,包含用法示例
|
9
12
|
self.description = <<-DESC
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
发布代码,添加tag,添加发布信息,并合并到发布分支。
|
14
|
+
|
15
|
+
支持功能:
|
16
|
+
|
17
|
+
* 处理未提交的文件
|
18
|
+
|
19
|
+
* 添加版本tag
|
20
|
+
|
21
|
+
* 合并到发布分支
|
22
|
+
|
23
|
+
使用示例:
|
24
|
+
|
25
|
+
$ pindo dev tag # 使用minor模式创建tag
|
26
|
+
|
27
|
+
$ pindo dev tag --mode=major # 使用major模式创建tag
|
28
|
+
|
29
|
+
$ pindo dev tag --mode=patch # 使用patch模式创建tag
|
30
|
+
|
31
|
+
$ pindo dev tag --retag # 强制重新打tag
|
22
32
|
DESC
|
33
|
+
|
34
|
+
# 命令的参数列表
|
23
35
|
self.arguments = []
|
24
36
|
|
37
|
+
# 命令的选项列表
|
25
38
|
def self.options
|
26
39
|
[
|
27
40
|
['--mode', '指定版本号增加模式(major/minor/patch),默认minor'],
|
@@ -43,9 +56,10 @@ module Pindo
|
|
43
56
|
|
44
57
|
def run
|
45
58
|
current_project_dir = Dir.pwd
|
46
|
-
|
59
|
+
puts current_project_dir
|
47
60
|
# 检查当前目录是否是git仓库
|
48
61
|
unless is_git_directory?(local_repo_dir: current_project_dir)
|
62
|
+
|
49
63
|
Funlog.instance.fancyinfo_error("当前目录不是git仓库")
|
50
64
|
raise Informative, "请在git仓库目录下执行此命令"
|
51
65
|
end
|
data/lib/pindo/command/dev.rb
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
|
4
4
|
require 'pindo/command/dev/tag'
|
5
5
|
require 'pindo/command/dev/debug'
|
6
|
-
require 'pindo/command/dev/autoresign'
|
7
6
|
require 'pindo/command/dev/autobuild'
|
8
7
|
require 'pindo/command/dev/build'
|
9
|
-
require 'pindo/command/dev/
|
8
|
+
require 'pindo/command/dev/repoinit'
|
10
9
|
|
11
10
|
|
12
11
|
module Pindo
|
@@ -78,15 +78,37 @@ module Pindo
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def run
|
81
|
-
|
82
|
-
|
81
|
+
pindo_project_dir = Dir.pwd
|
82
|
+
|
83
83
|
build_helper = Pindo::BuildHelper.share_instance
|
84
|
-
|
85
|
-
|
84
|
+
project_type = build_helper.project_type(pindo_project_dir)
|
85
|
+
|
86
|
+
args_temp = []
|
87
|
+
args_temp << "--proj=#{@args_proj_name}" if @args_proj_name
|
88
|
+
args_temp << "--upload" if @args_upload_flag
|
89
|
+
args_temp << "--send" if @args_send_flag
|
90
|
+
case project_type
|
91
|
+
when :ios
|
92
|
+
ios_autobuild
|
93
|
+
when :android
|
94
|
+
puts "Android 工程, 请使用 pindo android build"
|
95
|
+
|
96
|
+
when :unity
|
97
|
+
Pindo::Command::Unity::Ipa::run(args_temp)
|
98
|
+
else
|
99
|
+
raise Informative, "当前目录不是工程目录,不能编译"
|
86
100
|
end
|
87
101
|
|
102
|
+
end
|
103
|
+
|
104
|
+
def ios_autobuild
|
105
|
+
|
106
|
+
pindo_project_dir = Dir.pwd
|
107
|
+
build_helper = Pindo::BuildHelper.share_instance
|
108
|
+
|
88
109
|
if @args_upload_flag
|
89
|
-
|
110
|
+
build_helper.check_check_and_install_cliff(pindo_project_dir)
|
111
|
+
is_need_add_tag,tag_action_parms = build_helper.check_is_need_add_tag?(pindo_project_dir)
|
90
112
|
if is_need_add_tag
|
91
113
|
Pindo::Command::Dev::Tag::run(tag_action_parms)
|
92
114
|
end
|
@@ -114,23 +136,22 @@ module Pindo
|
|
114
136
|
args_temp << mainapp_bundleid
|
115
137
|
Pindo::Command::Deploy::Pullconfig::run(args_temp)
|
116
138
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
Pindo::Command::Ios::Debug::modify_cert_with_project(project_dir:project_dir, config_file:config_json_file)
|
139
|
+
Dir.chdir(pindo_project_dir)
|
140
|
+
config_json_file = File.join(pindo_project_dir,"config.json")
|
141
|
+
Pindo::Command::Ios::Debug::modify_cert_with_project(project_dir:pindo_project_dir, config_file:config_json_file)
|
121
142
|
|
122
|
-
if File.exist?(File.join(
|
143
|
+
if File.exist?(File.join(pindo_project_dir, "Podfile"))
|
123
144
|
|
124
145
|
args_temp = []
|
125
146
|
args_temp << config_json_file
|
126
147
|
Pindo::Command::Lib::Update::run([])
|
127
148
|
|
128
149
|
begin
|
129
|
-
if File.exist?(File.join(
|
130
|
-
FileUtils.rm_rf(File.join(
|
150
|
+
if File.exist?(File.join(pindo_project_dir, "Podfile.lock"))
|
151
|
+
FileUtils.rm_rf(File.join(pindo_project_dir, "Podfile.lock"))
|
131
152
|
end
|
132
|
-
if File.exist?(File.join(
|
133
|
-
FileUtils.rm_rf(File.join(
|
153
|
+
if File.exist?(File.join(pindo_project_dir,"Pods"))
|
154
|
+
FileUtils.rm_rf(File.join(pindo_project_dir, "Pods"))
|
134
155
|
end
|
135
156
|
puts "正在执行pod deintegrate..."
|
136
157
|
system 'pod deintegrate'
|
@@ -141,8 +162,8 @@ module Pindo
|
|
141
162
|
raise Informative, "pod install失败!!先pod install 完成后成编译 !"
|
142
163
|
end
|
143
164
|
|
144
|
-
Dir.chdir(
|
145
|
-
pod_lock_file = File.join(
|
165
|
+
Dir.chdir(pindo_project_dir)
|
166
|
+
pod_lock_file = File.join(pindo_project_dir, "Podfile.lock")
|
146
167
|
if !File.exist?(pod_lock_file)
|
147
168
|
raise Informative, "pod install失败!!先pod install 完成后成编译 !"
|
148
169
|
end
|
@@ -157,7 +178,7 @@ module Pindo
|
|
157
178
|
args_temp << "--dev"
|
158
179
|
end
|
159
180
|
|
160
|
-
project_fullname = Dir.glob(File.join(
|
181
|
+
project_fullname = Dir.glob(File.join(pindo_project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
|
161
182
|
if !project_fullname.nil?
|
162
183
|
project_obj = Xcodeproj::Project.open(project_fullname)
|
163
184
|
project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
@@ -172,23 +193,14 @@ module Pindo
|
|
172
193
|
|
173
194
|
Pindo::Command::Deploy::Cert::run(args_temp)
|
174
195
|
|
175
|
-
Dir.chdir(
|
196
|
+
Dir.chdir(pindo_project_dir)
|
176
197
|
Pindo::Command::Deploy::Build::run(args_temp)
|
177
198
|
|
178
|
-
|
179
|
-
pindo_new_project_dir = Dir.pwd
|
180
|
-
build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
|
199
|
+
build_path = File.join(pindo_project_dir, "build", "*.{ipa,app}")
|
181
200
|
ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
182
|
-
|
201
|
+
|
183
202
|
if !ipa_file_upload.nil? && !app_info_obj.nil?
|
184
203
|
description = nil
|
185
|
-
if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
|
186
|
-
description = File.read(File.join(pindo_new_project_dir, ".release_info"))
|
187
|
-
else
|
188
|
-
if File.exist?(File.join(pindo_new_project_dir, ".git"))
|
189
|
-
description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
|
190
|
-
end
|
191
|
-
end
|
192
204
|
result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
|
193
205
|
if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
|
194
206
|
msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
|