jh5_app_build 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/build_std.js +28 -0
  2. package/package.json +1 -1
package/lib/build_std.js CHANGED
@@ -54,6 +54,8 @@ module.exports = async (cmd, buildCfg) => {
54
54
  apkinfoObj = JSON.parse(fs.readFileSync(apkConfig + "/apkinfo.json", 'utf-8'));
55
55
  } catch (error) {
56
56
  }
57
+ // 默认软件名
58
+ if (!apkinfoObj.appName) apkinfoObj.appName = "智能终端"
57
59
 
58
60
  // 清理数据
59
61
  console.log(`delete temp file ...`);
@@ -61,6 +63,7 @@ module.exports = async (cmd, buildCfg) => {
61
63
  await jutils.jfile_utils.deleteFolder(stdBinDir + "/assets/h5app");
62
64
  await jutils.jfile_utils.deleteFolder(stdBinDir + "/assets/jext");
63
65
  await jutils.jfile_utils.deleteFolder(stdBinDir + "/assets/screen");
66
+ await jutils.jfile_utils.deleteFolder(stdBinDir + "/assets/sounds");
64
67
  await jutils.jfile_utils.deleteFolder(stdBinDir + "/build");
65
68
 
66
69
  // 修改版本号
@@ -139,6 +142,31 @@ module.exports = async (cmd, buildCfg) => {
139
142
  }
140
143
  }
141
144
 
145
+ // 添加音频文件
146
+ {
147
+ let pathSub = "jbuild_res/audio_wav";
148
+ console.log(`scaning ${pathSub} ...`);
149
+ let fileList = glob(`${pathSub}/**/*`, {
150
+ dot: true,
151
+ sync: true,
152
+ nodir: true,
153
+ cwd: buildCfg.rootPath,
154
+ ignore: []
155
+ });
156
+ if (fileList.length === 0) {
157
+ console.error("no dist files!");
158
+ return;
159
+ }
160
+ console.log(`add [${fileList.length}] files ...`);
161
+ let baseDir = makeAndGetDir(stdBinDir + "/assets/sounds");
162
+ for (let index = 0; index < fileList.length; index++) {
163
+ let element = fileList[index].substr(pathSub.length + 1);
164
+
165
+ // 添加文件
166
+ await makeDirAndCopy(`${buildCfg.rootPath}/${pathSub}/${element}`, baseDir + element);
167
+ }
168
+ }
169
+
142
170
  // 添加so文件
143
171
  {
144
172
  let pathSub = "static/ndkutils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jh5_app_build",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "jaskle jh5_app_build",
5
5
  "main": "./bin/jh5_app_build.js",
6
6
  "registry": true,