@24i/smartapps-bigscreen-rnv-build-engine 0.9.2-alpha.1435 → 0.9.2-alpha.1449
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/__tests__/sdks/sdk-utils/sdk-installer/services/download.spec.js +10 -28
- package/dist/src/scripts/generateDeployUrls/generateDeployUrls.js +89 -0
- package/dist/src/scripts/generateDeployUrls/index.js +2 -86
- package/dist/src/sdks/sdk-tizen/index.js +3 -230
- package/dist/src/sdks/sdk-tizen/sdkTizen.js +240 -0
- package/dist/src/sdks/sdk-webos/index.js +3 -125
- package/dist/src/sdks/sdk-webos/sdkWebos.js +135 -0
- package/dist/src/sdks/sdk-webpack/index.js +11 -30
- package/dist/src/sdks/sdk-webpack/sdkWebpack.js +32 -0
- package/dist/src/tasks/task.rnv.configure.js +2 -8
- package/dist/src/utils/generateSvgSpriteMap.js +74 -0
- package/dist/templates/platforms/_shared/webpack.base.js +1 -1
- package/jest.config.js +1 -0
- package/package.json +4 -5
- package/coverage/clover.xml +0 -199
- package/coverage/coverage-final.json +0 -10
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -79
- package/coverage/lcov-report/clean.ts.html +0 -113
- package/coverage/lcov-report/download.ts.html +0 -260
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -141
- package/coverage/lcov-report/index.ts.html +0 -86
- package/coverage/lcov-report/install.ts.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/registerSdkPath.ts.html +0 -134
- package/coverage/lcov-report/sdk-installer/index.html +0 -126
- package/coverage/lcov-report/sdk-installer/index.ts.html +0 -83
- package/coverage/lcov-report/sdk-installer/sdkInstaller.ts.html +0 -233
- package/coverage/lcov-report/sdk-installer/services/clean.ts.html +0 -113
- package/coverage/lcov-report/sdk-installer/services/download.ts.html +0 -260
- package/coverage/lcov-report/sdk-installer/services/index.html +0 -171
- package/coverage/lcov-report/sdk-installer/services/index.ts.html +0 -92
- package/coverage/lcov-report/sdk-installer/services/install.ts.html +0 -161
- package/coverage/lcov-report/sdk-installer/services/unzip.ts.html +0 -116
- package/coverage/lcov-report/sdk-utils/index.html +0 -126
- package/coverage/lcov-report/sdk-utils/index.ts.html +0 -86
- package/coverage/lcov-report/sdk-utils/installSdk.ts.html +0 -113
- package/coverage/lcov-report/sdk-utils/registerSdkPath.ts.html +0 -134
- package/coverage/lcov-report/sdk-utils/sdk-installer/index.html +0 -126
- package/coverage/lcov-report/sdk-utils/sdk-installer/index.ts.html +0 -83
- package/coverage/lcov-report/sdk-utils/sdk-installer/sdkInstaller.ts.html +0 -224
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/clean.ts.html +0 -113
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/download.ts.html +0 -260
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/index.html +0 -171
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/index.ts.html +0 -92
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/install.ts.html +0 -161
- package/coverage/lcov-report/sdk-utils/sdk-installer/services/unzip.ts.html +0 -116
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -170
- package/coverage/lcov-report/unzip.ts.html +0 -116
- package/coverage/lcov.info +0 -371
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.runTizen = exports.handleTizenSdk = exports.configureTizenProject = exports.configureTizenGlobal = exports.buildTizenProject = void 0;
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const path = __importStar(require("path"));
|
|
25
|
+
const os = __importStar(require("os"));
|
|
26
|
+
const semver = __importStar(require("semver"));
|
|
27
|
+
const child_process_1 = require("child_process");
|
|
28
|
+
const rnv_1 = require("rnv");
|
|
29
|
+
const sdk_utils_1 = require("../sdk-utils");
|
|
30
|
+
const constants_1 = require("../../constants");
|
|
31
|
+
const { execCLI } = rnv_1.Exec;
|
|
32
|
+
const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
33
|
+
const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
|
|
34
|
+
const { chalk, logTask, logDebug, logError, logSuccess, logWarning, logInfo, } = rnv_1.Logger;
|
|
35
|
+
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
36
|
+
const { writeCleanFile, fsExistsSync, updateObjectSync } = rnv_1.FileUtils;
|
|
37
|
+
const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
|
|
38
|
+
const { copyAssetsFolder, copyBuildsFolder } = rnv_1.ProjectManager;
|
|
39
|
+
const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME, } = rnv_1.SDKManager.Tizen;
|
|
40
|
+
const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
|
|
41
|
+
const configureTizenGlobal = (c) => new Promise((resolve, reject) => {
|
|
42
|
+
logTask('configureTizenGlobal');
|
|
43
|
+
const authorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
|
|
44
|
+
if (fsExistsSync(authorCert)) {
|
|
45
|
+
logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists!`);
|
|
46
|
+
resolve();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
logWarning(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file missing! Creating one for you...`);
|
|
50
|
+
createDevelopTizenCertificate(c)
|
|
51
|
+
.then(() => resolve())
|
|
52
|
+
.catch((e) => reject(e));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
exports.configureTizenGlobal = configureTizenGlobal;
|
|
56
|
+
const handleRunTizenSimOrDevice = async (c) => {
|
|
57
|
+
try {
|
|
58
|
+
await runTizenSimOrDevice(c);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
return Promise.reject(e);
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
};
|
|
65
|
+
const runTizen = async (c, target) => {
|
|
66
|
+
logTask('runTizen', `target:${target}`);
|
|
67
|
+
const { platform } = c;
|
|
68
|
+
const { hosted } = c.program;
|
|
69
|
+
const isHosted = hosted && !getConfigProp(c, platform, 'bundleAssets');
|
|
70
|
+
if (isHosted) {
|
|
71
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
72
|
+
if (isPortActive) {
|
|
73
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
74
|
+
c.runtime.skipActiveServerCheck = !resetCompleted;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
logTask('runTizen', `target:${target} hosted:${!!isHosted}`);
|
|
78
|
+
if (isHosted)
|
|
79
|
+
return;
|
|
80
|
+
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
81
|
+
if (bundleAssets) {
|
|
82
|
+
await buildCoreWebpackProject(c);
|
|
83
|
+
await handleRunTizenSimOrDevice(c);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
87
|
+
const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
|
|
88
|
+
const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
|
|
89
|
+
if (!isPortActive) {
|
|
90
|
+
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
91
|
+
waitForWebpack(c)
|
|
92
|
+
.then(() => handleRunTizenSimOrDevice(c))
|
|
93
|
+
.catch(logError);
|
|
94
|
+
await runWebpackServer(c, isWeinreEnabled);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
98
|
+
if (resetCompleted) {
|
|
99
|
+
waitForWebpack(c)
|
|
100
|
+
.then(() => handleRunTizenSimOrDevice(c))
|
|
101
|
+
.catch(logError);
|
|
102
|
+
await runWebpackServer(c, isWeinreEnabled);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
await handleRunTizenSimOrDevice(c);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.runTizen = runTizen;
|
|
111
|
+
const buildTizenProject = async (c) => {
|
|
112
|
+
logTask('buildTizenProject');
|
|
113
|
+
await buildCoreWebpackProject(c);
|
|
114
|
+
if (!c.program.hosted) {
|
|
115
|
+
const { buildConfig } = c;
|
|
116
|
+
const platformConfig = buildConfig.platforms[constants_1.Platforms.TIZEN];
|
|
117
|
+
const projectDir = getPlatformProjectDir(c);
|
|
118
|
+
const projectParentDir = path.join(projectDir, '..');
|
|
119
|
+
const tBuild = path.join(projectParentDir, 'build');
|
|
120
|
+
const tOut = path.join(projectParentDir, 'output');
|
|
121
|
+
const certProfile = platformConfig.certificateProfile ?? DEFAULT_SECURITY_PROFILE_NAME;
|
|
122
|
+
await execCLI(c, CLI_TIZEN, `build-web -- ${projectDir} -out ${tBuild}`);
|
|
123
|
+
await execCLI(c, CLI_TIZEN, `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`);
|
|
124
|
+
logSuccess(`Your WGT package is located in ${chalk().cyan(tOut)} .`);
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
};
|
|
128
|
+
exports.buildTizenProject = buildTizenProject;
|
|
129
|
+
let isGlobalConfigured = false;
|
|
130
|
+
const configureProject = (c) => new Promise((resolve) => {
|
|
131
|
+
logTask('configureProject');
|
|
132
|
+
const platform = constants_1.Platforms.TIZEN;
|
|
133
|
+
const configFile = 'config.xml';
|
|
134
|
+
const p = c.buildConfig.platforms[platform];
|
|
135
|
+
const injects = [
|
|
136
|
+
{ pattern: '{{PACKAGE}}', override: p.package },
|
|
137
|
+
{ pattern: '{{ID}}', override: p.id },
|
|
138
|
+
{ pattern: '{{APP_NAME}}', override: p.appName },
|
|
139
|
+
{ pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) },
|
|
140
|
+
];
|
|
141
|
+
addSystemInjects(c, injects);
|
|
142
|
+
const file = path.join(getPlatformProjectDir(c), configFile);
|
|
143
|
+
writeCleanFile(file, file, injects, null, c);
|
|
144
|
+
resolve();
|
|
145
|
+
});
|
|
146
|
+
const configureTizenProject = async (c) => {
|
|
147
|
+
logTask('configureTizenProject');
|
|
148
|
+
const { platform } = c;
|
|
149
|
+
c.runtime.platformBuildsProjectPath = `${getPlatformProjectDir(c)}`;
|
|
150
|
+
if (!isPlatformActive(c, platform)) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!isGlobalConfigured) {
|
|
154
|
+
isGlobalConfigured = true;
|
|
155
|
+
await configureTizenGlobal(c);
|
|
156
|
+
}
|
|
157
|
+
await copyAssetsFolder(c, platform);
|
|
158
|
+
await configureCoreWebProject(c);
|
|
159
|
+
await configureProject(c);
|
|
160
|
+
copyBuildsFolder(c, platform);
|
|
161
|
+
};
|
|
162
|
+
exports.configureTizenProject = configureTizenProject;
|
|
163
|
+
const handleLinuxKeyring = () => {
|
|
164
|
+
if (process.env.CI && os.platform() === 'linux') {
|
|
165
|
+
const options = { stdio: 'inherit' };
|
|
166
|
+
(0, child_process_1.execSync)('eval $(dbus-launch --sh-syntax)', options);
|
|
167
|
+
(0, child_process_1.execSync)('mkdir -p ~/.cache', options);
|
|
168
|
+
(0, child_process_1.execSync)('mkdir -p ~/.local/share/keyrings', options);
|
|
169
|
+
(0, child_process_1.execSync)('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
|
|
170
|
+
(0, child_process_1.execSync)('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const setTizenCertificate = (c) => {
|
|
174
|
+
const { TIZEN_SECURITY_PROFILE_NAME = '24i-SmartApps-BigScreen', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_author.p12', TIZEN_AUTHOR_CERTIFICATE_PASSWORD, } = process.env;
|
|
175
|
+
const tizenCliPath = c.cli.tizen;
|
|
176
|
+
if (!fs.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
|
|
177
|
+
console.log(`'process.env.TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH' points to not existing location: ${TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH}`);
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if (!TIZEN_AUTHOR_CERTIFICATE_PASSWORD) {
|
|
181
|
+
console.log('\'process.env.TIZEN_AUTHOR_CERTIFICATE_PASSWORD\' password is not set');
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
if (!tizenCliPath) {
|
|
185
|
+
console.log('\'c.cli.tizen\' is not set');
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
const spawnSyncReturn = (0, child_process_1.spawnSync)(tizenCliPath, [
|
|
189
|
+
'security-profiles', 'add',
|
|
190
|
+
'-n', TIZEN_SECURITY_PROFILE_NAME,
|
|
191
|
+
'-a', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH,
|
|
192
|
+
'-p', TIZEN_AUTHOR_CERTIFICATE_PASSWORD,
|
|
193
|
+
]);
|
|
194
|
+
if (spawnSyncReturn.error)
|
|
195
|
+
throw spawnSyncReturn.error;
|
|
196
|
+
if (spawnSyncReturn.stdout.toString().includes('Invalid file or password')) {
|
|
197
|
+
throw new Error(spawnSyncReturn.stdout.toString());
|
|
198
|
+
}
|
|
199
|
+
process.stdout.write(spawnSyncReturn.stdout || '');
|
|
200
|
+
const rnvWorkspaceConfigPath = c.paths.workspace.config;
|
|
201
|
+
const customObjectToMerge = {
|
|
202
|
+
platforms: {
|
|
203
|
+
tizen: { certificateProfile: TIZEN_SECURITY_PROFILE_NAME },
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
updateObjectSync(rnvWorkspaceConfigPath, customObjectToMerge);
|
|
207
|
+
Object.assign(c.buildConfig, customObjectToMerge);
|
|
208
|
+
return true;
|
|
209
|
+
};
|
|
210
|
+
const getSdkInstallerUrl = () => {
|
|
211
|
+
switch (os.platform()) {
|
|
212
|
+
case 'darwin':
|
|
213
|
+
return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_mac.zip';
|
|
214
|
+
case 'linux':
|
|
215
|
+
return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_ubuntu.zip';
|
|
216
|
+
default:
|
|
217
|
+
return '';
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const handleTizenSdk = async (c) => {
|
|
221
|
+
const { TIZEN_SDK_INSTALLER_URL = getSdkInstallerUrl() } = process.env;
|
|
222
|
+
const { TIZEN_SDK } = c.buildConfig.sdks || {};
|
|
223
|
+
const installPath = `${os.homedir()}/tizen-studio`;
|
|
224
|
+
const rnvSdkKey = 'TIZEN_SDK';
|
|
225
|
+
if (!TIZEN_SDK) {
|
|
226
|
+
handleLinuxKeyring();
|
|
227
|
+
if (fs.existsSync(installPath)) {
|
|
228
|
+
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installPath);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
const installedToPath = await (0, sdk_utils_1.sdkInstaller)(TIZEN_SDK_INSTALLER_URL, installPath, true);
|
|
232
|
+
if (installedToPath) {
|
|
233
|
+
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installedToPath);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
await rnv_1.SDKManager.Installer.checkAndConfigureTizenSdks(c);
|
|
238
|
+
setTizenCertificate(c);
|
|
239
|
+
};
|
|
240
|
+
exports.handleTizenSdk = handleTizenSdk;
|
|
@@ -6,130 +6,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
11
|
};
|
|
21
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
|
|
23
|
-
const fs = __importStar(require("fs"));
|
|
24
|
-
const path = __importStar(require("path"));
|
|
25
|
-
const os_1 = require("os");
|
|
26
|
-
const rnv_1 = require("rnv");
|
|
27
|
-
const sdk_utils_1 = require("../sdk-utils");
|
|
28
|
-
const { writeCleanFile } = rnv_1.FileUtils;
|
|
29
|
-
const { execCLI } = rnv_1.Exec;
|
|
30
|
-
const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getConfigProp, checkPortInUse, confirmActiveBundler, } = rnv_1.Common;
|
|
31
|
-
const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
|
|
32
|
-
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
33
|
-
const { chalk, logTask, logInfo, logSuccess, logError } = rnv_1.Logger;
|
|
34
|
-
const { copyBuildsFolder, copyAssetsFolder } = rnv_1.ProjectManager;
|
|
35
|
-
const { CLI_WEBOS_ARES_PACKAGE, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
36
|
-
const { runWebosSimOrDevice } = rnv_1.SDKManager.Webos;
|
|
37
|
-
const runWebOS = async (c) => {
|
|
38
|
-
const { hosted } = c.program;
|
|
39
|
-
const { target } = c.runtime;
|
|
40
|
-
const { platform } = c;
|
|
41
|
-
const isHosted = hosted && !getConfigProp(c, platform, 'bundleAssets');
|
|
42
|
-
if (isHosted) {
|
|
43
|
-
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
44
|
-
if (isPortActive) {
|
|
45
|
-
const resetCompleted = await confirmActiveBundler(c);
|
|
46
|
-
c.runtime.skipActiveServerCheck = !resetCompleted;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
logTask('runWebOS', `target:${target} hosted:${!!isHosted}`);
|
|
50
|
-
if (isHosted)
|
|
51
|
-
return;
|
|
52
|
-
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
53
|
-
if (bundleAssets) {
|
|
54
|
-
await buildCoreWebpackProject(c);
|
|
55
|
-
await runWebosSimOrDevice(c);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
59
|
-
const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
|
|
60
|
-
const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
|
|
61
|
-
if (!isPortActive) {
|
|
62
|
-
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
63
|
-
waitForWebpack(c)
|
|
64
|
-
.then(() => runWebosSimOrDevice(c))
|
|
65
|
-
.catch(logError);
|
|
66
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
const resetCompleted = await confirmActiveBundler(c);
|
|
70
|
-
if (resetCompleted) {
|
|
71
|
-
waitForWebpack(c)
|
|
72
|
-
.then(() => runWebosSimOrDevice(c))
|
|
73
|
-
.catch(logError);
|
|
74
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
await runWebosSimOrDevice(c);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
exports.runWebOS = runWebOS;
|
|
83
|
-
const buildWebOSProject = async (c) => {
|
|
84
|
-
logTask('buildWebOSProject');
|
|
85
|
-
await buildCoreWebpackProject(c);
|
|
86
|
-
if (!c.program.hosted) {
|
|
87
|
-
const tDir = getPlatformProjectDir(c);
|
|
88
|
-
const tOut = path.join(getPlatformBuildDir(c), 'output');
|
|
89
|
-
await execCLI(c, CLI_WEBOS_ARES_PACKAGE, `-o ${tOut} ${tDir} -n`);
|
|
90
|
-
logSuccess(`Your IPK package is located in ${chalk().cyan(tOut)} .`);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports.buildWebOSProject = buildWebOSProject;
|
|
94
|
-
const configureProject = async (c) => {
|
|
95
|
-
logTask('configureProject');
|
|
96
|
-
const configFile = 'appinfo.json';
|
|
97
|
-
const configFileSource = path.join(getTemplateProjectDir(c), configFile);
|
|
98
|
-
const configFileDest = path.join(getPlatformProjectDir(c), configFile);
|
|
99
|
-
writeCleanFile(configFileSource, configFileDest, [], null, c);
|
|
100
|
-
let fileContent = fs.readFileSync(configFileDest).toString();
|
|
101
|
-
fileContent = fileContent.replace(/"true"/g, 'true');
|
|
102
|
-
fileContent = fileContent.replace(/"false"/g, 'false');
|
|
103
|
-
fs.writeFileSync(configFileDest, fileContent);
|
|
104
|
-
return true;
|
|
105
|
-
};
|
|
106
|
-
const configureWebOSProject = async (c) => {
|
|
107
|
-
logTask('configureWebOSProject');
|
|
108
|
-
const { platform } = c;
|
|
109
|
-
c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
|
|
110
|
-
if (!isPlatformActive(c, platform))
|
|
111
|
-
return;
|
|
112
|
-
await copyAssetsFolder(c, platform);
|
|
113
|
-
await configureCoreWebProject(c);
|
|
114
|
-
await configureProject(c);
|
|
115
|
-
await copyBuildsFolder(c, platform);
|
|
116
|
-
};
|
|
117
|
-
exports.configureWebOSProject = configureWebOSProject;
|
|
118
|
-
const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
|
|
119
|
-
const handleWebosSdk = async (c) => {
|
|
120
|
-
const { WEBOS_SDK_INSTALLER_URL = sdkInstallerUUrl } = process.env;
|
|
121
|
-
const { WEBOS_SDK } = c.buildConfig.sdks || {};
|
|
122
|
-
const installPath = `${(0, os_1.homedir)()}/webOS_TV_SDK`;
|
|
123
|
-
const rnvSdkKey = 'WEBOS_SDK';
|
|
124
|
-
if (!WEBOS_SDK) {
|
|
125
|
-
if (fs.existsSync(installPath)) {
|
|
126
|
-
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installPath);
|
|
127
|
-
}
|
|
128
|
-
const sdkInstalledToPath = await (0, sdk_utils_1.sdkInstaller)(WEBOS_SDK_INSTALLER_URL, installPath, true);
|
|
129
|
-
if (sdkInstalledToPath) {
|
|
130
|
-
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
await rnv_1.SDKManager.Installer.checkAndConfigureWebosSdks(c);
|
|
134
|
-
};
|
|
135
|
-
exports.handleWebosSdk = handleWebosSdk;
|
|
13
|
+
__exportStar(require("./sdkWebos"), exports);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.handleWebosSdk = exports.configureWebOSProject = exports.buildWebOSProject = exports.runWebOS = void 0;
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const path = __importStar(require("path"));
|
|
25
|
+
const os_1 = require("os");
|
|
26
|
+
const rnv_1 = require("rnv");
|
|
27
|
+
const sdk_utils_1 = require("../sdk-utils");
|
|
28
|
+
const { writeCleanFile } = rnv_1.FileUtils;
|
|
29
|
+
const { execCLI } = rnv_1.Exec;
|
|
30
|
+
const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getConfigProp, checkPortInUse, confirmActiveBundler, } = rnv_1.Common;
|
|
31
|
+
const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
|
|
32
|
+
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
33
|
+
const { chalk, logTask, logInfo, logSuccess, logError } = rnv_1.Logger;
|
|
34
|
+
const { copyBuildsFolder, copyAssetsFolder } = rnv_1.ProjectManager;
|
|
35
|
+
const { CLI_WEBOS_ARES_PACKAGE, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
36
|
+
const { runWebosSimOrDevice } = rnv_1.SDKManager.Webos;
|
|
37
|
+
const runWebOS = async (c) => {
|
|
38
|
+
const { hosted } = c.program;
|
|
39
|
+
const { target } = c.runtime;
|
|
40
|
+
const { platform } = c;
|
|
41
|
+
const isHosted = hosted && !getConfigProp(c, platform, 'bundleAssets');
|
|
42
|
+
if (isHosted) {
|
|
43
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
44
|
+
if (isPortActive) {
|
|
45
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
46
|
+
c.runtime.skipActiveServerCheck = !resetCompleted;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
logTask('runWebOS', `target:${target} hosted:${!!isHosted}`);
|
|
50
|
+
if (isHosted)
|
|
51
|
+
return;
|
|
52
|
+
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
53
|
+
if (bundleAssets) {
|
|
54
|
+
await buildCoreWebpackProject(c);
|
|
55
|
+
await runWebosSimOrDevice(c);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
|
|
59
|
+
const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
|
|
60
|
+
const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
|
|
61
|
+
if (!isPortActive) {
|
|
62
|
+
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
63
|
+
waitForWebpack(c)
|
|
64
|
+
.then(() => runWebosSimOrDevice(c))
|
|
65
|
+
.catch(logError);
|
|
66
|
+
await runWebpackServer(c, isWeinreEnabled);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const resetCompleted = await confirmActiveBundler(c);
|
|
70
|
+
if (resetCompleted) {
|
|
71
|
+
waitForWebpack(c)
|
|
72
|
+
.then(() => runWebosSimOrDevice(c))
|
|
73
|
+
.catch(logError);
|
|
74
|
+
await runWebpackServer(c, isWeinreEnabled);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
await runWebosSimOrDevice(c);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.runWebOS = runWebOS;
|
|
83
|
+
const buildWebOSProject = async (c) => {
|
|
84
|
+
logTask('buildWebOSProject');
|
|
85
|
+
await buildCoreWebpackProject(c);
|
|
86
|
+
if (!c.program.hosted) {
|
|
87
|
+
const tDir = getPlatformProjectDir(c);
|
|
88
|
+
const tOut = path.join(getPlatformBuildDir(c), 'output');
|
|
89
|
+
await execCLI(c, CLI_WEBOS_ARES_PACKAGE, `-o ${tOut} ${tDir} -n`);
|
|
90
|
+
logSuccess(`Your IPK package is located in ${chalk().cyan(tOut)} .`);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.buildWebOSProject = buildWebOSProject;
|
|
94
|
+
const configureProject = async (c) => {
|
|
95
|
+
logTask('configureProject');
|
|
96
|
+
const configFile = 'appinfo.json';
|
|
97
|
+
const configFileSource = path.join(getTemplateProjectDir(c), configFile);
|
|
98
|
+
const configFileDest = path.join(getPlatformProjectDir(c), configFile);
|
|
99
|
+
writeCleanFile(configFileSource, configFileDest, [], null, c);
|
|
100
|
+
let fileContent = fs.readFileSync(configFileDest).toString();
|
|
101
|
+
fileContent = fileContent.replace(/"true"/g, 'true');
|
|
102
|
+
fileContent = fileContent.replace(/"false"/g, 'false');
|
|
103
|
+
fs.writeFileSync(configFileDest, fileContent);
|
|
104
|
+
return true;
|
|
105
|
+
};
|
|
106
|
+
const configureWebOSProject = async (c) => {
|
|
107
|
+
logTask('configureWebOSProject');
|
|
108
|
+
const { platform } = c;
|
|
109
|
+
c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
|
|
110
|
+
if (!isPlatformActive(c, platform))
|
|
111
|
+
return;
|
|
112
|
+
await copyAssetsFolder(c, platform);
|
|
113
|
+
await configureCoreWebProject(c);
|
|
114
|
+
await configureProject(c);
|
|
115
|
+
await copyBuildsFolder(c, platform);
|
|
116
|
+
};
|
|
117
|
+
exports.configureWebOSProject = configureWebOSProject;
|
|
118
|
+
const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
|
|
119
|
+
const handleWebosSdk = async (c) => {
|
|
120
|
+
const { WEBOS_SDK_INSTALLER_URL = sdkInstallerUUrl } = process.env;
|
|
121
|
+
const { WEBOS_SDK } = c.buildConfig.sdks || {};
|
|
122
|
+
const installPath = `${(0, os_1.homedir)()}/webOS_TV_SDK`;
|
|
123
|
+
const rnvSdkKey = 'WEBOS_SDK';
|
|
124
|
+
if (!WEBOS_SDK) {
|
|
125
|
+
if (fs.existsSync(installPath)) {
|
|
126
|
+
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installPath);
|
|
127
|
+
}
|
|
128
|
+
const sdkInstalledToPath = await (0, sdk_utils_1.sdkInstaller)(WEBOS_SDK_INSTALLER_URL, installPath, true);
|
|
129
|
+
if (sdkInstalledToPath) {
|
|
130
|
+
await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
await rnv_1.SDKManager.Installer.checkAndConfigureWebosSdks(c);
|
|
134
|
+
};
|
|
135
|
+
exports.handleWebosSdk = handleWebosSdk;
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.buildWeb = buildWeb;
|
|
12
|
-
const configureWebProject = async (c) => {
|
|
13
|
-
logTask('configureWebProject');
|
|
14
|
-
const { platform } = c;
|
|
15
|
-
c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
|
|
16
|
-
if (!isPlatformActive(c, platform))
|
|
17
|
-
return;
|
|
18
|
-
await copyAssetsFolder(c, platform);
|
|
19
|
-
await configureCoreWebProject(c);
|
|
20
|
-
copyBuildsFolder(c, platform);
|
|
21
|
-
};
|
|
22
|
-
exports.configureWebProject = configureWebProject;
|
|
23
|
-
const deployWeb = () => {
|
|
24
|
-
logTask('deployWeb');
|
|
25
|
-
return true;
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
11
|
};
|
|
27
|
-
exports
|
|
28
|
-
|
|
29
|
-
logTask('exportWeb');
|
|
30
|
-
return true;
|
|
31
|
-
};
|
|
32
|
-
exports.exportWeb = exportWeb;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./sdkWebpack"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportWeb = exports.deployWeb = exports.configureWebProject = exports.buildWeb = void 0;
|
|
4
|
+
const rnv_1 = require("rnv");
|
|
5
|
+
const { getPlatformProjectDir } = rnv_1.Common;
|
|
6
|
+
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
7
|
+
const { logTask } = rnv_1.Logger;
|
|
8
|
+
const { copyBuildsFolder, copyAssetsFolder } = rnv_1.ProjectManager;
|
|
9
|
+
const { buildCoreWebpackProject, configureCoreWebProject } = rnv_1.WebpackUtils;
|
|
10
|
+
const buildWeb = async (c) => buildCoreWebpackProject(c);
|
|
11
|
+
exports.buildWeb = buildWeb;
|
|
12
|
+
const configureWebProject = async (c) => {
|
|
13
|
+
logTask('configureWebProject');
|
|
14
|
+
const { platform } = c;
|
|
15
|
+
c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
|
|
16
|
+
if (!isPlatformActive(c, platform))
|
|
17
|
+
return;
|
|
18
|
+
await copyAssetsFolder(c, platform);
|
|
19
|
+
await configureCoreWebProject(c);
|
|
20
|
+
copyBuildsFolder(c, platform);
|
|
21
|
+
};
|
|
22
|
+
exports.configureWebProject = configureWebProject;
|
|
23
|
+
const deployWeb = () => {
|
|
24
|
+
logTask('deployWeb');
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
exports.deployWeb = deployWeb;
|
|
28
|
+
const exportWeb = () => {
|
|
29
|
+
logTask('exportWeb');
|
|
30
|
+
return true;
|
|
31
|
+
};
|
|
32
|
+
exports.exportWeb = exportWeb;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.customRnvConfigureTask = void 0;
|
|
4
4
|
const rnv_1 = require("rnv");
|
|
5
|
-
const
|
|
5
|
+
const generateSvgSpriteMap_1 = require("../utils/generateSvgSpriteMap");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const sdks_1 = require("../sdks");
|
|
8
8
|
const { logErrorPlatform, copySharedPlatforms } = rnv_1.PlatformManager;
|
|
@@ -16,13 +16,7 @@ const configureFn = async (c, parentTask, originTask) => {
|
|
|
16
16
|
logTask('taskRnvConfigure');
|
|
17
17
|
await executeTask(c, TASK_PLATFORM_CONFIGURE, TASK_CONFIGURE, originTask);
|
|
18
18
|
await copySharedPlatforms(c);
|
|
19
|
-
|
|
20
|
-
iconsFolder: '/icons',
|
|
21
|
-
cssOutput: '../../platformAssets/runtime/icons.css',
|
|
22
|
-
jsonOutput: '/icons.json',
|
|
23
|
-
maskList: c.buildConfig.common.svgIconsMaskList || [],
|
|
24
|
-
});
|
|
25
|
-
await generateSvgSpriteMapHook(c);
|
|
19
|
+
(0, generateSvgSpriteMap_1.generateSvgSpriteMap)(c);
|
|
26
20
|
if (c.program.only && !!parentTask)
|
|
27
21
|
return true;
|
|
28
22
|
switch (c.platform) {
|