@24i/smartapps-bigscreen-rnv-build-engine 0.18.2-test.1 → 5.0.0-alpha.16
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/.eslintrc.vegaos.js +32 -0
- package/dist/src/__tests__/engine.spec.js +2 -0
- package/dist/src/__tests__/resolvers/resolveBaseUrl.spec.js +19 -14
- package/dist/src/__tests__/resolvers/resolveBuildFileName.spec.js +1 -0
- package/dist/src/__tests__/resolvers/resolveBuildVersion.spec.js +21 -7
- package/dist/src/__tests__/resolvers/resolveDeployLocations.spec.js +3 -0
- package/dist/src/__tests__/resolvers/resolveZippedPlatformBuildsRelativeFilePath.spec.js +1 -1
- package/dist/src/__tests__/utils/zipBuildsByPlatforms.spec.js +7 -0
- package/dist/src/resolvers/shared/constructFullUrl.js +1 -1
- package/dist/src/scripts/release/productionPackages/notifySlack.js +11 -13
- package/dist/src/sdks/sdk-androidtv/sdkAndroidtv.js +10 -3
- package/dist/src/sdks/sdk-tizen/sdkTizen.js +1 -1
- package/dist/src/sdks/sdk-vegaos/sdkVegaOS.js +25 -7
- package/dist/src/tasks/task.rnv.hooks.run.js +1 -24
- package/dist/src/tasks/task.rnv.project.configure.js +4 -1
- package/dist/src/utils/copyEnvironmentFolder.js +2 -2
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +14 -7
- package/dist/src/utils/getSafeSchemeString.js +1 -3
- package/dist/src/utils/zipBuildsByPlatforms.js +3 -3
- package/dist/src/utils/zipStagingProdBuildsByPlatforms.js +17 -16
- package/dist/templates/platforms/_shared/template.js +2 -1
- package/dist/templates/platforms/_shared/webpack.base.js +12 -0
- package/dist/templates/platforms/androidtv/project/app/build.gradle +3 -1
- package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/BridgeConfig.kt +1 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryBitmovinCustomized.kt +3 -1
- package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +1 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +11 -0
- package/dist/templates/platforms/vegaos/project/manifest.toml +14 -0
- package/dist/templates/platforms/vegaos/project/package-lock.json +5838 -608
- package/dist/templates/platforms/vegaos/project/package.json +2 -0
- package/dist/templates/platforms/vegaos/project/src/App.tsx +5 -4
- package/dist/templates/platforms/vegaos/project/src/deviceApi/adInfo.ts +16 -0
- package/dist/templates/platforms/vegaos/project/src/deviceApi/index.ts +3 -0
- package/dist/templates/platforms/vegaos/project/src/deviceApi/purchase.ts +47 -0
- package/dist/templates/platforms/vegaos/project/src/inject.ts +13 -2
- package/dist/templates/platforms/vegaos/project/src/messageHandler.ts +24 -7
- package/fixDependency.js +53 -11
- package/index.js +103 -0
- package/jest.config.js +3 -0
- package/package.json +92 -90
- /package/dist/templates/platforms/vegaos/project/src/{deviceInfo.ts → deviceApi/deviceInfo.ts} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
es2021: true,
|
|
5
|
+
node: true,
|
|
6
|
+
},
|
|
7
|
+
parser: '@typescript-eslint/parser',
|
|
8
|
+
parserOptions: {
|
|
9
|
+
ecmaVersion: 'latest',
|
|
10
|
+
sourceType: 'module',
|
|
11
|
+
ecmaFeatures: { jsx: true },
|
|
12
|
+
},
|
|
13
|
+
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
|
|
14
|
+
extends: [
|
|
15
|
+
'eslint:recommended',
|
|
16
|
+
'plugin:@typescript-eslint/recommended',
|
|
17
|
+
'plugin:react/recommended',
|
|
18
|
+
'plugin:react-hooks/recommended',
|
|
19
|
+
],
|
|
20
|
+
settings: {
|
|
21
|
+
react: { version: 'detect' },
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
'no-unused-vars': 'off',
|
|
25
|
+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
26
|
+
'react/react-in-jsx-scope': 'off',
|
|
27
|
+
},
|
|
28
|
+
overrides: [{
|
|
29
|
+
files: ['**/metro.config.js'],
|
|
30
|
+
rules: { '@typescript-eslint/no-var-requires': 'off' },
|
|
31
|
+
}],
|
|
32
|
+
};
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const engine_1 = __importDefault(require("../engine"));
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const engineTasks_1 = require("../tasks/engineTasks");
|
|
9
|
+
jest.mock('inquirer', () => ({ prompt: jest.fn() }));
|
|
10
|
+
jest.mock('manifoldjs-windows10', () => ({}));
|
|
9
11
|
jest.mock('../../../renative.engine.json', () => ({ __esModule: true, id: 'engineID', plugins: {} }), { virtual: true });
|
|
10
12
|
describe('engine config', () => {
|
|
11
13
|
afterAll(() => {
|
|
@@ -5,7 +5,7 @@ const resolveGenericRnvConfig_1 = require("../../resolvers/resolveGenericRnvConf
|
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
jest.mock('../../resolvers/resolveGenericRnvConfig');
|
|
7
7
|
describe('resolveBaseUrl', () => {
|
|
8
|
-
const
|
|
8
|
+
const hostedBaseUrl = 'http://test-bucket.s3.amazonaws.com';
|
|
9
9
|
const flavour = 'test_flavour';
|
|
10
10
|
const packageVersion = '1.0.0';
|
|
11
11
|
const expectEmptyStringOutputForEachPlatformAndSchemeByFlavour = (customFlavour) => {
|
|
@@ -20,19 +20,23 @@ describe('resolveBaseUrl', () => {
|
|
|
20
20
|
jest.resetAllMocks();
|
|
21
21
|
jest.resetModules();
|
|
22
22
|
});
|
|
23
|
-
it('returns
|
|
23
|
+
it('returns latest URL when packageVersion is not set', () => {
|
|
24
24
|
resolveGenericRnvConfig_1.getBaseConfig.mockReturnValue({
|
|
25
25
|
runtime: {},
|
|
26
26
|
buildConfig: {
|
|
27
27
|
common: {
|
|
28
28
|
packageVersion: '',
|
|
29
|
-
|
|
29
|
+
hostedUrl: { baseUrl: hostedBaseUrl },
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
34
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({
|
|
35
|
+
platform, scheme: constants_1.BuildSchemes.DEV_LATEST, flavour,
|
|
36
|
+
})).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/dev`);
|
|
37
|
+
});
|
|
34
38
|
});
|
|
35
|
-
it('returns empty string when c.buildConfig.common.
|
|
39
|
+
it('returns empty string when c.buildConfig.common.hostedUrl.baseUrl is not set', () => {
|
|
36
40
|
resolveGenericRnvConfig_1.getBaseConfig.mockReturnValue({
|
|
37
41
|
runtime: {},
|
|
38
42
|
buildConfig: { common: { packageVersion } },
|
|
@@ -40,14 +44,13 @@ describe('resolveBaseUrl', () => {
|
|
|
40
44
|
expectEmptyStringOutputForEachPlatformAndSchemeByFlavour(flavour);
|
|
41
45
|
});
|
|
42
46
|
describe('resolving baseUrl for configured schemes', () => {
|
|
43
|
-
const bucketUrl = `http://${bucketName}.s3.amazonaws.com`;
|
|
44
47
|
beforeEach(() => {
|
|
45
48
|
resolveGenericRnvConfig_1.getBaseConfig.mockReturnValue({
|
|
46
49
|
runtime: {},
|
|
47
50
|
buildConfig: {
|
|
48
51
|
common: {
|
|
49
52
|
packageVersion,
|
|
50
|
-
|
|
53
|
+
hostedUrl: { baseUrl: hostedBaseUrl },
|
|
51
54
|
},
|
|
52
55
|
},
|
|
53
56
|
});
|
|
@@ -77,43 +80,45 @@ describe('resolveBaseUrl', () => {
|
|
|
77
80
|
it('returns proper url for "latest development" build scheme', () => {
|
|
78
81
|
const scheme = constants_1.BuildSchemes.DEV_LATEST;
|
|
79
82
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
80
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
83
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/dev`);
|
|
81
84
|
});
|
|
82
85
|
});
|
|
83
86
|
it('returns proper url for "latest release candidate (staging)" scheme', () => {
|
|
84
87
|
const scheme = constants_1.BuildSchemes.RC_STAGING_LATEST;
|
|
85
88
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
86
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
89
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/rc/staging`);
|
|
87
90
|
});
|
|
88
91
|
});
|
|
89
92
|
it('returns proper url for "latest release candidate (production)" scheme', () => {
|
|
90
93
|
const scheme = constants_1.BuildSchemes.RC_PROD_LATEST;
|
|
91
94
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
92
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
95
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/rc/production`);
|
|
93
96
|
});
|
|
94
97
|
});
|
|
95
98
|
it('returns proper url for "latest release (staging)" build scheme', () => {
|
|
96
99
|
const scheme = constants_1.BuildSchemes.RELEASE_STAGING_LATEST;
|
|
97
100
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
98
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
101
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/release/staging`);
|
|
99
102
|
});
|
|
100
103
|
});
|
|
101
104
|
it('returns proper url for "latest release (production)" build scheme', () => {
|
|
102
105
|
const scheme = constants_1.BuildSchemes.RELEASE_PROD_LATEST;
|
|
103
106
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
104
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
107
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}/latest/release/production`);
|
|
105
108
|
});
|
|
106
109
|
});
|
|
107
110
|
it('returns proper url for "distribution release (staging)" build scheme', () => {
|
|
108
111
|
const scheme = constants_1.BuildSchemes.RELEASE_STAGING_DIST;
|
|
109
112
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
110
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
113
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}`
|
|
114
|
+
+ `/dist/v${packageVersion}/staging`);
|
|
111
115
|
});
|
|
112
116
|
});
|
|
113
117
|
it('returns proper url for "distribution release (production)" build scheme', () => {
|
|
114
118
|
const scheme = constants_1.BuildSchemes.RELEASE_PROD_DIST;
|
|
115
119
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
116
|
-
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${
|
|
120
|
+
expect((0, resolveBaseUrl_1.resolveBaseUrl)({ platform, flavour, scheme })).toBe(`${hostedBaseUrl}/builds/${platform}/${flavour}`
|
|
121
|
+
+ `/dist/v${packageVersion}/production`);
|
|
117
122
|
});
|
|
118
123
|
});
|
|
119
124
|
});
|
|
@@ -10,6 +10,7 @@ const getPackageExtensionByPlatform = (platform) => {
|
|
|
10
10
|
switch (platform) {
|
|
11
11
|
case constants_1.Platforms.TIZEN: return 'wgt';
|
|
12
12
|
case constants_1.Platforms.WEBOS: return 'ipk';
|
|
13
|
+
case constants_1.Platforms.VEGAOS: return 'vpkg';
|
|
13
14
|
default: return 'zip';
|
|
14
15
|
}
|
|
15
16
|
};
|
|
@@ -29,9 +29,15 @@ describe('resolveBuildVersion', () => {
|
|
|
29
29
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RC_PROD_LATEST })).toBe('v1.0.0.rc');
|
|
30
30
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING })).toBe('v1.0.0');
|
|
31
31
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_PROD })).toBe('v1.0.0');
|
|
32
|
-
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
33
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING_LATEST,
|
|
34
|
+
})).toBe('v1.0.0');
|
|
35
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
36
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_PROD_LATEST,
|
|
37
|
+
})).toBe('v1.0.0');
|
|
38
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
39
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING_DIST,
|
|
40
|
+
})).toBe('v1.0.0');
|
|
35
41
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_PROD_DIST })).toBe('v1.0.0');
|
|
36
42
|
});
|
|
37
43
|
});
|
|
@@ -51,10 +57,18 @@ describe('resolveBuildVersion', () => {
|
|
|
51
57
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RC_PROD_LATEST })).toBe('v1.0.0.rc-2');
|
|
52
58
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING })).toBe('v1.0.0-2');
|
|
53
59
|
expect((0, resolveBuildVersion_1.resolveBuildVersion)({ platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_PROD })).toBe('v1.0.0-2');
|
|
54
|
-
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
60
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
61
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING_LATEST,
|
|
62
|
+
})).toBe('v1.0.0-2');
|
|
63
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
64
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_PROD_LATEST,
|
|
65
|
+
})).toBe('v1.0.0-2');
|
|
66
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
67
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING_DIST,
|
|
68
|
+
})).toBe('v1.0.0-2');
|
|
69
|
+
expect((0, resolveBuildVersion_1.resolveBuildVersion)({
|
|
70
|
+
platform, flavour, scheme: constants_1.BuildSchemes.RELEASE_STAGING_DIST,
|
|
71
|
+
})).toBe('v1.0.0-2');
|
|
58
72
|
});
|
|
59
73
|
});
|
|
60
74
|
});
|
|
@@ -12,7 +12,7 @@ describe('resolveZippedPlatformBuildsRelativeFilePath', () => {
|
|
|
12
12
|
};
|
|
13
13
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
14
14
|
const r = (0, resolveZippedPlatformBuildsRelativeFilePath_1.resolveZippedPlatformBuildsRelativeFilePath)(c, platform);
|
|
15
|
-
expect(r).toBe(
|
|
15
|
+
expect(r).toBe(`dir1/dir2/dir3/zipped_by_platform/appName_${platform}_1.0.0.zip`);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
});
|
|
@@ -24,6 +24,8 @@ describe('zipBuildsByPlatforms', () => {
|
|
|
24
24
|
fs_1.default.writeFileSync(path_1.default.resolve(outputPath, 'another_build.wgt'), 'data');
|
|
25
25
|
fs_1.default.writeFileSync(path_1.default.resolve(outputPath, 'build.ipk'), 'data');
|
|
26
26
|
fs_1.default.writeFileSync(path_1.default.resolve(outputPath, 'another_build.ipk'), 'data');
|
|
27
|
+
fs_1.default.writeFileSync(path_1.default.resolve(outputPath, 'build.vpkg'), 'data');
|
|
28
|
+
fs_1.default.writeFileSync(path_1.default.resolve(outputPath, 'another_build.vpkg'), 'data');
|
|
27
29
|
});
|
|
28
30
|
});
|
|
29
31
|
});
|
|
@@ -32,6 +34,8 @@ describe('zipBuildsByPlatforms', () => {
|
|
|
32
34
|
});
|
|
33
35
|
it('create zip file for each supported platform', () => {
|
|
34
36
|
const rnvC = {
|
|
37
|
+
program: { schemeFolder: false },
|
|
38
|
+
runtime: {},
|
|
35
39
|
buildConfig: {
|
|
36
40
|
paths: {
|
|
37
41
|
platformBuildsDir: platformBuildsPath,
|
|
@@ -61,6 +65,9 @@ describe('zipBuildsByPlatforms', () => {
|
|
|
61
65
|
else if (platform === constants_1.Platforms.WEBOS) {
|
|
62
66
|
expect(zipFileContent).toStrictEqual(['another_build.ipk', 'build.ipk']);
|
|
63
67
|
}
|
|
68
|
+
else if (platform === constants_1.Platforms.VEGAOS) {
|
|
69
|
+
expect(zipFileContent).toStrictEqual(['another_build.vpkg', 'build.vpkg']);
|
|
70
|
+
}
|
|
64
71
|
else {
|
|
65
72
|
expect(zipFileContent).toStrictEqual(['another_build.zip', 'build.zip']);
|
|
66
73
|
}
|
|
@@ -4,7 +4,7 @@ exports.constructFullUrl = void 0;
|
|
|
4
4
|
const resolveBuildEnvName_1 = require("../resolveBuildEnvName");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const constructFullUrl = ({ baseUrl, scheme, c }) => {
|
|
7
|
-
const
|
|
7
|
+
const packageVersion = c.buildConfig?.common?.packageVersion;
|
|
8
8
|
const envName = (0, resolveBuildEnvName_1.resolveBuildEnvName)(scheme);
|
|
9
9
|
switch (scheme) {
|
|
10
10
|
case constants_1.BuildSchemes.DEV_LATEST:
|
|
@@ -3,19 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.notifySlack = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const slackBlockKitBuilder_1 = require("../../utils/slackBlockKitBuilder");
|
|
6
|
-
const getSlackPayload = (appName, fileName, filePath) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
};
|
|
6
|
+
const getSlackPayload = (appName, fileName, filePath) => ({
|
|
7
|
+
blocks: [
|
|
8
|
+
slackBlockKitBuilder_1.Divider.plain(),
|
|
9
|
+
slackBlockKitBuilder_1.Section.mrkdwn(`${appName} Production Packages`),
|
|
10
|
+
slackBlockKitBuilder_1.Context.mrkdwns([fileName]),
|
|
11
|
+
slackBlockKitBuilder_1.Actions.buttons([{
|
|
12
|
+
text: 'Download Production Packages',
|
|
13
|
+
url: filePath,
|
|
14
|
+
}]),
|
|
15
|
+
],
|
|
16
|
+
});
|
|
19
17
|
const notifySlack = (c, fileName) => {
|
|
20
18
|
const appName = c.buildConfig.common.appName ?? '';
|
|
21
19
|
const webHookUrl = c.buildConfig.common.deploy.slack?.webhookUrl ?? '';
|
|
@@ -200,6 +200,8 @@ const configureEntryUrl = (c) => {
|
|
|
200
200
|
const entryUrl = getHostedAppEntryUrl(c);
|
|
201
201
|
const bitmovinLicense = process.env.BITMOVIN_LICENSE
|
|
202
202
|
|| rnv_1.Common.getConfigProp(c, c.platform, 'bitmovinLicense', '');
|
|
203
|
+
const bitmovinAnalytics = process.env.BITMOVIN_ANALYTICS
|
|
204
|
+
|| rnv_1.Common.getConfigProp(c, c.platform, 'bitmovinAnalytics', '');
|
|
203
205
|
const npawAccountCode = process.env.NPAW_ACCOUNT_CODE
|
|
204
206
|
|| rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
|
|
205
207
|
const enableImaSdk = !!rnv_1.Common.getConfigProp(c, c.platform, 'enableImaSdk', false);
|
|
@@ -209,6 +211,9 @@ const configureEntryUrl = (c) => {
|
|
|
209
211
|
}, {
|
|
210
212
|
pattern: '{{BITMOVIN_LICENSE}}',
|
|
211
213
|
override: bitmovinLicense,
|
|
214
|
+
}, {
|
|
215
|
+
pattern: '{{BITMOVIN_ANALYTICS}}',
|
|
216
|
+
override: bitmovinAnalytics,
|
|
212
217
|
}, {
|
|
213
218
|
pattern: '{{NPAW_ACCOUNT_CODE}}',
|
|
214
219
|
override: npawAccountCode,
|
|
@@ -225,9 +230,9 @@ const configureIap = (c) => {
|
|
|
225
230
|
const buildGradleFilePath = path.join(projectDir, 'app', buildGradleFileName);
|
|
226
231
|
const flavorFilePath = path.join(projectDir, `app/src/${flavourName}/kotlin/com/twentyfouri/tvbridge/Flavor.kt`);
|
|
227
232
|
const enableIap = rnv_1.Common.getConfigProp(c, c.platform, 'enableIap', false);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
233
|
+
const iapDependencies = [];
|
|
234
|
+
const flavorImports = [];
|
|
235
|
+
const flavorIapFactories = [];
|
|
231
236
|
if (enableIap) {
|
|
232
237
|
switch (c.platform) {
|
|
233
238
|
case 'firetv':
|
|
@@ -240,6 +245,8 @@ const configureIap = (c) => {
|
|
|
240
245
|
flavorImports.push('import com.twentyfouri.bridgetv.googleiap.GoogleIapServiceFactory');
|
|
241
246
|
flavorIapFactories.push('GoogleIapServiceFactory');
|
|
242
247
|
break;
|
|
248
|
+
default:
|
|
249
|
+
break;
|
|
243
250
|
}
|
|
244
251
|
}
|
|
245
252
|
const injects = [{
|
|
@@ -106,7 +106,7 @@ const handleLinuxKeyring = () => {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
const setTizenCertificate = (c) => {
|
|
109
|
-
const { TIZEN_SECURITY_PROFILE_NAME = '24i-SmartApps-BigScreen', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_author.p12', TIZEN_DISTRIBUTOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_distributor.p12', TIZEN_AUTHOR_CERTIFICATE_PASSWORD, } = process.env;
|
|
109
|
+
const { TIZEN_SECURITY_PROFILE_NAME = '24i-SmartApps-BigScreen', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_author.p12', TIZEN_DISTRIBUTOR_CERTIFICATE_RELATIVE_PATH = ('certificates/24i_smartapps_bigscreen_distributor.p12'), TIZEN_AUTHOR_CERTIFICATE_PASSWORD, } = process.env;
|
|
110
110
|
const tizenCliPath = c.cli.tizen;
|
|
111
111
|
const isDebug = c.runtime.scheme === constants_1.BuildSchemes.DEBUG;
|
|
112
112
|
if (!fs.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
|
|
@@ -35,6 +35,7 @@ const rnv_1 = require("rnv");
|
|
|
35
35
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
36
36
|
const resolvers_1 = require("../../resolvers");
|
|
37
37
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
38
|
+
const resolveBuildEnvType_1 = require("../../resolvers/resolveBuildEnvType");
|
|
38
39
|
const constants_1 = require("../../constants");
|
|
39
40
|
const sdk_webpack_2 = require("../sdk-webpack");
|
|
40
41
|
const getHostedAppUrl = (c) => {
|
|
@@ -53,7 +54,8 @@ const getHostedAppUrl = (c) => {
|
|
|
53
54
|
if (baseUrl)
|
|
54
55
|
return `${baseUrl}/public/index.html`;
|
|
55
56
|
const localIp = program.debugIp ?? ip_1.default.address();
|
|
56
|
-
const
|
|
57
|
+
const defaultLocalPort = 8100;
|
|
58
|
+
const localPort = runtime.port ?? defaultLocalPort;
|
|
57
59
|
return `http://${localIp}:${localPort}/`;
|
|
58
60
|
};
|
|
59
61
|
const configureAppUrl = (c) => {
|
|
@@ -92,7 +94,20 @@ const copyAppIcon = (c) => {
|
|
|
92
94
|
if (!fs.existsSync(destDir)) {
|
|
93
95
|
fs.mkdirSync(destDir, { recursive: true });
|
|
94
96
|
}
|
|
95
|
-
|
|
97
|
+
const envType = (0, resolveBuildEnvType_1.resolveBuildEnvType)(c.runtime.scheme);
|
|
98
|
+
const envHierarchy = ['dev', 'staging', 'prod'];
|
|
99
|
+
const envIndex = envHierarchy.indexOf(envType);
|
|
100
|
+
const srcIconPath = envHierarchy
|
|
101
|
+
.slice(envIndex)
|
|
102
|
+
.map((env) => path.join(destDir, `_${env}`, 'app_icon.png'))
|
|
103
|
+
.find((candidate) => fs.existsSync(candidate));
|
|
104
|
+
if (srcIconPath) {
|
|
105
|
+
fs.copyFileSync(srcIconPath, destIconPath);
|
|
106
|
+
rnv_1.Logger.logInfo(`App icon copied from: ${srcIconPath}`);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
rnv_1.Logger.logDebug('No environment-specific app icon found, skipping copy.');
|
|
110
|
+
}
|
|
96
111
|
};
|
|
97
112
|
const installDependencies = (c) => {
|
|
98
113
|
rnv_1.Logger.logTask('installDependencies');
|
|
@@ -113,18 +128,21 @@ const buildVegaOSProject = async (c) => {
|
|
|
113
128
|
const projectParentDir = path.join(projectDir, '..');
|
|
114
129
|
const outputDir = path.join(projectParentDir, 'output');
|
|
115
130
|
const buildType = c.runtime.scheme === constants_1.BuildSchemes.DEBUG ? 'Debug' : 'Release';
|
|
131
|
+
const appVersion = rnv_1.Common.getAppVersion(c, c.platform) || '0.0.1';
|
|
132
|
+
const versionCode = rnv_1.Common.getConfigProp(c, c.platform, 'versionCode', '1');
|
|
116
133
|
try {
|
|
117
134
|
const watchListOutput = (0, child_process_1.execSync)('watchman watch-list', { stdio: 'pipe' }).toString();
|
|
118
135
|
const watchList = JSON.parse(watchListOutput);
|
|
119
136
|
const parentWatches = (watchList.roots || []).filter((root) => projectDir.startsWith(root) && root !== projectDir);
|
|
120
|
-
|
|
137
|
+
parentWatches.forEach((parentWatch) => {
|
|
121
138
|
(0, child_process_1.execSync)(`watchman watch-del '${parentWatch}'`, { stdio: 'pipe' });
|
|
122
|
-
}
|
|
139
|
+
});
|
|
123
140
|
}
|
|
124
141
|
catch {
|
|
125
142
|
}
|
|
126
143
|
rnv_1.Logger.logInfo(`Building VegaOS project (${buildType})...`);
|
|
127
|
-
const buildCmd = `npx react-native build-vega --build-type ${buildType}
|
|
144
|
+
const buildCmd = `npx react-native build-vega --build-type ${buildType} `
|
|
145
|
+
+ `--build-version ${appVersion} --build-number ${versionCode}`;
|
|
128
146
|
(0, child_process_1.execSync)(buildCmd, { cwd: projectDir, stdio: 'inherit' });
|
|
129
147
|
if (!fs.existsSync(outputDir)) {
|
|
130
148
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
@@ -135,7 +153,7 @@ const buildVegaOSProject = async (c) => {
|
|
|
135
153
|
if (!fs.existsSync(dir))
|
|
136
154
|
return;
|
|
137
155
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
138
|
-
|
|
156
|
+
entries.forEach((entry) => {
|
|
139
157
|
const fullPath = path.join(dir, entry.name);
|
|
140
158
|
if (entry.isDirectory()) {
|
|
141
159
|
findArmv7Vpkg(fullPath);
|
|
@@ -143,7 +161,7 @@ const buildVegaOSProject = async (c) => {
|
|
|
143
161
|
else if (entry.name.endsWith('.vpkg') && fullPath.includes('armv7')) {
|
|
144
162
|
armv7VpkgFile = fullPath;
|
|
145
163
|
}
|
|
146
|
-
}
|
|
164
|
+
});
|
|
147
165
|
};
|
|
148
166
|
findArmv7Vpkg(buildDir);
|
|
149
167
|
if (armv7VpkgFile) {
|
|
@@ -1,32 +1,9 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.customRnvHooksRunTask = void 0;
|
|
27
|
-
const inquirer = __importStar(require("inquirer"));
|
|
28
4
|
const rnv_1 = require("rnv");
|
|
29
5
|
const buildHooks_1 = require("rnv/dist/core/projectManager/buildHooks");
|
|
6
|
+
const inquirer = require('inquirer');
|
|
30
7
|
const { logTask, logInfo } = rnv_1.Logger;
|
|
31
8
|
const { executeTask } = rnv_1.TaskManager;
|
|
32
9
|
const { fsExistsSync } = rnv_1.FileUtils;
|
|
@@ -38,9 +38,12 @@ const { TASK_INSTALL, TASK_PROJECT_CONFIGURE, TASK_TEMPLATE_APPLY, TASK_APP_CONF
|
|
|
38
38
|
const { checkAndCreateBabelConfig, copyRuntimeAssets, cleanPlaformAssets, checkAndCreateGitignore, versionCheck, } = rnv_1.ProjectManager;
|
|
39
39
|
const { configureEngines, getEngineRunnerByPlatform } = rnv_1.EngineManager;
|
|
40
40
|
const { executeTask, initializeTask, findSuitableTask } = rnv_1.TaskManager;
|
|
41
|
+
const resolveBuildEnginePackageRoot = () => path.dirname(require.resolve('@24i/smartapps-bigscreen-rnv-build-engine/package.json', { paths: [process.cwd(), __dirname] }));
|
|
41
42
|
const patchEngineTemplatesPath = (c) => {
|
|
42
|
-
const
|
|
43
|
+
const packageRoot = resolveBuildEnginePackageRoot();
|
|
44
|
+
const templatesPath = path.join(packageRoot, 'dist', 'templates');
|
|
43
45
|
const engine = getEngineRunnerByPlatform(c, c.platform);
|
|
46
|
+
engine.rootPath = packageRoot;
|
|
44
47
|
engine.originalTemplatePlatformsDir = path.join(templatesPath, 'platforms');
|
|
45
48
|
engine.originalTemplateAssetsDir = path.join(templatesPath, 'assets');
|
|
46
49
|
engine.originalTemplatePlatformProjectDir = path.join(templatesPath, 'platforms', 'project');
|
|
@@ -48,8 +48,8 @@ const copyEnvironmentFolder = (c, dirPath) => {
|
|
|
48
48
|
rnv_1.FileUtils.copyFolderContentsRecursiveSync(envFolderPath, path.join(envFolderPath, '..'));
|
|
49
49
|
}
|
|
50
50
|
const envs = ['dev', 'staging', 'prod'];
|
|
51
|
-
envs.forEach((
|
|
52
|
-
const envDir = path.join(dirPath, `_${
|
|
51
|
+
envs.forEach((environmentType) => {
|
|
52
|
+
const envDir = path.join(dirPath, `_${environmentType}`);
|
|
53
53
|
fs.rmSync(envDir, { recursive: true, force: true });
|
|
54
54
|
});
|
|
55
55
|
};
|
|
@@ -4,7 +4,7 @@ exports.forEachSupportedPlatformFlavour = exports.forEachPlatformFlavour = expor
|
|
|
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;
|
|
7
|
-
let string =
|
|
7
|
+
let string = '\nProcessing';
|
|
8
8
|
if (printScheme) {
|
|
9
9
|
string += ` "${schemes[schemeIndex]}" scheme"`;
|
|
10
10
|
string += ` (${schemeIndex + 1}/${schemes.length}),`;
|
|
@@ -16,16 +16,23 @@ const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, fl
|
|
|
16
16
|
return string;
|
|
17
17
|
};
|
|
18
18
|
exports.getProgressMessage = getProgressMessage;
|
|
19
|
-
const
|
|
19
|
+
const forEachPlatformFlavourInternal = (platforms, c, cb, options = {}) => {
|
|
20
20
|
const { ignoredPlatforms = [], schemes = [], schemeIndex = 0, } = options;
|
|
21
|
-
const processPlatformFlavours = (platform, platformIndex,
|
|
21
|
+
const processPlatformFlavours = (platform, platformIndex, platformList) => {
|
|
22
22
|
if (ignoredPlatforms.includes(platform)) {
|
|
23
|
-
|
|
23
|
+
const skippedPlatform = platformList[platformIndex];
|
|
24
|
+
console.log(`\nSkipping "${skippedPlatform}" platform `
|
|
25
|
+
+ `(${platformIndex + 1}/${platformList.length}).`);
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
const processFlavour = (flavour, flavourIndex, flavours) => {
|
|
27
29
|
console.log(getProgressMessage({
|
|
28
|
-
schemes,
|
|
30
|
+
schemes,
|
|
31
|
+
schemeIndex,
|
|
32
|
+
platforms: platformList,
|
|
33
|
+
platformIndex,
|
|
34
|
+
flavours,
|
|
35
|
+
flavourIndex,
|
|
29
36
|
}));
|
|
30
37
|
const { scheme } = c.runtime;
|
|
31
38
|
return cb({ platform, flavour, scheme });
|
|
@@ -37,10 +44,10 @@ const _forEachPlatformFlavour = (platforms, c, cb, options = {}) => {
|
|
|
37
44
|
};
|
|
38
45
|
const forEachSupportedPlatformFlavour = (c, cb, options = {}) => {
|
|
39
46
|
const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
40
|
-
|
|
47
|
+
forEachPlatformFlavourInternal(supportedPlatforms, c, cb, options);
|
|
41
48
|
};
|
|
42
49
|
exports.forEachSupportedPlatformFlavour = forEachSupportedPlatformFlavour;
|
|
43
50
|
const forEachPlatformFlavour = (platforms, c, cb) => {
|
|
44
|
-
|
|
51
|
+
forEachPlatformFlavourInternal(platforms, c, cb);
|
|
45
52
|
};
|
|
46
53
|
exports.forEachPlatformFlavour = forEachPlatformFlavour;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSafeSchemeString = void 0;
|
|
4
|
-
const getSafeSchemeString = (scheme) =>
|
|
5
|
-
return scheme.replace(/:/g, '_');
|
|
6
|
-
};
|
|
4
|
+
const getSafeSchemeString = (scheme) => scheme.replace(/:/g, '_');
|
|
7
5
|
exports.getSafeSchemeString = getSafeSchemeString;
|
|
@@ -29,7 +29,7 @@ const fs_1 = require("fs");
|
|
|
29
29
|
const path = __importStar(require("path"));
|
|
30
30
|
const glob = __importStar(require("glob"));
|
|
31
31
|
const resolvers_1 = require("../resolvers");
|
|
32
|
-
const getSafeSchemeString_1 = require("
|
|
32
|
+
const getSafeSchemeString_1 = require("./getSafeSchemeString");
|
|
33
33
|
const zipDir = (srcDir, outputFile) => (0, child_process_1.execSync)(`zip ${outputFile} -0 -j ${srcDir}/*`);
|
|
34
34
|
const getPlatformBuildsPaths = (c, platformName) => {
|
|
35
35
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
@@ -39,7 +39,7 @@ const getPlatformBuildsPaths = (c, platformName) => {
|
|
|
39
39
|
const platformBuildsGlob = `${outputGlob}/*.${(0, resolvers_1.resolveBuildFileExtension)(platformName)}`;
|
|
40
40
|
try {
|
|
41
41
|
const buildsPathsCandidates = glob.sync(platformBuildsGlob) || [];
|
|
42
|
-
return buildsPathsCandidates.filter((
|
|
42
|
+
return buildsPathsCandidates.filter((buildPath) => buildPath.includes(platformName));
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
|
45
45
|
return [];
|
|
@@ -50,7 +50,7 @@ const processPlatform = (c, platformName) => {
|
|
|
50
50
|
if (platformBuildsPaths && platformBuildsPaths.length === 0)
|
|
51
51
|
return;
|
|
52
52
|
const outputZipFilePath = (0, resolvers_1.resolveZippedPlatformBuildsRelativeFilePath)(c, platformName);
|
|
53
|
-
const tempPlatformDir =
|
|
53
|
+
const tempPlatformDir = path.join(path.dirname(outputZipFilePath), platformName);
|
|
54
54
|
(0, fs_1.mkdirSync)(tempPlatformDir, { recursive: true });
|
|
55
55
|
const copyBuildFileIntoTempPlatformDir = (buildFilePath) => {
|
|
56
56
|
const buildFileName = path.basename(buildFilePath);
|