Commit 98328c7e authored by 李维's avatar 李维

更新打包脚本

parent 2022261c
......@@ -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') {
creatorBasePath = "/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator";
}
......@@ -349,56 +349,56 @@ module.exports = {
// 清理旧文件
// 构建form
// await removeDir('dist/form');
// await buildForm();
await removeDir('dist/form');
await buildForm();
// 替换uuid
await replaceUuids();
// 改设置为非bundle
// changeSettingToWebDesktop();
changeSettingToWebDesktop();
// // 构建play
// await removeDir('dist/play');
// await buildWebDesktop();
// await copyDir('build/web-desktop', 'dist/play');
// replaceIndexHtml();
// console.log('构建 web desktop 成功!');
// 构建play
await removeDir('dist/play');
await buildWebDesktop();
await copyDir('build/web-desktop', 'dist/play');
replaceIndexHtml();
console.log('构建 web desktop 成功!');
// // 改设置为bundle
// changeSettingsToBundle();
// 改设置为bundle
changeSettingsToBundle();
// await removeDir('dist/android');
// await buildAndroidBundle();
// await copyDir('build_android/jsb-link/remote', 'dist/android');
// console.log('构建 android bundle 成功!');
await removeDir('dist/android');
await buildAndroidBundle();
await copyDir('build_android/jsb-link/remote', 'dist/android');
console.log('构建 android bundle 成功!');
// await removeDir('dist/ios');
// await buildIosBundle();
// await copyDir('build_ios/jsb-link/remote', 'dist/ios');
// console.log('构建 ios bundle 成功!');
await removeDir('dist/ios');
await buildIosBundle();
await copyDir('build_ios/jsb-link/remote', 'dist/ios');
console.log('构建 ios bundle 成功!');
// await removeDir('dist/web_desktop');
// await buildWebBundle();
// await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
// console.log('构建 web bundle 成功!');
await removeDir('dist/web_desktop');
await buildWebBundle();
await copyDir(`build_web_desktop/web-desktop/assets/${projectName}`, 'dist/web_desktop');
console.log('构建 web bundle 成功!');
// // 改设置为非bundle
// changeSettingToWebDesktop();
// 改设置为非bundle
changeSettingToWebDesktop();
// createConfigFile(projectName);
createConfigFile(projectName);
// compressAll(projectName);
compressAll(projectName);
// await removeDir('build');
// await removeDir('build_android');
// await removeDir('build_ios');
// await removeDir('build_web_desktop');
await removeDir('build');
await removeDir('build_android');
await removeDir('build_ios');
await removeDir('build_web_desktop');
// const endTime = new Date().getTime();
// const duration = new Date(endTime - startTime);
// console.log(`打包完成!`);
// console.log(`用时${duration.getMinutes()}分${duration.getSeconds()}秒。`);
const endTime = new Date().getTime();
const duration = new Date(endTime - startTime);
console.log(`打包完成!`);
console.log(`用时${duration.getMinutes()}${duration.getSeconds()}秒。`);
},
buildAndroid: async function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment