Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_iplayabc
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
middleLayer_for_iplayabc
Commits
b2f124f4
Commit
b2f124f4
authored
3 years ago
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs:
parent
adc27763
master
iplayabc_buckup
minigame
wordgame
v30
v29
v28
v27
v26
v25
v24
v23
v22
v21
v20
v19
v18
v17
v16
v15
v14
v13
v12
v11
v10
v9
v8
v7
v6
v5
v4
v3
v2
v1
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
30 deletions
+35
-30
README.md
README.md
+1
-1
cocos_generator.meta
assets/cocos_generator.meta
+1
-15
MyCocosSceneComponent.ts
assets/cocos_generator/script/MyCocosSceneComponent.ts
+1
-1
buildCocos.js
bin/buildCocos.js
+32
-13
No files found.
README.md
View file @
b2f124f4
...
...
@@ -81,4 +81,4 @@ npm start
*
手机和电脑连接同一个Wifi
*
打开调试app,根据提示输入IP地址,点击开始就可以在手机上预览模板了
*
\ No newline at end of file
*
使用 this.log("==调试信息=="); 可以打印日志进行必要的调试
\ No newline at end of file
This diff is collapsed.
Click to expand it.
assets/cocos_generator.meta
View file @
b2f124f4
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"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":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
assets/cocos_generator/script/MyCocosSceneComponent.ts
View file @
b2f124f4
...
...
@@ -126,7 +126,7 @@ export class MyCocosSceneComponent extends cc.Component {
log
(
str
)
{
const
node
=
cc
.
find
(
'
middleLayer
'
);
if
(
node
){
node
.
getComponent
(
'
middleLayer
'
).
showL
og
(
str
);
node
.
getComponent
(
'
middleLayer
'
).
l
og
(
str
);
}
else
{
cc
.
log
(
str
);
}
...
...
This diff is collapsed.
Click to expand it.
bin/buildCocos.js
View file @
b2f124f4
...
...
@@ -128,15 +128,28 @@ async function buildWebBundle() {
await
buildCocos
(
args
);
}
function
createConfigFile
(
projectName
)
{
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
function
createConfigFile
(
projectName
,
type
)
{
let
iosVersion
=
""
;
let
androidVersion
=
""
;
if
(
!
type
){
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
if
(
type
==
"
android
"
){
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
}
const
config
=
{
"
ios
"
:
{
"
sceneName
"
:
projectName
,
...
...
@@ -342,32 +355,38 @@ module.exports = {
},
buildAndroid
:
async
function
()
{
// 构建前检查
const
projectName
=
build_check
();
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/android
'
);
await
buildAndroidBundle
();
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
console
.
log
(
'
构建 android bundle 成功!
'
);
// 改设置为非bundle
changeSettingToWebDesktop
();
createConfigFile
(
projectName
,
"
android
"
);
await
removeDir
(
'
build_android
'
);
console
.
log
(
'
构建 android bundle 成功!
'
);
},
buildIos
:
async
function
()
{
// 构建前检查
const
projectName
=
build_check
();
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/ios
'
);
await
buildIosBundle
();
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
console
.
log
(
'
构建 ios bundle 成功!
'
);
// 改设置为非bundle
changeSettingToWebDesktop
();
createConfigFile
(
projectName
,
"
ios
"
);
await
removeDir
(
'
build_ios
'
);
console
.
log
(
'
构建 ios bundle 成功!
'
);
}
};
This diff is collapsed.
Click to expand it.
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