@24i/smartapps-bigscreen-rnv-build-engine 0.17.6-alpha.19 → 0.17.6-alpha.2
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/README.md +12 -16
- package/dist/src/constants/delopyLivePlatforms.js +1 -2
- package/dist/src/constants/platforms.js +0 -2
- package/dist/src/engine.js +0 -10
- package/dist/src/resolvers/index.js +1 -8
- package/dist/src/resolvers/resolveBaseUrl.js +25 -16
- package/dist/src/resolvers/resolveDeployLocations.js +6 -3
- package/dist/src/resolvers/resolveGenericRnvConfig.js +2 -9
- package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +1 -25
- package/dist/src/scripts/deployLiveAll.js +2 -2
- package/dist/src/scripts/deployLivePlatform.js +5 -9
- package/dist/src/scripts/release/{appCenter/deployToAppCenter.js → deployToAppCenter.js} +17 -6
- package/dist/src/scripts/release/notifySlack/notifySlack.js +8 -11
- package/dist/src/scripts/release/sentryRelease.js +5 -11
- package/dist/src/scripts/release/urlsMarkdown.js +0 -2
- package/dist/src/scripts/releaseAllWithScheme.js +4 -4
- package/dist/src/sdks/index.js +0 -1
- package/dist/src/sdks/sdk-androidtv/sdkAndroidtv.js +13 -35
- package/dist/src/sdks/sdk-tizen/sdkTizen.js +0 -2
- package/dist/src/sdks/sdk-webos/sdkWebos.js +0 -2
- package/dist/src/sdks/sdk-webpack/sdkWebpack.js +1 -10
- package/dist/src/tasks/deploy/aswS3/deployS3.js +11 -9
- package/dist/src/tasks/deploy/aswS3/distToLiveS3.js +5 -4
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +1 -7
- package/dist/src/tasks/task.rnv.build.js +7 -26
- package/dist/src/tasks/task.rnv.configure.js +0 -2
- package/dist/src/tasks/task.rnv.deploy.js +1 -12
- package/dist/src/tasks/task.rnv.platform.configure.js +1 -33
- package/dist/src/tasks/task.rnv.start.js +0 -2
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +7 -24
- package/dist/src/utils/zipBuildsByPlatforms.js +5 -8
- package/dist/templates/platforms/_shared/webpack.base.js +2 -2
- package/dist/templates/platforms/androidtv/project/amazoniap/build.gradle +2 -2
- package/dist/templates/platforms/androidtv/project/app/build.gradle +21 -17
- package/dist/templates/platforms/androidtv/project/app/proguard-rules.pro +0 -15
- package/dist/templates/platforms/androidtv/project/app/src/bigscreenAppstage/res/raw/configuration.json +2 -1
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeFromJavaScript.kt +58 -4
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeToJavaScript.kt +0 -15
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/configuration/BridgeConfig.kt +1 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/di/ActivityModule.kt +3 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/di/ApplicationModule.kt +2 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/di/PerActivity.kt +0 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryExoPlayerCustomized.kt +1 -7
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/SourceDrmOverridden.kt +0 -42
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/jump/JumpAnalytics.kt +211 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +0 -3
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/parser/ContentModelParser.kt +16 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/parser/DeviceInfoParser.kt +22 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/Mainview.kt +3 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/PlayerCache.kt +2 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/WebViewActivity.kt +83 -24
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +111 -48
- package/dist/templates/platforms/androidtv/project/app/src/main/res/layout/activity_web_view.xml +71 -23
- package/dist/templates/platforms/androidtv/project/common/build.gradle +2 -2
- package/dist/templates/platforms/androidtv/project/googleiap/build.gradle +2 -2
- package/package.json +1 -3
- package/renative.engine.json +0 -2
- package/dist/src/constants/buildProductionPackages.js +0 -10
- package/dist/src/resolvers/resolveProductionZipFileRelativePath.js +0 -35
- package/dist/src/resolvers/resolveS3BucketAppPath.js +0 -15
- package/dist/src/resolvers/resolveSupportedFlavoursForPlatform.js +0 -8
- package/dist/src/resolvers/shared/constructFullUrl.js +0 -25
- package/dist/src/scripts/buildAllWithSchemes.js +0 -88
- package/dist/src/scripts/buildProductionPackagesAll.js +0 -75
- package/dist/src/scripts/release/appCenter/appCenter.js +0 -17
- package/dist/src/scripts/release/appCenter/deployProductionPackagesToAppCenter.js +0 -127
- package/dist/src/scripts/releaseAllWithSchemes.js +0 -158
- package/dist/src/scripts/releaseProductionPackagesAll.js +0 -13
- package/dist/src/utils/copyTheoPlayerLibs.js +0 -48
- package/dist/src/utils/getSafeSchemeString.js +0 -7
- package/dist/src/utils/zipStagingProdBuildsByPlatforms.js +0 -114
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryConfigured.kt +0 -33
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryTheoPlayerCustomized.kt +0 -14
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryVersion.kt +0 -27
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/parser/SourceParser.kt +0 -89
package/renative.engine.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
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.FIRETV,
|
|
8
|
-
platforms_1.Platforms.TIZEN,
|
|
9
|
-
platforms_1.Platforms.WEBOS,
|
|
10
|
-
];
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getProductionZipFileRelativePath = void 0;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
|
-
const getProductionZipFileRelativePath = (c) => {
|
|
29
|
-
const { appNameInFileName } = c.buildConfig.common;
|
|
30
|
-
const { platformBuildsDir } = c.buildConfig.paths;
|
|
31
|
-
const platformBuildsDirPath = path.join(platformBuildsDir);
|
|
32
|
-
const zipFileName = `${appNameInFileName}.production_packages.zip`;
|
|
33
|
-
return path.join(platformBuildsDirPath, zipFileName);
|
|
34
|
-
};
|
|
35
|
-
exports.getProductionZipFileRelativePath = getProductionZipFileRelativePath;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveS3BucketAppPath = void 0;
|
|
4
|
-
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
|
-
const constructFullUrl_1 = require("./shared/constructFullUrl");
|
|
6
|
-
const resolveS3BucketAppPath = ({ platform, scheme, flavour }) => {
|
|
7
|
-
const c = (0, resolveGenericRnvConfig_1.getBaseConfig)();
|
|
8
|
-
c.platform = platform;
|
|
9
|
-
c.runtime.scheme = scheme;
|
|
10
|
-
c.runtime.appId = flavour;
|
|
11
|
-
const bucketName = c.buildConfig?.common.deploy?.aws3?.bucketName || '';
|
|
12
|
-
const appFolderUrl = `${bucketName}/builds/${platform}/${flavour}`;
|
|
13
|
-
return (0, constructFullUrl_1.constructFullUrl)({ baseUrl: appFolderUrl, scheme, c });
|
|
14
|
-
};
|
|
15
|
-
exports.resolveS3BucketAppPath = resolveS3BucketAppPath;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveSupportedFlavoursForPlatform = void 0;
|
|
4
|
-
const resolveSupportedFlavoursForPlatform = (c, platformName) => {
|
|
5
|
-
const { supportedFlavours = [] } = c.buildConfig.platforms[platformName]?.deploy || {};
|
|
6
|
-
return supportedFlavours;
|
|
7
|
-
};
|
|
8
|
-
exports.resolveSupportedFlavoursForPlatform = resolveSupportedFlavoursForPlatform;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constructFullUrl = void 0;
|
|
4
|
-
const resolveBuildEnvName_1 = require("../resolveBuildEnvName");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
6
|
-
const constructFullUrl = ({ baseUrl, scheme, c }) => {
|
|
7
|
-
const { packageVersion } = c.buildConfig?.common;
|
|
8
|
-
const envName = (0, resolveBuildEnvName_1.resolveBuildEnvName)(scheme);
|
|
9
|
-
switch (scheme) {
|
|
10
|
-
case constants_1.BuildSchemes.DEV_LATEST:
|
|
11
|
-
return `${baseUrl}/latest/dev`;
|
|
12
|
-
case constants_1.BuildSchemes.RC_STAGING_LATEST:
|
|
13
|
-
case constants_1.BuildSchemes.RC_PROD_LATEST:
|
|
14
|
-
return `${baseUrl}/latest/rc/${envName}`;
|
|
15
|
-
case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
|
|
16
|
-
case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
|
|
17
|
-
return `${baseUrl}/latest/release/${envName}`;
|
|
18
|
-
case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
|
|
19
|
-
case constants_1.BuildSchemes.RELEASE_PROD_DIST:
|
|
20
|
-
return `${baseUrl}/dist/v${packageVersion}/${envName}`;
|
|
21
|
-
default:
|
|
22
|
-
return '';
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
exports.constructFullUrl = constructFullUrl;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const child_process_1 = require("child_process");
|
|
27
|
-
const fs = __importStar(require("fs"));
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const fse = __importStar(require("fs-extra"));
|
|
30
|
-
const getSafeSchemeString_1 = require("../utils/getSafeSchemeString");
|
|
31
|
-
const resolvers_1 = require("../resolvers");
|
|
32
|
-
const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, flavours, flavourIndex, }) => {
|
|
33
|
-
let string = `\nProcessing`;
|
|
34
|
-
string += ` "${platforms[platformIndex]}" platform`;
|
|
35
|
-
string += ` (${platformIndex + 1}/${platforms.length}),`;
|
|
36
|
-
string += ` "${schemes[schemeIndex]}" scheme"`;
|
|
37
|
-
string += ` (${schemeIndex + 1}/${schemes.length}),`;
|
|
38
|
-
string += ` and its "${flavours[flavourIndex]}" flavour`;
|
|
39
|
-
string += ` (${flavourIndex + 1}/${flavours.length})...`;
|
|
40
|
-
return string;
|
|
41
|
-
};
|
|
42
|
-
const buildTask = (options, c) => {
|
|
43
|
-
const { scheme, platform, flavour } = options;
|
|
44
|
-
const { platformBuildsDir } = c.buildConfig.paths;
|
|
45
|
-
const buildDirName = `${flavour}_${platform}`;
|
|
46
|
-
const publicBuildDirName = `${flavour}_${platform}-public`;
|
|
47
|
-
const buildDirPath = path.join(platformBuildsDir, buildDirName);
|
|
48
|
-
const publicBuildDirPath = path.join(platformBuildsDir, publicBuildDirName);
|
|
49
|
-
;
|
|
50
|
-
fs.rmSync(buildDirPath, { recursive: true, force: true });
|
|
51
|
-
fs.rmSync(publicBuildDirPath, { recursive: true, force: true });
|
|
52
|
-
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
|
|
53
|
-
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
54
|
-
const safeSchemeString = (0, getSafeSchemeString_1.getSafeSchemeString)(scheme);
|
|
55
|
-
const schemeBuildDir = path.join(platformBuildsDir, safeSchemeString, buildDirName);
|
|
56
|
-
const schemePublicBuildDir = path.join(platformBuildsDir, safeSchemeString, publicBuildDirName);
|
|
57
|
-
fse.copySync(buildDirPath, schemeBuildDir);
|
|
58
|
-
if (fs.existsSync(publicBuildDirPath)) {
|
|
59
|
-
fse.copySync(publicBuildDirPath, schemePublicBuildDir);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const buildAllWithSchemes = () => {
|
|
63
|
-
const schemes = process.argv.slice(2);
|
|
64
|
-
if (!schemes.length) {
|
|
65
|
-
throw new Error('No scheme name to use found! Please use rnv scheme names as a param.');
|
|
66
|
-
}
|
|
67
|
-
const c = (0, resolvers_1.getBaseConfig)();
|
|
68
|
-
const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
69
|
-
supportedPlatforms.forEach((platform, platformIndex, platforms) => {
|
|
70
|
-
schemes.forEach((scheme, schemeIndex, schemes) => {
|
|
71
|
-
c.runtime.scheme = scheme;
|
|
72
|
-
const supportedFlavours = (0, resolvers_1.resolveSupportedFlavoursForPlatform)(c, platform);
|
|
73
|
-
supportedFlavours.forEach((flavour, flavourIndex, flavours) => {
|
|
74
|
-
const msg = getProgressMessage({
|
|
75
|
-
platforms, platformIndex, schemes, schemeIndex, flavours, flavourIndex,
|
|
76
|
-
});
|
|
77
|
-
console.log(msg);
|
|
78
|
-
buildTask({ scheme, platform, flavour }, c);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
return true;
|
|
83
|
-
};
|
|
84
|
-
const startTimestamp = Date.now();
|
|
85
|
-
buildAllWithSchemes();
|
|
86
|
-
const msPerSecond = 1000;
|
|
87
|
-
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
88
|
-
console.log(`buildAllWithSchemes: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const child_process_1 = require("child_process");
|
|
27
|
-
const fs = __importStar(require("fs"));
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const fse = __importStar(require("fs-extra"));
|
|
30
|
-
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
31
|
-
const constants_1 = require("../constants");
|
|
32
|
-
const buildProductionPackages_1 = require("../constants/buildProductionPackages");
|
|
33
|
-
const resolvers_1 = require("../resolvers");
|
|
34
|
-
const getZippedDirRelativePath = (c) => {
|
|
35
|
-
const { platformBuildsDir } = c.buildConfig.paths;
|
|
36
|
-
return path.join(platformBuildsDir, 'zipped_production_packages');
|
|
37
|
-
};
|
|
38
|
-
const buildProductionTask = (options, c) => {
|
|
39
|
-
const { scheme, platform, flavour } = options;
|
|
40
|
-
const { platformBuildsDir } = c.buildConfig.paths;
|
|
41
|
-
const buildDirName = `${flavour}_${platform}`;
|
|
42
|
-
const buildDirPath = path.join(platformBuildsDir, buildDirName);
|
|
43
|
-
const buildOutputDirPath = path.join(buildDirPath, 'output');
|
|
44
|
-
fs.rmSync(buildDirPath, { recursive: true, force: true });
|
|
45
|
-
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci --productionPackagesHostedUrl`;
|
|
46
|
-
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
47
|
-
const zippedDir = path.join(getZippedDirRelativePath(c), platform);
|
|
48
|
-
fse.copySync(buildOutputDirPath, zippedDir);
|
|
49
|
-
};
|
|
50
|
-
const buildProductionPackagesAll = () => {
|
|
51
|
-
console.log('buildProductionPackagesAll');
|
|
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
|
-
}
|
|
59
|
-
const c = (0, resolvers_1.getBaseConfig)();
|
|
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 });
|
|
67
|
-
(0, child_process_1.execSync)(`zip -r ${zipFilePath} *`, { cwd: `${zippedDirPath}` });
|
|
68
|
-
fs.rmSync(zippedDirPath, { recursive: true, force: true });
|
|
69
|
-
return true;
|
|
70
|
-
};
|
|
71
|
-
const startTimestamp = Date.now();
|
|
72
|
-
buildProductionPackagesAll();
|
|
73
|
-
const msPerSecond = 1000;
|
|
74
|
-
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
75
|
-
console.log(`buildProductionPackagesAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appCenterRelease = void 0;
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
5
|
-
const appCenterRelease = (params) => {
|
|
6
|
-
const { filePath, releaseNotesPath, buildVersion, token, projectName } = params;
|
|
7
|
-
const app = `24i-Media/${projectName}`;
|
|
8
|
-
(0, child_process_1.execSync)('appcenter distribute release '
|
|
9
|
-
+ `--file "${filePath}" `
|
|
10
|
-
+ `--release-notes-file "${releaseNotesPath}" `
|
|
11
|
-
+ `--build-version "${buildVersion}" `
|
|
12
|
-
+ `--app "${app}" `
|
|
13
|
-
+ `--token "${token}" `
|
|
14
|
-
+ '--group "Collaborators" '
|
|
15
|
-
+ '--disable-telemetry', { stdio: 'inherit' });
|
|
16
|
-
};
|
|
17
|
-
exports.appCenterRelease = appCenterRelease;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deployProductionPackagesToAppCenter = void 0;
|
|
27
|
-
const child_process_1 = require("child_process");
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const fs = __importStar(require("fs"));
|
|
30
|
-
const constants_1 = require("../../../constants");
|
|
31
|
-
const buildProductionPackages_1 = require("../../../constants/buildProductionPackages");
|
|
32
|
-
const resolvers_1 = require("../../../resolvers");
|
|
33
|
-
const appCenter_1 = require("./appCenter");
|
|
34
|
-
const ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES = 'APPCENTER_TOKEN_PRODUCTION_PACKAGES';
|
|
35
|
-
const newLine = '\r\n';
|
|
36
|
-
const formatDateTime = (date) => {
|
|
37
|
-
const year = date.getFullYear();
|
|
38
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
39
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
40
|
-
const h = String(date.getHours()).padStart(2, '0');
|
|
41
|
-
const m = String(date.getMinutes()).padStart(2, '0');
|
|
42
|
-
const s = String(date.getSeconds()).padStart(2, '0');
|
|
43
|
-
return `${year}-${month}-${day}T${h}-${m}-${s}`;
|
|
44
|
-
};
|
|
45
|
-
const getAppCenterConfig = (c) => {
|
|
46
|
-
try {
|
|
47
|
-
return c.buildConfig.common.deploy?.productionPackages?.appCenter || null;
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const getPlatformPackagesList = (c) => {
|
|
54
|
-
const scheme = constants_1.BuildSchemes.RELEASE_PROD_DIST;
|
|
55
|
-
const packagesList = [];
|
|
56
|
-
const platforms = (0, resolvers_1.resolveSupportedPlatforms)(c)
|
|
57
|
-
.filter((platform) => buildProductionPackages_1.SUPPORTED_PACKAGE_PLATFORMS.includes(platform));
|
|
58
|
-
platforms.forEach((platform) => {
|
|
59
|
-
const supportedFlavours = (0, resolvers_1.resolveSupportedFlavoursForPlatform)(c, platform);
|
|
60
|
-
const platformObj = {
|
|
61
|
-
platformName: platform,
|
|
62
|
-
packages: supportedFlavours.map((appConfigID) => {
|
|
63
|
-
const c = (0, resolvers_1.getBaseConfig)({
|
|
64
|
-
platform, scheme, appConfigID, productionPackagesHostedUrl: true
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
name: (0, resolvers_1.resolveBuildFileName)(c),
|
|
68
|
-
flavour: appConfigID,
|
|
69
|
-
hostedUrl: `${(0, resolvers_1.resolveProductionPackagesBaseUrl)(c)}/public`,
|
|
70
|
-
};
|
|
71
|
-
})
|
|
72
|
-
};
|
|
73
|
-
packagesList.push(platformObj);
|
|
74
|
-
});
|
|
75
|
-
return packagesList;
|
|
76
|
-
};
|
|
77
|
-
const getAppCenterToken = () => {
|
|
78
|
-
return process.env[ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES] || '';
|
|
79
|
-
};
|
|
80
|
-
const deployProductionPackagesToAppCenter = (c) => {
|
|
81
|
-
console.log('deployProductionPackagesToAppCenter');
|
|
82
|
-
const appCenterConfig = getAppCenterConfig(c);
|
|
83
|
-
if (!appCenterConfig) {
|
|
84
|
-
throw new Error('Not found App Center Config (for production packages) in build config');
|
|
85
|
-
}
|
|
86
|
-
const { appName: centerAppName } = appCenterConfig;
|
|
87
|
-
const token = getAppCenterToken();
|
|
88
|
-
const { appName } = c.buildConfig.common;
|
|
89
|
-
if (!centerAppName)
|
|
90
|
-
throw new Error('Missing AppName in appCenterConfig');
|
|
91
|
-
if (!token)
|
|
92
|
-
throw new Error(`Missing App Center Token. To fix it, set "${ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES}" env variable`);
|
|
93
|
-
const originalZipPath = (0, resolvers_1.getProductionZipFileRelativePath)(c);
|
|
94
|
-
const { dir, name } = path.parse(originalZipPath);
|
|
95
|
-
const zipPath = path.join(dir, `${name}_${formatDateTime(new Date())}.zip`);
|
|
96
|
-
fs.renameSync(originalZipPath, zipPath);
|
|
97
|
-
const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_PRODUCTION_PACKAGES.md`;
|
|
98
|
-
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
99
|
-
fs.unlinkSync(tempReleaseNotesPath);
|
|
100
|
-
}
|
|
101
|
-
const packagesList = getPlatformPackagesList(c);
|
|
102
|
-
const notes = [
|
|
103
|
-
`# ${appName} Production Packages`,
|
|
104
|
-
'',
|
|
105
|
-
'## List of Production Packages',
|
|
106
|
-
...packagesList.reduce((acc, { platformName, packages }) => ([
|
|
107
|
-
...acc,
|
|
108
|
-
`- ${platformName}`,
|
|
109
|
-
...packages.reduce((accPackages, { name, hostedUrl }) => ([
|
|
110
|
-
...accPackages,
|
|
111
|
-
` - ${name}`,
|
|
112
|
-
` - App URL: ${hostedUrl}`
|
|
113
|
-
]), []),
|
|
114
|
-
]), []),
|
|
115
|
-
];
|
|
116
|
-
const packagesMarkdown = notes.join(newLine);
|
|
117
|
-
(0, child_process_1.execSync)(`echo "${packagesMarkdown}" >> ${tempReleaseNotesPath}`);
|
|
118
|
-
console.log(`Deploying Production packages to AppCenter.ms...`);
|
|
119
|
-
(0, appCenter_1.appCenterRelease)({
|
|
120
|
-
projectName: centerAppName,
|
|
121
|
-
buildVersion: '0',
|
|
122
|
-
filePath: zipPath,
|
|
123
|
-
releaseNotesPath: tempReleaseNotesPath,
|
|
124
|
-
token,
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
exports.deployProductionPackagesToAppCenter = deployProductionPackagesToAppCenter;
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const child_process_1 = require("child_process");
|
|
4
|
-
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
5
|
-
const resolvers_1 = require("../resolvers");
|
|
6
|
-
const zipStagingProdBuildsByPlatforms_1 = require("../utils/zipStagingProdBuildsByPlatforms");
|
|
7
|
-
const deleteSourceMaps_1 = require("./release/deleteSourceMaps");
|
|
8
|
-
const deployToAppCenter_1 = require("./release/appCenter/deployToAppCenter");
|
|
9
|
-
const githubRelease_1 = require("./release/githubRelease");
|
|
10
|
-
const notifySlack_1 = require("./release/notifySlack/notifySlack");
|
|
11
|
-
const sentryRelease_1 = require("./release/sentryRelease");
|
|
12
|
-
const constants_1 = require("../constants");
|
|
13
|
-
const deployTask = (options) => {
|
|
14
|
-
const { scheme, platform, flavour } = options;
|
|
15
|
-
const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only --schemeFolder`;
|
|
16
|
-
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
17
|
-
};
|
|
18
|
-
const deployBuilds = (c) => {
|
|
19
|
-
console.log('Deploying the builds...');
|
|
20
|
-
(0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, deployTask);
|
|
21
|
-
return true;
|
|
22
|
-
};
|
|
23
|
-
const doLatestDevelopmentRelease = (c, scheme) => {
|
|
24
|
-
console.log('doLatestDevelopmentRelease');
|
|
25
|
-
c.runtime.scheme = scheme.type;
|
|
26
|
-
return deployBuilds(c);
|
|
27
|
-
};
|
|
28
|
-
const doLatestReleaseCandidateRelease = (c, schemes) => {
|
|
29
|
-
console.log('doLatestReleaseCandidateRelease', schemes);
|
|
30
|
-
const [stagingScheme, prodScheme] = schemes;
|
|
31
|
-
if (stagingScheme) {
|
|
32
|
-
c.runtime.scheme = stagingScheme.type;
|
|
33
|
-
deployBuilds(c);
|
|
34
|
-
}
|
|
35
|
-
if (prodScheme) {
|
|
36
|
-
c.runtime.scheme = prodScheme.type;
|
|
37
|
-
deployBuilds(c);
|
|
38
|
-
}
|
|
39
|
-
const schemeArr = schemes.map((scheme) => scheme?.type).filter(Boolean);
|
|
40
|
-
(0, notifySlack_1.notifySlack)(c, schemeArr);
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
43
|
-
const doLatestRelease = (c, schemes) => {
|
|
44
|
-
console.log('doLatestRelease', schemes);
|
|
45
|
-
const [stagingScheme, prodScheme] = schemes;
|
|
46
|
-
if (stagingScheme) {
|
|
47
|
-
c.runtime.scheme = stagingScheme.type;
|
|
48
|
-
deployBuilds(c);
|
|
49
|
-
}
|
|
50
|
-
if (prodScheme) {
|
|
51
|
-
c.runtime.scheme = prodScheme.type;
|
|
52
|
-
deployBuilds(c);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const doDistributionRelease = (c, schemes) => {
|
|
56
|
-
console.log('doDistributionRelease', schemes);
|
|
57
|
-
const [stagingScheme, prodScheme] = schemes;
|
|
58
|
-
if (stagingScheme) {
|
|
59
|
-
c.runtime.scheme = stagingScheme.type;
|
|
60
|
-
deployBuilds(c);
|
|
61
|
-
}
|
|
62
|
-
if (prodScheme) {
|
|
63
|
-
c.runtime.scheme = prodScheme.type;
|
|
64
|
-
(0, zipStagingProdBuildsByPlatforms_1.zipStagingProdBuildsByPlatforms)(c, [stagingScheme?.type, prodScheme.type]);
|
|
65
|
-
deployBuilds(c);
|
|
66
|
-
(0, sentryRelease_1.sentryRelease)(c);
|
|
67
|
-
(0, deleteSourceMaps_1.deleteSourceMaps)(c);
|
|
68
|
-
(0, githubRelease_1.githubRelease)(c);
|
|
69
|
-
(0, deployToAppCenter_1.deployToAppCenter)(c);
|
|
70
|
-
}
|
|
71
|
-
const schemeArr = schemes.map((scheme) => scheme?.type).filter(Boolean);
|
|
72
|
-
(0, notifySlack_1.notifySlack)(c, schemeArr);
|
|
73
|
-
};
|
|
74
|
-
const releaseAllWithSchemes = () => {
|
|
75
|
-
const schemes = process.argv.slice(2);
|
|
76
|
-
if (!schemes.length) {
|
|
77
|
-
throw new Error('No scheme name to use found! Please use rnv scheme names as a param.');
|
|
78
|
-
}
|
|
79
|
-
const c = (0, resolvers_1.getBaseConfig)();
|
|
80
|
-
const schemesArr = schemes.map((scheme) => ({ type: scheme, processed: false }));
|
|
81
|
-
schemesArr.forEach((schemeObj) => {
|
|
82
|
-
if (schemeObj.processed)
|
|
83
|
-
return;
|
|
84
|
-
switch (schemeObj.type) {
|
|
85
|
-
case constants_1.BuildSchemes.DEV_LATEST:
|
|
86
|
-
doLatestDevelopmentRelease(c, schemeObj);
|
|
87
|
-
schemeObj.processed = true;
|
|
88
|
-
break;
|
|
89
|
-
case constants_1.BuildSchemes.RC_STAGING_LATEST:
|
|
90
|
-
case constants_1.BuildSchemes.RC_PROD_LATEST:
|
|
91
|
-
{
|
|
92
|
-
const [staging, prod] = findSchemes(schemesArr, [
|
|
93
|
-
constants_1.BuildSchemes.RC_STAGING_LATEST,
|
|
94
|
-
constants_1.BuildSchemes.RC_PROD_LATEST,
|
|
95
|
-
]);
|
|
96
|
-
doLatestReleaseCandidateRelease(c, [staging, prod]);
|
|
97
|
-
if (staging) {
|
|
98
|
-
staging.processed = true;
|
|
99
|
-
}
|
|
100
|
-
if (prod) {
|
|
101
|
-
prod.processed = true;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
|
|
106
|
-
case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
|
|
107
|
-
{
|
|
108
|
-
const [staging, prod] = findSchemes(schemesArr, [
|
|
109
|
-
constants_1.BuildSchemes.RELEASE_STAGING_LATEST,
|
|
110
|
-
constants_1.BuildSchemes.RELEASE_PROD_LATEST,
|
|
111
|
-
]);
|
|
112
|
-
doLatestRelease(c, [staging, prod]);
|
|
113
|
-
if (staging) {
|
|
114
|
-
staging.processed = true;
|
|
115
|
-
}
|
|
116
|
-
if (prod) {
|
|
117
|
-
prod.processed = true;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
|
|
122
|
-
case constants_1.BuildSchemes.RELEASE_PROD_DIST:
|
|
123
|
-
{
|
|
124
|
-
const [staging, prod] = findSchemes(schemesArr, [
|
|
125
|
-
constants_1.BuildSchemes.RELEASE_STAGING_DIST,
|
|
126
|
-
constants_1.BuildSchemes.RELEASE_PROD_DIST,
|
|
127
|
-
]);
|
|
128
|
-
doDistributionRelease(c, [staging, prod]);
|
|
129
|
-
if (staging) {
|
|
130
|
-
staging.processed = true;
|
|
131
|
-
}
|
|
132
|
-
if (prod) {
|
|
133
|
-
prod.processed = true;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
break;
|
|
137
|
-
default:
|
|
138
|
-
throw new Error('Unsupported scheme to release!');
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
const deployLocations = schemesArr.reduce((acc, scheme) => {
|
|
142
|
-
const schemeType = scheme.type;
|
|
143
|
-
c.runtime.scheme = schemeType;
|
|
144
|
-
acc[schemeType] = (0, resolvers_1.resolveDeployLocations)(c);
|
|
145
|
-
return acc;
|
|
146
|
-
}, {});
|
|
147
|
-
const spacing = 2;
|
|
148
|
-
console.log(JSON.stringify(deployLocations, null, spacing));
|
|
149
|
-
return true;
|
|
150
|
-
};
|
|
151
|
-
const findSchemes = (schemesArray, schemesToFind) => {
|
|
152
|
-
return schemesToFind.map((schemeToFind) => (schemesArray.find((schemeObj) => schemeObj.type === schemeToFind)));
|
|
153
|
-
};
|
|
154
|
-
const startTimestamp = Date.now();
|
|
155
|
-
releaseAllWithSchemes();
|
|
156
|
-
const msPerSecond = 1000;
|
|
157
|
-
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
158
|
-
console.log(`releaseAllWithSchemes: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,13 +0,0 @@
|
|
|
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)!`);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.copyTheoPlayerLibs = void 0;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
|
-
const fs = __importStar(require("fs"));
|
|
29
|
-
const fse = __importStar(require("fs-extra"));
|
|
30
|
-
const rnv_1 = require("rnv");
|
|
31
|
-
const copyTheoPlayerLibs = (c) => {
|
|
32
|
-
const theoplayerPackageDir = path.join(process.cwd(), 'node_modules', 'theoplayer');
|
|
33
|
-
if (!fs.existsSync(theoplayerPackageDir)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const filesToCopy = [
|
|
37
|
-
'THEOplayer.transmux.asmjs.js',
|
|
38
|
-
'THEOplayer.transmux.js',
|
|
39
|
-
'THEOplayer.transmux.wasm',
|
|
40
|
-
'iframe.html'
|
|
41
|
-
].map((fileName) => path.join(theoplayerPackageDir, fileName));
|
|
42
|
-
const buildProjectPublicDir = path.join(rnv_1.Common.getPlatformProjectDir(c), 'public', 'content');
|
|
43
|
-
filesToCopy.forEach((filePath) => {
|
|
44
|
-
const destFilePath = path.join(buildProjectPublicDir, 'theoplayer', path.basename(filePath));
|
|
45
|
-
fse.copySync(filePath, destFilePath);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
exports.copyTheoPlayerLibs = copyTheoPlayerLibs;
|