Commit 0e56757f authored by 范雪寒's avatar 范雪寒

feat: log

parent 87ebc38a
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{"android":"default","ios":"default"},"optimizeHotUpdate":{"android":false,"ios":false},"inlineSpriteFrames":{"android":false,"ios":false},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {
"android": "default",
"ios": "default"
},
"optimizeHotUpdate": {
"android": false,
"ios": false
},
"inlineSpriteFrames": {
"android": false,
"ios": false
},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
......@@ -66,6 +66,10 @@ cc.Class({
if (bundleName) {
nameText.getComponent(cc.EditBox).string = bundleName;
}
global.middleLayer = cc.find('middleLayer').getComponent('middleLayer');
middleLayer.log("middleLayer.log('像这样在这里打log')");
},
asyncDelayLog(str) {
......@@ -137,6 +141,36 @@ cc.Class({
this.loadOnlineBundle(bundleName);
exitBtn.active = true;
});
const btnClose = cc.find('middleLayer/ConsoleNode/BtnClose');
const btnOpen = cc.find('middleLayer/ConsoleNode/BtnOpen');
const consoleNode = cc.find('middleLayer/ConsoleNode/Console');
const consoleBg = cc.find('middleLayer/ConsoleNode/bg');
btnOpen.on('click', () => {
btnClose.active = true;
btnOpen.active = false;
consoleNode.active = true;
consoleBg.active = true;
});
btnClose.on('click', () => {
btnClose.active = false;
btnOpen.active = true;
consoleNode.active = false;
consoleBg.active = false;
});
},
log(str) {
const logStr = `${new Date().toLocaleString()}: ${str}`;
console.log(logStr);
const content = cc.instantiate(cc.find('middleLayer/ConsoleNode/content'));
content.active = true;
const label = content.getChildByName('label');
label.getComponent(cc.Label).string = logStr;
const consoleContent = cc.find('middleLayer/ConsoleNode/Console/content');
consoleContent.addChild(content);
consoleContent.getComponent(cc.Layout).updateLayout();
},
hideUI() {
......@@ -155,12 +189,12 @@ cc.Class({
},
loadLocalBundle(address, port) {
this.callNetworkApiGet(`http://${address}:${port}`, '/publish/config.json', {}, (datastr) => {
this.callNetworkApiGet(`http://${address}:${port}`, '/dist/config.json', {}, (datastr) => {
const data = JSON.parse(datastr);
console.log(JSON.stringify(data));
const sceneName = data.android.sceneName;
const version = data.android.version;
const bondleUrl = `http://${address}:${port}/publish/android/${sceneName}/`;
const bondleUrl = `http://${address}:${port}/dist/android/${sceneName}/`;
this.loadBundle(sceneName, version, bondleUrl);
});
},
......
......@@ -3,6 +3,6 @@
"packages": "packages",
"name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.4",
"version": "2.4.5",
"isNew": false
}
\ No newline at end of file
......@@ -76,11 +76,12 @@ export async function build() {
}
const creatorBasePath = 'C:\\CocosDashboard_1.0.6\\resources\\.editors\\Creator';
// const creatorBasePath = 'C:\\CocosDashboard_1.0.6\\resources\\.editors\\Creator';
const creatorBasePath = '/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator';
export function buildWebDesktop() {
return new Promise((resolve, reject) => {
const buffer = spawn(
`${creatorBasePath}\\2.4.0\\CocosCreator.exe`,
creatorBasePath,
['--path', './', '--build', 'platform=web-desktop;debug=true', '--force'],
{ cwd: '../play' }
);
......@@ -103,7 +104,7 @@ export function buildWebDesktop() {
export function buildAndroidBundle() {
return new Promise((resolve, reject) => {
const buffer = spawn(
`${creatorBasePath}\\2.4.4\\CocosCreator.exe`,
creatorBasePath,
['--path', './', '--build', "platform=ios;debug=false;md5Cache=true;buildPath=build_android;appABIs=['armeabi-v7a','x86','x86_64','arm64-v8a'];encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true", '--force'],
{ cwd: '../play' }
);
......@@ -126,7 +127,7 @@ export function buildAndroidBundle() {
export function buildIosBundle() {
return new Promise((resolve, reject) => {
const buffer = spawn(
`${creatorBasePath}\\2.4.4\\CocosCreator.exe`,
creatorBasePath,
['--path', './', '--build', "platform=ios;debug=false;md5Cache=true;buildPath=build_ios;encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true", '--force'],
{ cwd: '../play' }
);
......@@ -150,7 +151,7 @@ export function buildIosBundle() {
export function buildWebBundle() {
return new Promise((resolve, reject) => {
const buffer = spawn(
`${creatorBasePath}\\2.4.4\\CocosCreator.exe`,
creatorBasePath,
['--path', './', '--build', "platform=web-desktop;debug=false;buildPath=build_web_desktop", '--force'],
{ cwd: '../play' }
);
......
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