Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP49
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
OP49
Commits
98328c7e
Commit
98328c7e
authored
Jan 11, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新打包脚本
parent
2022261c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
36 deletions
+36
-36
buildCocos.js
bin/buildCocos.js
+36
-36
No files found.
bin/buildCocos.js
View file @
98328c7e
...
@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
...
@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
}
}
let
creatorBasePath
=
'
D:
\\
work
\\
CocosDashboard_1.0.9
\\
resources
\\
.editors
\\
Creator
\\
2.4.5
\\
CocosCreator.exe
'
;
let
creatorBasePath
=
'
CocosCreator
'
;
if
(
process
.
platform
!==
'
win32
'
)
{
if
(
process
.
platform
!==
'
win32
'
)
{
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
}
}
...
@@ -349,56 +349,56 @@ module.exports = {
...
@@ -349,56 +349,56 @@ module.exports = {
// 清理旧文件
// 清理旧文件
// 构建form
// 构建form
//
await removeDir('dist/form');
await
removeDir
(
'
dist/form
'
);
//
await buildForm();
await
buildForm
();
// 替换uuid
// 替换uuid
await
replaceUuids
();
await
replaceUuids
();
// 改设置为非bundle
// 改设置为非bundle
//
changeSettingToWebDesktop();
changeSettingToWebDesktop
();
//
//
构建play
// 构建play
//
await removeDir('dist/play');
await
removeDir
(
'
dist/play
'
);
//
await buildWebDesktop();
await
buildWebDesktop
();
//
await copyDir('build/web-desktop', 'dist/play');
await
copyDir
(
'
build/web-desktop
'
,
'
dist/play
'
);
//
replaceIndexHtml();
replaceIndexHtml
();
//
console.log('构建 web desktop 成功!');
console
.
log
(
'
构建 web desktop 成功!
'
);
//
//
改设置为bundle
// 改设置为bundle
//
changeSettingsToBundle();
changeSettingsToBundle
();
//
await removeDir('dist/android');
await
removeDir
(
'
dist/android
'
);
//
await buildAndroidBundle();
await
buildAndroidBundle
();
//
await copyDir('build_android/jsb-link/remote', 'dist/android');
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
//
console.log('构建 android bundle 成功!');
console
.
log
(
'
构建 android bundle 成功!
'
);
//
await removeDir('dist/ios');
await
removeDir
(
'
dist/ios
'
);
//
await buildIosBundle();
await
buildIosBundle
();
//
await copyDir('build_ios/jsb-link/remote', 'dist/ios');
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
//
console.log('构建 ios bundle 成功!');
console
.
log
(
'
构建 ios bundle 成功!
'
);
//
await removeDir('dist/web_desktop');
await
removeDir
(
'
dist/web_desktop
'
);
//
await buildWebBundle();
await
buildWebBundle
();
//
await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
await
copyDir
(
`build_web_desktop/web-desktop/assets/
${
projectName
}
`
,
'
dist/web_desktop
'
);
//
console.log('构建 web bundle 成功!');
console
.
log
(
'
构建 web bundle 成功!
'
);
//
//
改设置为非bundle
// 改设置为非bundle
//
changeSettingToWebDesktop();
changeSettingToWebDesktop
();
//
createConfigFile(projectName);
createConfigFile
(
projectName
);
//
compressAll(projectName);
compressAll
(
projectName
);
//
await removeDir('build');
await
removeDir
(
'
build
'
);
//
await removeDir('build_android');
await
removeDir
(
'
build_android
'
);
//
await removeDir('build_ios');
await
removeDir
(
'
build_ios
'
);
//
await removeDir('build_web_desktop');
await
removeDir
(
'
build_web_desktop
'
);
//
const endTime = new Date().getTime();
const
endTime
=
new
Date
().
getTime
();
//
const duration = new Date(endTime - startTime);
const
duration
=
new
Date
(
endTime
-
startTime
);
//
console.log(`打包完成!`);
console
.
log
(
`打包完成!`
);
//
console.log(`用时${duration.getMinutes()}分${duration.getSeconds()}秒。`);
console
.
log
(
`用时
${
duration
.
getMinutes
()}
分
${
duration
.
getSeconds
()}
秒。`
);
},
},
buildAndroid
:
async
function
()
{
buildAndroid
:
async
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment