@24i/smartapps-bigscreen-rnv-build-engine 0.17.6-alpha.4 → 0.17.6-alpha.6
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.
- package/dist/src/constants/buildProductionPackages.js +9 -0
- package/dist/src/resolvers/index.js +4 -3
- package/dist/src/resolvers/resolveBaseUrl.js +11 -1
- package/dist/src/resolvers/resolveGenericRnvConfig.js +9 -2
- package/dist/src/resolvers/{resolveProductionZipFilePath.js → resolveProductionZipFileRelativePath.js} +3 -3
- package/dist/src/scripts/{buildProductionAll.js → buildProductionPackagesAll.js} +25 -15
- package/dist/src/scripts/release/appCenter/{deployProductionToAppCenter.js → deployProductionPackagesToAppCenter.js} +43 -26
- package/dist/src/scripts/releaseProductionPackagesAll.js +13 -0
- package/dist/src/sdks/sdk-androidtv/sdkAndroidtv.js +11 -5
- package/dist/src/sdks/sdk-webpack/sdkWebpack.js +8 -1
- package/dist/src/tasks/task.rnv.build.js +10 -1
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +12 -4
- package/dist/templates/platforms/_shared/webpack.base.js +2 -2
- package/package.json +1 -1
- package/dist/src/scripts/releaseProductionAll.js +0 -13
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUPPORTED_PACKAGE_PLATFORMS = void 0;
|
|
4
|
+
const platforms_1 = require("./platforms");
|
|
5
|
+
exports.SUPPORTED_PACKAGE_PLATFORMS = [
|
|
6
|
+
platforms_1.Platforms.ANDROIDTV,
|
|
7
|
+
platforms_1.Platforms.TIZEN,
|
|
8
|
+
platforms_1.Platforms.WEBOS,
|
|
9
|
+
];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getProductionZipFileRelativePath = exports.resolveZippedPlatformBuildsRelativeFilePath = exports.resolvePackageVersions = exports.resolveBuildFileExtension = exports.resolveUsedFlavours = exports.resolveSupportedPlatforms = exports.getBaseConfig = exports.resolveBuildFileName = exports.resolveBuildFileBaseName = exports.resolveHbbtvDeployConfig = exports.resolveHbbtvDeployUrl = exports.resolveHbbtvRemoteBuildDirRelativePath = exports.resolveDeployLocations = exports.resolveBuildVersionOffset = exports.resolveBuildVersion = exports.resolveBuildEnvName = exports.resolveCustomBaseUrl = exports.resolveBaseUrl = void 0;
|
|
4
4
|
var resolveBaseUrl_1 = require("./resolveBaseUrl");
|
|
5
5
|
Object.defineProperty(exports, "resolveBaseUrl", { enumerable: true, get: function () { return resolveBaseUrl_1.resolveBaseUrl; } });
|
|
6
|
+
Object.defineProperty(exports, "resolveCustomBaseUrl", { enumerable: true, get: function () { return resolveBaseUrl_1.resolveCustomBaseUrl; } });
|
|
6
7
|
var resolveBuildEnvName_1 = require("./resolveBuildEnvName");
|
|
7
8
|
Object.defineProperty(exports, "resolveBuildEnvName", { enumerable: true, get: function () { return resolveBuildEnvName_1.resolveBuildEnvName; } });
|
|
8
9
|
var resolveBuildVersion_1 = require("./resolveBuildVersion");
|
|
@@ -33,5 +34,5 @@ var resolvePackageVersions_1 = require("./resolvePackageVersions");
|
|
|
33
34
|
Object.defineProperty(exports, "resolvePackageVersions", { enumerable: true, get: function () { return resolvePackageVersions_1.resolvePackageVersions; } });
|
|
34
35
|
var resolveZippedPlatformBuildsRelativeFilePath_1 = require("./resolveZippedPlatformBuildsRelativeFilePath");
|
|
35
36
|
Object.defineProperty(exports, "resolveZippedPlatformBuildsRelativeFilePath", { enumerable: true, get: function () { return resolveZippedPlatformBuildsRelativeFilePath_1.resolveZippedPlatformBuildsRelativeFilePath; } });
|
|
36
|
-
var
|
|
37
|
-
Object.defineProperty(exports, "
|
|
37
|
+
var resolveProductionZipFileRelativePath_1 = require("./resolveProductionZipFileRelativePath");
|
|
38
|
+
Object.defineProperty(exports, "getProductionZipFileRelativePath", { enumerable: true, get: function () { return resolveProductionZipFileRelativePath_1.getProductionZipFileRelativePath; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveBaseUrl = void 0;
|
|
3
|
+
exports.resolveCustomBaseUrl = exports.resolveBaseUrl = void 0;
|
|
4
4
|
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
5
|
const resolveBuildEnvName_1 = require("./resolveBuildEnvName");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
@@ -34,3 +34,13 @@ const resolveBaseUrl = ({ platform, scheme, flavour }) => {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
exports.resolveBaseUrl = resolveBaseUrl;
|
|
37
|
+
const resolveCustomBaseUrl = (c) => {
|
|
38
|
+
const { hostedUrl } = c.buildConfig.common;
|
|
39
|
+
const baseUrl = hostedUrl?.baseUrl;
|
|
40
|
+
const subpath = hostedUrl?.subpath ?? '';
|
|
41
|
+
if (!baseUrl) {
|
|
42
|
+
throw new Error('The resolveCustomBaseUrl failed because baseUrl is missing.');
|
|
43
|
+
}
|
|
44
|
+
return `${baseUrl}${subpath}`;
|
|
45
|
+
};
|
|
46
|
+
exports.resolveCustomBaseUrl = resolveCustomBaseUrl;
|
|
@@ -37,8 +37,15 @@ const mergeFileJsonIntoObject = (filePath, targetObject) => {
|
|
|
37
37
|
const fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
38
38
|
(0, assign_deep_1.default)(targetObject, fileContentAsJSON);
|
|
39
39
|
};
|
|
40
|
-
const getBaseConfig = () => {
|
|
41
|
-
const
|
|
40
|
+
const getBaseConfig = (programOptions) => {
|
|
41
|
+
const { appConfigID, scheme } = programOptions || {};
|
|
42
|
+
const c = rnv_1.ConfigManager.createRnvConfig({ ci: true, ...programOptions }, process);
|
|
43
|
+
if (scheme) {
|
|
44
|
+
c.runtime.scheme = scheme;
|
|
45
|
+
}
|
|
46
|
+
if (appConfigID) {
|
|
47
|
+
c.runtime.appId = appConfigID;
|
|
48
|
+
}
|
|
42
49
|
c.buildConfig = {};
|
|
43
50
|
const packageJsonfileContent = fs.readFileSync('package.json').toString();
|
|
44
51
|
c.files.project.package = JSON.parse(packageJsonfileContent);
|
|
@@ -23,9 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.getProductionZipFileRelativePath = void 0;
|
|
27
27
|
const path = __importStar(require("path"));
|
|
28
|
-
const
|
|
28
|
+
const getProductionZipFileRelativePath = (c) => {
|
|
29
29
|
const { appNameInFileName } = c.buildConfig.common;
|
|
30
30
|
const buildVersion = c.buildConfig.common.packageVersion;
|
|
31
31
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
@@ -33,4 +33,4 @@ const getProductionZipFilePath = (c) => {
|
|
|
33
33
|
const zipFileName = `${appNameInFileName}.production_packages_v${buildVersion}.zip`;
|
|
34
34
|
return path.join(platformBuildsDirPath, zipFileName);
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
36
|
+
exports.getProductionZipFileRelativePath = getProductionZipFileRelativePath;
|
|
@@ -28,38 +28,48 @@ const fs = __importStar(require("fs"));
|
|
|
28
28
|
const path = __importStar(require("path"));
|
|
29
29
|
const fse = __importStar(require("fs-extra"));
|
|
30
30
|
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
31
|
+
const constants_1 = require("../constants");
|
|
32
|
+
const buildProductionPackages_1 = require("../constants/buildProductionPackages");
|
|
31
33
|
const resolvers_1 = require("../resolvers");
|
|
32
|
-
const
|
|
34
|
+
const getZippedDirRelativePath = (c) => {
|
|
33
35
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
34
36
|
return path.join(platformBuildsDir, 'zipped_production_packages');
|
|
35
37
|
};
|
|
36
|
-
const
|
|
38
|
+
const buildProductionTask = (options, c) => {
|
|
37
39
|
const { scheme, platform, flavour } = options;
|
|
38
|
-
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
|
|
39
|
-
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
40
40
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
41
41
|
const buildDirName = `${flavour}_${platform}`;
|
|
42
42
|
const buildDirPath = path.join(platformBuildsDir, buildDirName);
|
|
43
43
|
const buildOutputDirPath = path.join(buildDirPath, 'output');
|
|
44
|
-
const zippedDir = path.join(getZippedDirPath(c), platform);
|
|
45
|
-
fse.copySync(buildOutputDirPath, zippedDir);
|
|
46
44
|
fs.rmSync(buildDirPath, { recursive: true, force: true });
|
|
45
|
+
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci --hostedUrl`;
|
|
46
|
+
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
47
|
+
const zippedDir = path.join(getZippedDirRelativePath(c), platform);
|
|
48
|
+
fse.copySync(buildOutputDirPath, zippedDir);
|
|
47
49
|
};
|
|
48
|
-
const
|
|
50
|
+
const buildProductionPackagesAll = () => {
|
|
51
|
+
console.log('buildProductionPackagesAll');
|
|
49
52
|
const schemes = process.argv.slice(2);
|
|
53
|
+
if (!schemes.length) {
|
|
54
|
+
throw new Error('Missing scheme parameter');
|
|
55
|
+
}
|
|
56
|
+
if (schemes[0] !== constants_1.BuildSchemes.RELEASE_PROD_DIST) {
|
|
57
|
+
throw new Error(`Supported only "${constants_1.BuildSchemes.RELEASE_PROD_DIST}" scheme`);
|
|
58
|
+
}
|
|
50
59
|
const c = (0, resolvers_1.getBaseConfig)();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
const zippedDirPath =
|
|
56
|
-
const zipFilePath = (0, resolvers_1.
|
|
60
|
+
c.runtime.scheme = schemes[0];
|
|
61
|
+
const platforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
62
|
+
const skipPlatforms = platforms.filter((platform) => (!buildProductionPackages_1.SUPPORTED_PACKAGE_PLATFORMS.includes(platform)));
|
|
63
|
+
(0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (options) => buildProductionTask(options, c), { ignoredPlatforms: skipPlatforms });
|
|
64
|
+
const zippedDirPath = path.resolve(getZippedDirRelativePath(c));
|
|
65
|
+
const zipFilePath = path.resolve((0, resolvers_1.getProductionZipFileRelativePath)(c));
|
|
66
|
+
fs.rmSync(zipFilePath, { force: true });
|
|
57
67
|
(0, child_process_1.execSync)(`zip -r ${zipFilePath} *`, { cwd: `${zippedDirPath}` });
|
|
58
68
|
fs.rmSync(zippedDirPath, { recursive: true, force: true });
|
|
59
69
|
return true;
|
|
60
70
|
};
|
|
61
71
|
const startTimestamp = Date.now();
|
|
62
|
-
|
|
72
|
+
buildProductionPackagesAll();
|
|
63
73
|
const msPerSecond = 1000;
|
|
64
74
|
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
65
|
-
console.log(`
|
|
75
|
+
console.log(`buildProductionPackagesAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -23,11 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.deployProductionPackagesToAppCenter = void 0;
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
28
|
const fs = __importStar(require("fs"));
|
|
29
|
-
const
|
|
30
|
-
const
|
|
29
|
+
const index_1 = require("../../../constants/index");
|
|
30
|
+
const buildProductionPackages_1 = require("../../../constants/buildProductionPackages");
|
|
31
|
+
const index_2 = require("../../../resolvers/index");
|
|
31
32
|
const appCenter_1 = require("./appCenter");
|
|
32
33
|
const newLine = '\r\n';
|
|
33
34
|
const getAppCenterConfig = (c) => {
|
|
@@ -38,51 +39,67 @@ const getAppCenterConfig = (c) => {
|
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const tmpOutputDir = path.join(zipFileParsedPath.dir, zipFileParsedPath.name);
|
|
44
|
-
fs.rmSync(tmpOutputDir, { force: true, recursive: true });
|
|
45
|
-
(0, child_process_1.execSync)(`unzip ${zipFilePath} -d ${tmpOutputDir}`);
|
|
42
|
+
const getPlatformPackagesList = (c) => {
|
|
43
|
+
const scheme = index_1.BuildSchemes.RELEASE_PROD_DIST;
|
|
46
44
|
const packagesList = [];
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const platforms = (0, index_2.resolveSupportedPlatforms)(c)
|
|
46
|
+
.filter((platform) => buildProductionPackages_1.SUPPORTED_PACKAGE_PLATFORMS.includes(platform));
|
|
47
|
+
platforms.forEach((platform) => {
|
|
48
|
+
const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
|
|
49
|
+
const platformObj = {
|
|
50
|
+
platformName: platform,
|
|
51
|
+
packages: supportedFlavours.map((appConfigID) => {
|
|
52
|
+
const c = (0, index_2.getBaseConfig)({ platform, scheme, appConfigID, hostedUrl: true });
|
|
53
|
+
return {
|
|
54
|
+
name: (0, index_2.resolveBuildFileName)(c),
|
|
55
|
+
flavour: appConfigID,
|
|
56
|
+
hostedUrl: `${(0, index_2.resolveCustomBaseUrl)(c)}/public`,
|
|
57
|
+
};
|
|
58
|
+
})
|
|
51
59
|
};
|
|
52
|
-
packagesList.push(
|
|
60
|
+
packagesList.push(platformObj);
|
|
53
61
|
});
|
|
54
|
-
fs.rmSync(tmpOutputDir, { force: true, recursive: true });
|
|
55
62
|
return packagesList;
|
|
56
63
|
};
|
|
57
64
|
const getAppCenterToken = () => {
|
|
58
65
|
return process.env['APPCENTER_TOKEN_PRODUCTION_PACKAGES'] || '';
|
|
59
66
|
};
|
|
60
|
-
const
|
|
67
|
+
const deployProductionPackagesToAppCenter = (c) => {
|
|
68
|
+
console.log('deployProductionPackagesToAppCenter');
|
|
61
69
|
const appCenterConfig = getAppCenterConfig(c);
|
|
62
|
-
if (!appCenterConfig)
|
|
63
|
-
|
|
70
|
+
if (!appCenterConfig) {
|
|
71
|
+
throw new Error('Not found App Center Config (for production packages) in build config');
|
|
72
|
+
}
|
|
64
73
|
const { appName: centerAppName } = appCenterConfig;
|
|
65
74
|
const token = getAppCenterToken();
|
|
66
|
-
const zipPath = (0,
|
|
75
|
+
const zipPath = (0, index_2.getProductionZipFileRelativePath)(c);
|
|
67
76
|
const { appName, packageVersion } = c.buildConfig.common;
|
|
68
|
-
if (!centerAppName
|
|
69
|
-
|
|
77
|
+
if (!centerAppName)
|
|
78
|
+
throw new Error('Missing centerAppName in appCenterConfig');
|
|
79
|
+
if (!token)
|
|
80
|
+
throw new Error('Missing App Center Token');
|
|
81
|
+
if (!zipPath)
|
|
82
|
+
throw new Error('Missing path of zip file to be upload to the App Center');
|
|
83
|
+
if (!packageVersion)
|
|
84
|
+
throw new Error('Missing packageVersion to be send to the App Center');
|
|
70
85
|
const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_PRODUCTION_PACKAGES.md`;
|
|
71
86
|
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
72
87
|
fs.unlinkSync(tempReleaseNotesPath);
|
|
73
88
|
}
|
|
74
|
-
const packagesList =
|
|
89
|
+
const packagesList = getPlatformPackagesList(c);
|
|
75
90
|
const notes = [
|
|
76
91
|
`# ${appName} Production Packages`,
|
|
77
92
|
'',
|
|
78
93
|
'## List of Production Packages',
|
|
79
|
-
...packagesList.reduce((acc, { platformName,
|
|
94
|
+
...packagesList.reduce((acc, { platformName, packages }) => ([
|
|
80
95
|
...acc,
|
|
81
96
|
`- ${platformName}`,
|
|
82
|
-
...
|
|
97
|
+
...packages.reduce((accPackages, { name, hostedUrl }) => ([
|
|
98
|
+
...accPackages,
|
|
99
|
+
` - ${name}`,
|
|
100
|
+
` - App URL: ${hostedUrl}`
|
|
101
|
+
]), []),
|
|
83
102
|
]), []),
|
|
84
|
-
'',
|
|
85
|
-
'URL: <hosted_URL>'
|
|
86
103
|
];
|
|
87
104
|
const packagesMarkdown = notes.join(newLine);
|
|
88
105
|
(0, child_process_1.execSync)(`echo "${packagesMarkdown}" >> ${tempReleaseNotesPath}`);
|
|
@@ -95,4 +112,4 @@ const deployProductionToAppCenter = (c) => {
|
|
|
95
112
|
token,
|
|
96
113
|
});
|
|
97
114
|
};
|
|
98
|
-
exports.
|
|
115
|
+
exports.deployProductionPackagesToAppCenter = deployProductionPackagesToAppCenter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("../resolvers/index");
|
|
4
|
+
const deployProductionPackagesToAppCenter_1 = require("./release/appCenter/deployProductionPackagesToAppCenter");
|
|
5
|
+
const releaseProductionPackagesAll = () => {
|
|
6
|
+
const c = (0, index_1.getBaseConfig)();
|
|
7
|
+
(0, deployProductionPackagesToAppCenter_1.deployProductionPackagesToAppCenter)(c);
|
|
8
|
+
};
|
|
9
|
+
const startTimestamp = Date.now();
|
|
10
|
+
releaseProductionPackagesAll();
|
|
11
|
+
const msPerSecond = 1000;
|
|
12
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
13
|
+
console.log(`releaseProductionPackagesAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -165,11 +165,17 @@ const configureProject = (c) => {
|
|
|
165
165
|
};
|
|
166
166
|
const getHostedAppEntryUrl = (c) => {
|
|
167
167
|
const { platform, runtime } = c;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
let baseUrl = '';
|
|
169
|
+
if (c.program.hostedUrl) {
|
|
170
|
+
baseUrl = (0, resolvers_1.resolveCustomBaseUrl)(c);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
baseUrl = (0, resolvers_1.resolveBaseUrl)({
|
|
174
|
+
platform,
|
|
175
|
+
scheme: runtime.scheme || '',
|
|
176
|
+
flavour: runtime.appId,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
173
179
|
return `${baseUrl}/public/index.html`;
|
|
174
180
|
};
|
|
175
181
|
const configureEntryUrl = (c) => {
|
|
@@ -8,6 +8,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const ip_1 = __importDefault(require("ip"));
|
|
9
9
|
const rnv_1 = require("rnv");
|
|
10
10
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
11
|
+
const resolvers_1 = require("../../resolvers");
|
|
11
12
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
12
13
|
const configureWebProject = async (c) => {
|
|
13
14
|
rnv_1.Logger.logTask('configureWebProject');
|
|
@@ -51,7 +52,13 @@ const buildCoreWebpackProject = async (c) => {
|
|
|
51
52
|
if (wp === '') {
|
|
52
53
|
rnv_1.Logger.logWarning('Webpack not found. Will try to use globally installed one');
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
let hostedUrlVariable = '';
|
|
56
|
+
if (c.program.hostedUrl) {
|
|
57
|
+
hostedUrlVariable = `HOSTED_URL=${(0, resolvers_1.resolveCustomBaseUrl)(c)}`;
|
|
58
|
+
}
|
|
59
|
+
const envVars = [
|
|
60
|
+
`PLATFORM=${platform}`, `NODE_ENV=${environment}`, debugVariables, hostedUrlVariable,
|
|
61
|
+
].filter(Boolean).join(' ');
|
|
55
62
|
const wpConfigPath = `./platformBuilds/${appId}_${platform}/webpack.config.${configName}.js`;
|
|
56
63
|
const wpCmd = `node ${wp} build --mode production --config ${wpConfigPath}`;
|
|
57
64
|
await rnv_1.Exec.executeAsync(c, `npx cross-env ${envVars} ${wpCmd}`);
|
|
@@ -31,6 +31,12 @@ const constants_1 = require("../constants");
|
|
|
31
31
|
const sdks_1 = require("../sdks");
|
|
32
32
|
const resolvers_1 = require("../resolvers");
|
|
33
33
|
const { TASK_BUILD, TASK_PACKAGE, PARAMS } = rnv_1.Constants;
|
|
34
|
+
const PARAM_KEYS = {
|
|
35
|
+
hostedUrl: {
|
|
36
|
+
key: 'hostedUrl',
|
|
37
|
+
description: 'Uses hosted URL of App',
|
|
38
|
+
}
|
|
39
|
+
};
|
|
34
40
|
const makeZipOutput = (c) => {
|
|
35
41
|
const platformBuildDir = rnv_1.Common.getPlatformBuildDir(c);
|
|
36
42
|
const copiedProjectBuildDir = `${platformBuildDir}/build`;
|
|
@@ -59,6 +65,9 @@ const buildFn = async (c, parentTask, originTask) => {
|
|
|
59
65
|
rnv_1.Logger.logTask('taskRnvBuild', `parent:${parentTask}`);
|
|
60
66
|
const { platform } = c;
|
|
61
67
|
c.runtime.forceBundleAssets = true;
|
|
68
|
+
if (c.program.rawArgs.includes(`--${PARAM_KEYS.hostedUrl.key}`)) {
|
|
69
|
+
c.program[PARAM_KEYS.hostedUrl.key] = true;
|
|
70
|
+
}
|
|
62
71
|
await (0, sdks_1.handlePlatformSdk)(c);
|
|
63
72
|
await rnv_1.TaskManager.executeOrSkipTask(c, TASK_PACKAGE, TASK_BUILD, originTask);
|
|
64
73
|
switch (platform) {
|
|
@@ -93,7 +102,7 @@ const customRnvBuildTask = {
|
|
|
93
102
|
description: 'Build project binary',
|
|
94
103
|
fn: buildFn,
|
|
95
104
|
task: 'build',
|
|
96
|
-
params: PARAMS.withBase(PARAMS.withConfigure()),
|
|
105
|
+
params: PARAMS.withBase(PARAMS.withConfigure([PARAM_KEYS.hostedUrl])),
|
|
97
106
|
platforms: Object.values(constants_1.Platforms),
|
|
98
107
|
};
|
|
99
108
|
exports.customRnvBuildTask = customRnvBuildTask;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forEachSupportedPlatformFlavour = exports.getProgressMessage = void 0;
|
|
3
|
+
exports.forEachSupportedPlatformFlavour = exports.forEachPlatformFlavour = exports.getProgressMessage = void 0;
|
|
4
4
|
const resolvers_1 = require("../resolvers");
|
|
5
5
|
const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, flavours, flavourIndex, }) => {
|
|
6
6
|
const printScheme = schemes && schemes.length && schemeIndex !== undefined;
|
|
@@ -16,8 +16,8 @@ const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, fl
|
|
|
16
16
|
return string;
|
|
17
17
|
};
|
|
18
18
|
exports.getProgressMessage = getProgressMessage;
|
|
19
|
-
const
|
|
20
|
-
const { ignoredPlatforms = [], schemes = [], schemeIndex = 0,
|
|
19
|
+
const _forEachPlatformFlavour = (platforms, c, cb, options = {}) => {
|
|
20
|
+
const { ignoredPlatforms = [], schemes = [], schemeIndex = 0, } = options;
|
|
21
21
|
const processPlatformFlavours = (platform, platformIndex, platforms) => {
|
|
22
22
|
if (ignoredPlatforms.includes(platform)) {
|
|
23
23
|
console.log(`\nSkipping "${platforms[platformIndex]}" platform (${platformIndex + 1}/${platforms.length}).`);
|
|
@@ -33,6 +33,14 @@ const forEachSupportedPlatformFlavour = (c, cb, options = {}) => {
|
|
|
33
33
|
const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
|
|
34
34
|
supportedFlavours.forEach(processFlavour);
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
platforms.forEach(processPlatformFlavours);
|
|
37
|
+
};
|
|
38
|
+
const forEachSupportedPlatformFlavour = (c, cb, options = {}) => {
|
|
39
|
+
const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
40
|
+
_forEachPlatformFlavour(supportedPlatforms, c, cb, options);
|
|
37
41
|
};
|
|
38
42
|
exports.forEachSupportedPlatformFlavour = forEachSupportedPlatformFlavour;
|
|
43
|
+
const forEachPlatformFlavour = (platforms, c, cb) => {
|
|
44
|
+
_forEachPlatformFlavour(platforms, c, cb);
|
|
45
|
+
};
|
|
46
|
+
exports.forEachPlatformFlavour = forEachPlatformFlavour;
|
|
@@ -125,13 +125,13 @@ function generateConfig(config) {
|
|
|
125
125
|
scheme: config.scheme,
|
|
126
126
|
flavour: config.appConfigId,
|
|
127
127
|
};
|
|
128
|
+
const { PLATFORM, HOSTED_URL } = process.env;
|
|
128
129
|
const { buildConfig } = smartapps_bigscreen_rnv_build_engine_1.Resolvers.getBaseConfig();
|
|
129
130
|
const buildVersion = smartapps_bigscreen_rnv_build_engine_1.Resolvers.resolveBuildVersion(platformSchemeAppIdObj);
|
|
130
|
-
const baseUrl = smartapps_bigscreen_rnv_build_engine_1.Resolvers.resolveBaseUrl(platformSchemeAppIdObj);
|
|
131
|
+
const baseUrl = HOSTED_URL || smartapps_bigscreen_rnv_build_engine_1.Resolvers.resolveBaseUrl(platformSchemeAppIdObj);
|
|
131
132
|
const packageVersions = smartapps_bigscreen_rnv_build_engine_1.Resolvers.resolvePackageVersions(projectDir);
|
|
132
133
|
const devServerHost = config.devServerHost || '0.0.0.0';
|
|
133
134
|
const isDevServer = appBuildEngineProjectDir.endsWith('/server');
|
|
134
|
-
const { PLATFORM } = process.env;
|
|
135
135
|
const isBuildHosted = config.isBuildHosted || false;
|
|
136
136
|
const appContentPath = getAppContentPath(baseUrl, isBuildHosted);
|
|
137
137
|
const copiedDirWithPublicContentPath = path_1.default.join(appBuildDir, `../${path_1.default.parse(appBuildDir).name}-public`);
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const resolvers_1 = require("../resolvers");
|
|
4
|
-
const deployProductionToAppCenter_1 = require("./release/appCenter/deployProductionToAppCenter");
|
|
5
|
-
const releaseProductionAll = () => {
|
|
6
|
-
const c = (0, resolvers_1.getBaseConfig)();
|
|
7
|
-
(0, deployProductionToAppCenter_1.deployProductionToAppCenter)(c);
|
|
8
|
-
};
|
|
9
|
-
const startTimestamp = Date.now();
|
|
10
|
-
releaseProductionAll();
|
|
11
|
-
const msPerSecond = 1000;
|
|
12
|
-
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
13
|
-
console.log(`releaseProductionAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
|