Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
PythonUnity/ProjectConfig/Script/ProjectManager.py at master · mooncode163/PythonUnity · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mooncode163
/
PythonUnity
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
PythonUnity
/
ProjectConfig
/
Script
/
ProjectManager.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
279 lines (229 loc) · 7.71 KB
master
Breadcrumbs
PythonUnity
/
ProjectConfig
/
Script
/
ProjectManager.py
Copy path
Top
File metadata and controls
Code
Blame
279 lines (229 loc) · 7.71 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#!/usr/bin/python
# coding=utf-8
from
Project
.
UpdateAppstore
import
mainUpdateAppstore
from
Common
.
File
.
FileUtil
import
FileUtil
from
xml
.
dom
.
minidom
import
parse
from
AppInfo
.
AppInfo
import
mainAppInfo
from
AppStore
.
AppStoreApple
import
mainAppStoreApple
from
AppInfo
.
AppCode
import
mainAppCode
from
Project
.
CopyGamedata
import
mainCopyGamedata
from
Project
.
IPABuild
import
IPABuild
from
Project
.
IPABuild
import
mainIPABuild
from
AppStore
.
AppstoreUploadiOS
import
mainAppstoreUploadiOS
from
AppStore
.
AppStoreTaptap
import
mainAppStoreTaptap
from
Project
.
CopyAllCmd
import
mainCopyAllCmd
from
Project
.
UnityBuild
import
UnityBuild
from
Project
.
CleanScreenshot
import
mainCleanScreenshot
from
Project
.
CopyAndroidOutputAsset
import
mainCopyAndroidOutputAsset
from
Project
.
SaveResource
import
mainSaveResource
from
Project
.
CopyResource
import
mainCopyResource
from
Project
.
CopyConfig
import
mainCopyConfig
from
Common
import
Source
from
Apk
.
ApkBuild
import
mainApkBuild
from
Project
.
Resource
import
mainResource
from
Common
.
Common
import
Common
import
sys
import
zipfile
import
shutil
import
os
import
os
.
path
import
time
import
datetime
import
json
# include common.py
#
o_path
=
os
.
getcwd
()
# 返回当前工作目录
print
(
o_path
)
sys
.
path
.
append
(
o_path
)
# 添加自己指定的搜索路径
# 当前工作目录 Common/PythonCreator/ProjectConfig/Script
sys
.
path
.
append
(
'../../'
)
sys
.
path
.
append
(
'./'
)
fille
=
os
.
path
.
abspath
(
__file__
)
print
(
fille
)
dir
=
os
.
path
.
dirname
(
fille
)
print
(
dir
)
# sys.path.append("..") #把上级目录加入到变量中
dir
=
os
.
path
.
dirname
(
dir
)
dir
=
os
.
path
.
dirname
(
dir
)
print
(
dir
)
# sys.path.insert(0,dir)
# sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# print(sys.path)
# from Config import config
# from Config import adconfig
class
ProjectManager
():
# 构造函数
def
__init__
(
self
):
name
=
""
# def CopyProjectConfig(self):
# listname ={"default","script"}
# for name in listname:
# src = mainResource.GetDirProductCommon()+"/ProjectConfig/"+name
# dst = mainResource.GetProjectConfig()+"/"+name
# isremove = True
# if name=="script":
# isremove = False
# FileUtil.CopyDir(src,dst,isremove)
# def SaveProjectConfig(self):
# listname ={"default","script"}
# for name in listname:
# src = mainResource.GetProjectConfig()+"/"+name
# dst = mainResource.GetDirProductCommon()+"/ProjectConfig/"+name
# print(src)
# print(dst)
# FileUtil.CopyDir(src,dst)
def
CopyCommonScript
(
self
):
listname
=
{
"AppBase"
,
"Common"
}
for
name
in
listname
:
src
=
mainResource
.
GetDirProductCommon
()
+
"/ProjectUnity/Assets/Script/"
+
name
dst
=
mainResource
.
GetRootUnityAssets
()
+
"/Script/"
+
name
FileUtil
.
CopyDir
(
src
,
dst
)
def
SaveCommonScript
(
self
):
listname
=
{
"AppBase"
,
"Common"
}
for
name
in
listname
:
src
=
mainResource
.
GetRootUnityAssets
()
+
"/Script/"
+
name
dst
=
mainResource
.
GetDirProductCommon
()
+
"/ProjectUnity/Assets/Script/"
+
name
print
(
src
)
print
(
dst
)
FileUtil
.
CopyDir
(
src
,
dst
)
def
DoCopyConfig
(
self
,
isHd
):
# mainCopyConfig.Run(False)
mainCopyConfig
.
Run
(
isHd
)
self
.
CopyAppInfo
(
isHd
)
def
CopyResource
(
self
):
mainCopyResource
.
Run
()
mainCopyGamedata
.
DoCopyGameData
()
mainAppCode
.
Run
(
"copy"
)
def
SaveResource
(
self
):
mainSaveResource
.
Run
()
mainAppCode
.
Run
(
"save"
)
def
CopyGamedata
(
self
):
mainCopyGamedata
.
Run
()
def
UpdateAppInfo
(
self
,
channel
=
""
):
mainUpdateAppstore
.
Run
(
False
)
mainAppInfo
.
Run
(
False
,
channel
)
mainAppStoreTaptap
.
UpLoadVesionDB
()
def
UpdateAso
(
self
):
mainAppStoreApple
.
UpdateAso
(
False
)
mainAppStoreApple
.
UpdateAso
(
True
)
def
UpdateAppInfoAuto
(
self
,
channel
=
""
):
# mainAppInfo.Run(True)
# mainUpdateAppstore.Run(False)
mainAppInfo
.
Run
(
True
,
channel
)
mainAppStoreTaptap
.
UpLoadVesionDB
()
def
CopyAndroidOutputAsset
(
self
):
mainCopyAndroidOutputAsset
.
Run
()
def
CopyAppInfo
(
self
,
isHd
,
channel
=
""
):
# mainAppInfo.Run(True)
# mainUpdateAppstore.Run(False)
mainAppInfo
.
Copy
(
isHd
,
channel
)
def
ApkBuild
(
self
,
channel
,
isHd
):
self
.
CopyAppInfo
(
isHd
,
channel
)
mainCopyAndroidOutputAsset
.
Run
()
mainCopyConfig
.
Run
(
isHd
)
mainCleanScreenshot
.
Run
()
mainApkBuild
.
Run
(
channel
,
isHd
)
def
InstallApk
(
self
,
channel
,
isHd
):
apk
=
mainApkBuild
.
GetApk
(
channel
,
isHd
)
print
(
"apk="
,
apk
)
package
=
mainAppInfo
.
GetAppPackage
(
Source
.
ANDROID
,
isHd
,
channel
)
try
:
os
.
system
(
"adb uninstall "
+
package
)
except
Exception
as
e
:
print
(
"adb uninstall eror="
,
e
,
" package ="
,
package
)
os
.
system
(
"adb install "
+
apk
)
def
CopyAllCmd
(
self
):
mainCopyAllCmd
.
Run
()
def
UnityBuild
(
self
,
stros
):
UnityBuild
.
Run
(
stros
)
# mainCopyGamedata.DoCopyGameData()
def
IPABuild
(
self
,
type
):
mainIPABuild
.
Run
(
type
)
def
UpdateAppstore
(
self
,
isHd
):
mainUpdateAppstore
.
Run
(
isHd
)
self
.
AppstoreUploadiOS
(
isHd
)
def
AppstoreUploadiOS
(
self
,
isHd
):
mainAppstoreUploadiOS
.
Run
(
isHd
)
# 主函数的实现
if
__name__
==
"__main__"
:
# 设置为utf8编码
# reload(sys)
# sys.setdefaultencoding("utf-8")
is_auto_plus_version
=
False
# 入口参数:http://blog.csdn.net/intel80586/article/details/8545572
cmdPath
=
Common
.
cur_file_dir
()
count
=
len
(
sys
.
argv
)
arg3
=
""
arg4
=
""
for
i
in
range
(
1
,
count
):
print
(
"参数"
,
i
,
sys
.
argv
[
i
])
if
i
==
1
:
cmdPath
=
sys
.
argv
[
i
]
if
i
==
3
:
arg3
=
sys
.
argv
[
i
]
if
i
==
4
:
arg4
=
sys
.
argv
[
i
]
mainResource
.
SetCmdPath
(
cmdPath
)
p
=
ProjectManager
()
print
(
mainResource
.
GetDirProduct
())
print
(
mainResource
.
GetRootDir
())
arg
=
sys
.
argv
[
2
]
if
arg
==
"CopyProjectConfig"
:
p
.
CopyProjectConfig
()
if
arg
==
"SaveProjectConfig"
:
p
.
SaveProjectConfig
()
if
arg
==
"CopyCommonScript"
:
p
.
CopyCommonScript
()
if
arg
==
"SaveCommonScript"
:
p
.
SaveCommonScript
()
if
arg
==
"CopyConfig"
:
isHd
=
False
if
arg3
==
"hd"
:
isHd
=
True
p
.
DoCopyConfig
(
isHd
)
if
arg
==
"CopyResource"
:
p
.
CopyResource
()
if
arg
==
"SaveResource"
:
p
.
SaveResource
()
if
arg
==
"UpdateAppInfo"
:
p
.
UpdateAppInfo
()
if
arg
==
"UpdateAso"
:
p
.
UpdateAso
()
if
arg
==
"UpdateAppInfoAuto"
:
p
.
UpdateAppInfo
()
p
.
UpdateAppInfoAuto
()
if
arg
==
"CopyGamedata"
:
p
.
CopyGamedata
()
if
arg
==
"CopyAndroidOutputAsset"
:
p
.
CopyAndroidOutputAsset
()
if
arg
==
"ApkBuild"
:
# isHd = False
# if arg4 =="hd":
# isHd = True
p
.
ApkBuild
(
arg3
,
False
)
p
.
ApkBuild
(
arg3
,
True
)
if
arg
==
"InstallApk"
:
isHd
=
False
if
arg4
==
"hd"
:
isHd
=
True
p
.
InstallApk
(
arg3
,
isHd
)
if
arg
==
"CopyAllCmd"
:
p
.
CopyAllCmd
()
if
arg
==
"UnityBuild"
:
if
Source
.
ScreenShot
==
arg3
:
p
.
CopyResource
()
p
.
UnityBuild
(
arg3
)
if
arg
==
"IPABuild"
:
p
.
IPABuild
(
arg3
)
if
arg
==
"CopyXcodeProject"
:
p
.
IPABuild
(
arg3
)
if
arg
==
"UpdateAppstore"
:
p
.
UpdateAppstore
(
False
)
p
.
UpdateAppstore
(
True
)
if
arg
==
"AppstoreUploadiOS"
:
p
.
AppstoreUploadiOS
(
False
)
if
arg
==
"AppstoreUploadHDiOS"
:
p
.
AppstoreUploadiOS
(
True
)
if
arg
==
"test"
:
p
.
CopyAllCmd
()
print
(
"ProjectManager sucess arg="
,
arg
)
You can’t perform that action at this time.