@24i/smartapps-bigscreen-rnv-build-engine 0.17.6-alpha.16 → 0.17.6-alpha.17

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.
@@ -25,12 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.customRnvBuildTask = void 0;
27
27
  const child_process_1 = require("child_process");
28
+ const path = __importStar(require("path"));
29
+ const os = __importStar(require("os"));
28
30
  const fs = __importStar(require("fs"));
29
31
  const rnv_1 = require("rnv");
30
32
  const constants_1 = require("../constants");
31
33
  const sdks_1 = require("../sdks");
32
34
  const resolvers_1 = require("../resolvers");
33
35
  const { TASK_BUILD, TASK_PACKAGE, PARAMS } = rnv_1.Constants;
36
+ const isWindows = os.platform() === 'win32';
34
37
  const PARAM_KEYS = {
35
38
  productionPackagesHostedUrl: {
36
39
  key: 'productionPackagesHostedUrl',
@@ -39,17 +42,22 @@ const PARAM_KEYS = {
39
42
  };
40
43
  const makeZipOutput = (c) => {
41
44
  const platformBuildDir = rnv_1.Common.getPlatformBuildDir(c);
42
- const copiedProjectBuildDir = `${platformBuildDir}/build`;
45
+ const copiedProjectBuildDir = path.join(platformBuildDir, 'build');
43
46
  const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
44
47
  const fileName = (0, resolvers_1.resolveBuildFileName)(c) || defaultZipFileName;
45
- (0, child_process_1.execSync)(`cp -r ${rnv_1.Common.getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
46
- (0, child_process_1.execSync)(`rm -rf ${platformBuildDir}/output`);
47
- (0, child_process_1.execSync)(`mkdir ${platformBuildDir}/output`);
48
- (0, child_process_1.execSync)(`zip -r ../output/${fileName} *`, { cwd: copiedProjectBuildDir });
48
+ (0, child_process_1.execSync)(`cp -r ${path.join(rnv_1.Common.getPlatformProjectDir(c), 'public')} ${copiedProjectBuildDir}`);
49
+ (0, child_process_1.execSync)(`rm -rf ${path.join(platformBuildDir, 'output')}`);
50
+ (0, child_process_1.execSync)(`mkdir ${path.join(platformBuildDir, 'output')}`);
51
+ if (isWindows) {
52
+ (0, child_process_1.execSync)(`tar -acf ${path.join('..', 'output', fileName)} *`, { cwd: copiedProjectBuildDir });
53
+ }
54
+ else {
55
+ (0, child_process_1.execSync)(`zip -r ${path.join('..', 'output', fileName)} *`, { cwd: copiedProjectBuildDir });
56
+ }
49
57
  (0, child_process_1.execSync)(`rm -rf ${copiedProjectBuildDir}`);
50
58
  };
51
59
  const renameOutput = (c) => {
52
- const packageOutputDirPath = `${c.runtime.appDir}/output`;
60
+ const packageOutputDirPath = path.join(c.runtime.appDir, 'output');
53
61
  if (!fs.existsSync(packageOutputDirPath))
54
62
  return;
55
63
  const outputFilenameList = fs.readdirSync(packageOutputDirPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.6-alpha.16",
3
+ "version": "0.17.6-alpha.17",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {