@24i/smartapps-bigscreen-rnv-build-engine 0.17.5-alpha.2284 → 0.17.5

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.
Files changed (33) hide show
  1. package/dist/src/__tests__/resolvers/resolveBaseUrl.spec.js +33 -12
  2. package/dist/src/__tests__/resolvers/resolveBuildEnvName.spec.js +23 -0
  3. package/dist/src/__tests__/resolvers/resolveBuildFileBaseName.spec.js +40 -20
  4. package/dist/src/__tests__/resolvers/resolveBuildFileName.spec.js +40 -20
  5. package/dist/src/__tests__/resolvers/resolveBuildVersion.spec.js +20 -10
  6. package/dist/src/__tests__/resolvers/resolveDeployLocations.spec.js +11 -11
  7. package/dist/src/__tests__/resolvers/resolveHbbtvDeployUrl.spec.js +21 -9
  8. package/dist/src/__tests__/resolvers/resolveHbbtvRemoteBuildDirRelativePath.spec.js +29 -10
  9. package/dist/src/constants/buildSchemes.js +10 -5
  10. package/dist/src/resolvers/index.js +3 -1
  11. package/dist/src/resolvers/resolveBaseUrl.js +11 -6
  12. package/dist/src/resolvers/resolveBuildEnvName.js +23 -0
  13. package/dist/src/resolvers/resolveBuildFileBaseName.js +17 -5
  14. package/dist/src/resolvers/resolveBuildVersion.js +10 -5
  15. package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +11 -6
  16. package/dist/src/scripts/generateDeployUrls/generateDeployUrls.js +90 -33
  17. package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +3 -1
  18. package/dist/src/scripts/release/notifySlack/makePayload.js +5 -1
  19. package/dist/src/scripts/release/notifySlack/notifySlack.js +10 -5
  20. package/dist/src/scripts/releaseAllWithScheme.js +17 -6
  21. package/dist/src/tasks/deploy/aswS3/aws.js +3 -21
  22. package/dist/src/tasks/deploy/aswS3/deployS3.js +1 -2
  23. package/dist/src/utils/forEachSupportedPlatformFlavour.js +2 -7
  24. package/dist/src/utils/zipBuildsByPlatforms.js +1 -1
  25. package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeFromJavaScript.kt +0 -44
  26. package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +1 -3
  27. package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +0 -11
  28. package/jest.config.js +2 -2
  29. package/package.json +1 -1
  30. package/dist/src/constants/delopyLivePlatforms.js +0 -13
  31. package/dist/src/scripts/deployLiveAll.js +0 -27
  32. package/dist/src/scripts/deployLivePlatform.js +0 -40
  33. package/dist/src/tasks/deploy/aswS3/distToLiveS3.js +0 -76
@@ -12,12 +12,17 @@ const resolveBuildType = (c) => {
12
12
  case constants_1.BuildSchemes.DEV:
13
13
  case constants_1.BuildSchemes.DEV_LATEST:
14
14
  return '.dev';
15
- case constants_1.BuildSchemes.RC:
16
- case constants_1.BuildSchemes.RC_LATEST:
15
+ case constants_1.BuildSchemes.RC_STAGING:
16
+ case constants_1.BuildSchemes.RC_STAGING_LATEST:
17
+ case constants_1.BuildSchemes.RC_PROD:
18
+ case constants_1.BuildSchemes.RC_PROD_LATEST:
17
19
  return '.rc';
18
- case constants_1.BuildSchemes.RELEASE:
19
- case constants_1.BuildSchemes.RELEASE_LATEST:
20
- case constants_1.BuildSchemes.RELEASE_DIST:
20
+ case constants_1.BuildSchemes.RELEASE_STAGING:
21
+ case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
22
+ case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
23
+ case constants_1.BuildSchemes.RELEASE_PROD:
24
+ case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
25
+ case constants_1.BuildSchemes.RELEASE_PROD_DIST:
21
26
  return '';
22
27
  default:
23
28
  throw new Error(`resolveBuildType: scheme "${c.runtime.scheme}" is not defined!`);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveHbbtvRemoteBuildDirRelativePath = void 0;
4
+ const resolveBuildEnvName_1 = require("./resolveBuildEnvName");
4
5
  const constants_1 = require("../constants");
5
6
  const resolveHbbtvRemoteBuildDirRelativePath = (c, scheme, appConfigId) => {
6
7
  const projectDirName = c.buildConfig.common.appNameInFileName;
@@ -8,15 +9,19 @@ const resolveHbbtvRemoteBuildDirRelativePath = (c, scheme, appConfigId) => {
8
9
  if (!projectDirName || !appConfigId) {
9
10
  return '';
10
11
  }
12
+ const envName = (0, resolveBuildEnvName_1.resolveBuildEnvName)(scheme);
11
13
  switch (scheme) {
12
14
  case constants_1.BuildSchemes.DEV_LATEST:
13
15
  return `${projectDirName}/${appConfigId}/latest/dev`;
14
- case constants_1.BuildSchemes.RC_LATEST:
15
- return `${projectDirName}/${appConfigId}/latest/rc`;
16
- case constants_1.BuildSchemes.RELEASE_LATEST:
17
- return `${projectDirName}/${appConfigId}/latest/release`;
18
- case constants_1.BuildSchemes.RELEASE_DIST:
19
- return version ? `${projectDirName}/${appConfigId}/dist/v${version}` : '';
16
+ case constants_1.BuildSchemes.RC_STAGING_LATEST:
17
+ case constants_1.BuildSchemes.RC_PROD_LATEST:
18
+ return `${projectDirName}/${appConfigId}/latest/rc/${envName}`;
19
+ case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
20
+ case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
21
+ return `${projectDirName}/${appConfigId}/latest/release/${envName}`;
22
+ case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
23
+ case constants_1.BuildSchemes.RELEASE_PROD_DIST:
24
+ return version ? `${projectDirName}/${appConfigId}/dist/v${version}/${envName}` : '';
20
25
  default:
21
26
  return '';
22
27
  }
@@ -49,39 +49,96 @@ const makeTableMarkdownByScheme = (rnvC, scheme) => {
49
49
  return tableDataToMarkdown(formattedTableData);
50
50
  };
51
51
  const deployedEachTimeIntoTheSamePath = '> Deployed each time into the same path.';
52
- const makeMarkdownFileContentRows = (rnvC) => ([
53
- `# ${rnvC.buildConfig.projectName}`,
54
- '## Deploy URLs',
55
- '',
56
- '---',
57
- '### Latest `development` builds',
58
- '> Latest builds against the development git branch.',
59
- deployedEachTimeIntoTheSamePath,
60
- '',
61
- makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.DEV_LATEST),
62
- '',
63
- '---',
64
- '### Latest `release candidate` builds',
65
- '> Latest builds against the release candidate git branch.',
66
- deployedEachTimeIntoTheSamePath,
67
- '',
68
- makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RC_LATEST),
69
- '---',
70
- '### Latest `release` builds',
71
- '> Latest builds against the release git branch.',
72
- deployedEachTimeIntoTheSamePath,
73
- '',
74
- makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RELEASE_LATEST),
75
- '---',
76
- '### Distribution `release` builds',
77
- '> Builds against the release git branch.',
78
- '> Each new release version is deployed into its own folder.',
79
- '',
80
- '*In opened URL, just replace `<VERSION>` placeholder with requested app version.*',
81
- '',
82
- makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RELEASE_DIST),
83
- '---',
84
- ]);
52
+ const schemesMeta = {
53
+ [constants_1.BuildSchemes.DEV_LATEST]: {
54
+ title: 'Latest `development` builds',
55
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.DEV_LATEST),
56
+ description: [
57
+ '> Latest builds against the development git branch.',
58
+ deployedEachTimeIntoTheSamePath,
59
+ '',
60
+ ],
61
+ },
62
+ [constants_1.BuildSchemes.RC_STAGING_LATEST]: {
63
+ title: 'Latest `release candidate` builds',
64
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RC_STAGING_LATEST),
65
+ description: [
66
+ '> Latest builds against the release candidate git branch.',
67
+ deployedEachTimeIntoTheSamePath,
68
+ '',
69
+ ],
70
+ },
71
+ [constants_1.BuildSchemes.RC_PROD_LATEST]: {
72
+ title: 'Latest `release candidate` builds',
73
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RC_PROD_LATEST),
74
+ description: [
75
+ '> Latest builds against the release candidate git branch.',
76
+ deployedEachTimeIntoTheSamePath,
77
+ '',
78
+ ],
79
+ },
80
+ [constants_1.BuildSchemes.RELEASE_STAGING_LATEST]: {
81
+ title: 'Latest `release` builds',
82
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RELEASE_STAGING_LATEST),
83
+ description: [
84
+ '> Latest builds against the release git branch.',
85
+ deployedEachTimeIntoTheSamePath,
86
+ '',
87
+ ],
88
+ },
89
+ [constants_1.BuildSchemes.RELEASE_PROD_LATEST]: {
90
+ title: 'Latest `release` builds',
91
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RELEASE_PROD_LATEST),
92
+ description: [
93
+ '> Latest builds against the release git branch.',
94
+ deployedEachTimeIntoTheSamePath,
95
+ '',
96
+ ],
97
+ },
98
+ [constants_1.BuildSchemes.RELEASE_STAGING_DIST]: {
99
+ title: 'Distribution `release` builds',
100
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RELEASE_STAGING_DIST),
101
+ description: [
102
+ '> Builds against the release git branch.',
103
+ '> Each new release version is deployed into its own folder.',
104
+ '',
105
+ '*In opened URL, just replace `<VERSION>` placeholder with requested app version.*',
106
+ '',
107
+ ],
108
+ },
109
+ [constants_1.BuildSchemes.RELEASE_PROD_DIST]: {
110
+ title: 'Distribution `release` builds',
111
+ buildEnvironment: (0, resolvers_1.resolveBuildEnvName)(constants_1.BuildSchemes.RELEASE_PROD_DIST),
112
+ description: [
113
+ '> Builds against the release git branch.',
114
+ '> Each new release version is deployed into its own folder.',
115
+ '',
116
+ '*In opened URL, just replace `<VERSION>` placeholder with requested app version.*',
117
+ '',
118
+ ],
119
+ }
120
+ };
121
+ const makeMarkdownFileContentRows = (rnvC) => {
122
+ let content = [
123
+ `# ${rnvC.buildConfig.projectName}`,
124
+ '## Deploy URLs',
125
+ '',
126
+ '---',
127
+ ];
128
+ const supportedSchemes = rnvC.buildConfig.common.deploy.supportedSchemes;
129
+ const schemesContent = supportedSchemes.reduce((acc, scheme) => {
130
+ if (!(scheme in schemesMeta)) {
131
+ throw new Error(`Unknown meta in schemesMeta for scheme: ${scheme}`);
132
+ }
133
+ const { title, description, buildEnvironment, } = schemesMeta[scheme];
134
+ acc.push(`### ${title}`, `Environment: ${buildEnvironment}`, ...description, makeTableMarkdownByScheme(rnvC, scheme), '---');
135
+ return acc;
136
+ }, []);
137
+ return [
138
+ ...content,
139
+ ...schemesContent,
140
+ ];
141
+ };
85
142
  const generateDeployUrls = () => {
86
143
  const outputFilePath = process.argv[2];
87
144
  if (!outputFilePath) {
@@ -12,7 +12,9 @@ const makePlatformRowData = (rnvC, deployLocations, tableFlavours, platform) =>
12
12
  const flavourUrls = platformData[tableFlavours[i]];
13
13
  if (flavourUrls) {
14
14
  let { packageUrl, indexUrl } = flavourUrls;
15
- if (rnvC.runtime.scheme === constants_1.BuildSchemes.RELEASE_DIST) {
15
+ const { scheme } = rnvC.runtime;
16
+ if (scheme === constants_1.BuildSchemes.RELEASE_STAGING_DIST
17
+ || scheme === constants_1.BuildSchemes.RELEASE_PROD_DIST) {
16
18
  const versionRegex = /\d{1,4}\.\d{1,4}\.\d{1,4}/g;
17
19
  const versionPlaceholder = '<VERSION>';
18
20
  packageUrl = packageUrl.replace(versionRegex, versionPlaceholder);
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeDistributionPayload = exports.makeReleaseCandidatePayload = exports.makeDevelopmentPayload = void 0;
4
4
  const slackBlockKitBuilder_1 = require("./slackBlockKitBuilder");
5
+ const buildSchemes_1 = require("../../../constants/buildSchemes");
5
6
  const resolvers_1 = require("../../../resolvers");
6
7
  const getVersionsObject = (c) => (0, resolvers_1.resolveDeployLocations)(c).versions;
7
8
  const getVersion = (c) => Object.keys(getVersionsObject(c))[0] || '';
@@ -39,6 +40,7 @@ const makeHeaderPayload = (c, title, buttons) => {
39
40
  const { travisBuild, gitHubRelease } = buttons || {};
40
41
  const { owner, repo } = c.buildConfig.common.git || {};
41
42
  const version = getVersion(c);
43
+ const envName = (0, resolvers_1.resolveBuildEnvName)(c.runtime.scheme);
42
44
  const buttonsData = [];
43
45
  if (travisBuild) {
44
46
  buttonsData.push({
@@ -56,6 +58,7 @@ const makeHeaderPayload = (c, title, buttons) => {
56
58
  slackBlockKitBuilder_1.Divider.plain(),
57
59
  slackBlockKitBuilder_1.Section.mrkdwn(title),
58
60
  slackBlockKitBuilder_1.Context.mrkdwns([`Version: *${version}*`]),
61
+ slackBlockKitBuilder_1.Context.mrkdwns([`Environment: *${envName}*`]),
59
62
  slackBlockKitBuilder_1.Actions.buttons(buttonsData),
60
63
  ];
61
64
  };
@@ -79,7 +82,8 @@ const makeReleaseCandidatePayload = (c) => {
79
82
  exports.makeReleaseCandidatePayload = makeReleaseCandidatePayload;
80
83
  const makeDistributionPayload = (c) => {
81
84
  const title = `There are new *distribution* builds for *${getCommonAppName(c)}* app!`;
82
- const buttons = { travisBuild: true, gitHubRelease: true };
85
+ const isGitHubRelease = c.runtime.scheme === buildSchemes_1.BuildSchemes.RELEASE_PROD_DIST;
86
+ const buttons = { travisBuild: true, gitHubRelease: isGitHubRelease };
83
87
  return makePayload(c, title, buttons);
84
88
  };
85
89
  exports.makeDistributionPayload = makeDistributionPayload;
@@ -27,18 +27,23 @@ exports.notifySlack = void 0;
27
27
  const child_process_1 = require("child_process");
28
28
  const payload = __importStar(require("./makePayload"));
29
29
  const constants_1 = require("../../../constants");
30
- const getPayload = (c) => {
30
+ const getSlackPayload = (c) => {
31
31
  const releaseType = c.runtime.scheme;
32
32
  switch (releaseType) {
33
- case constants_1.BuildSchemes.DEV_LATEST: return payload.makeDevelopmentPayload(c);
34
- case constants_1.BuildSchemes.RC_LATEST: return payload.makeReleaseCandidatePayload(c);
35
- case constants_1.BuildSchemes.RELEASE_DIST: return payload.makeDistributionPayload(c);
33
+ case constants_1.BuildSchemes.DEV_LATEST:
34
+ return payload.makeDevelopmentPayload(c);
35
+ case constants_1.BuildSchemes.RC_STAGING_LATEST:
36
+ case constants_1.BuildSchemes.RC_PROD_LATEST:
37
+ return payload.makeReleaseCandidatePayload(c);
38
+ case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
39
+ case constants_1.BuildSchemes.RELEASE_PROD_DIST:
40
+ return payload.makeDistributionPayload(c);
36
41
  default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
37
42
  }
38
43
  };
39
44
  const notifySlack = (c) => {
40
45
  const contentType = '"Content-type: application/json"';
41
- const data = `--data '${JSON.stringify(getPayload(c))}'`;
46
+ const data = `--data '${JSON.stringify(getSlackPayload(c))}'`;
42
47
  const webHookUrl = c.buildConfig.common.deploy.slack?.webhookUrl || '';
43
48
  if (webHookUrl) {
44
49
  const cmd = `curl -X POST -H ${contentType} ${data} ${webHookUrl}`;
@@ -34,8 +34,14 @@ const doLatestRelease = (c) => {
34
34
  console.log('doLatestRelease');
35
35
  return deployBuilds(c);
36
36
  };
37
- const doDistributionRelease = (c) => {
38
- console.log('doDistributionRelease');
37
+ const doStagingDistributionRelease = (c) => {
38
+ console.log('doStagingDistributionRelease');
39
+ deployBuilds(c);
40
+ (0, notifySlack_1.notifySlack)(c);
41
+ return true;
42
+ };
43
+ const doProductionDistributionRelease = (c) => {
44
+ console.log('doProductionDistributionRelease');
39
45
  (0, zipBuildsByPlatforms_1.zipBuildsByPlatforms)(c);
40
46
  deployBuilds(c);
41
47
  (0, sentryRelease_1.sentryRelease)(c);
@@ -56,14 +62,19 @@ const releaseAllWithScheme = () => {
56
62
  case constants_1.BuildSchemes.DEV_LATEST:
57
63
  doLatestDevelopmentRelease(c);
58
64
  break;
59
- case constants_1.BuildSchemes.RC_LATEST:
65
+ case constants_1.BuildSchemes.RC_STAGING_LATEST:
66
+ case constants_1.BuildSchemes.RC_PROD_LATEST:
60
67
  doLatestReleaseCandidateRelease(c);
61
68
  break;
62
- case constants_1.BuildSchemes.RELEASE_LATEST:
69
+ case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
70
+ case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
63
71
  doLatestRelease(c);
64
72
  break;
65
- case constants_1.BuildSchemes.RELEASE_DIST:
66
- doDistributionRelease(c);
73
+ case constants_1.BuildSchemes.RELEASE_STAGING_DIST:
74
+ doStagingDistributionRelease(c);
75
+ break;
76
+ case constants_1.BuildSchemes.RELEASE_PROD_DIST:
77
+ doProductionDistributionRelease(c);
67
78
  break;
68
79
  default:
69
80
  throw new Error('Unsupported scheme to release!');
@@ -1,39 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIdentity = exports.ls = exports.rm = exports.cpRemote = exports.cp = void 0;
3
+ exports.rm = exports.cp = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const fsUtils_1 = require("../../../scripts/utils/fsUtils");
6
- const RECURSIVE_FLAG = ' --recursive';
7
6
  const runCmdSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
8
- const runCmdSyncSilent = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'pipe' });
9
- const getIdentity = () => {
10
- runCmdSyncSilent('aws sts get-caller-identity');
11
- };
12
- exports.getIdentity = getIdentity;
13
- const ls = (remotePath) => {
14
- runCmdSyncSilent(`aws s3 ls s3://${remotePath}`);
15
- };
16
- exports.ls = ls;
17
7
  const cp = (source, destination) => {
18
8
  let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
19
9
  if ((0, fsUtils_1.isDir)(source)) {
20
- cmd += RECURSIVE_FLAG;
10
+ cmd += ' --recursive';
21
11
  }
22
12
  runCmdSync(cmd);
23
13
  };
24
14
  exports.cp = cp;
25
- const cpRemote = (source, destination) => {
26
- let cmd = `aws s3 cp s3://${source} s3://${destination} --acl public-read`;
27
- if (source.endsWith('/')) {
28
- cmd += RECURSIVE_FLAG;
29
- }
30
- runCmdSync(cmd);
31
- };
32
- exports.cpRemote = cpRemote;
33
15
  const rm = (remoteDirPath) => {
34
16
  let cmd = `aws s3 rm s3://${remoteDirPath}`;
35
17
  if (remoteDirPath.endsWith('/')) {
36
- cmd += RECURSIVE_FLAG;
18
+ cmd += ' --recursive';
37
19
  }
38
20
  runCmdSync(cmd);
39
21
  };
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.deployToS3 = exports.urlToS3Protocol = void 0;
26
+ exports.deployToS3 = void 0;
27
27
  const path = __importStar(require("path"));
28
28
  const rnv_1 = require("rnv");
29
29
  const aws = __importStar(require("./aws"));
@@ -47,7 +47,6 @@ const urlToS3Protocol = (url) => {
47
47
  const bucketHostnameAwsPostfix = '.s3.amazonaws.com';
48
48
  return hostWithPath.replace(bucketHostnameAwsPostfix, '');
49
49
  };
50
- exports.urlToS3Protocol = urlToS3Protocol;
51
50
  const deployToS3 = async (c) => {
52
51
  const { platform, runtime } = c;
53
52
  const sourcePath = runtime.appDir;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forEachSupportedPlatformFlavour = exports.getProgressMessage = void 0;
3
+ exports.forEachSupportedPlatformFlavour = void 0;
4
4
  const resolvers_1 = require("../resolvers");
5
5
  const getProgressMessage = (platforms, platformIndex, flavours, flavourIndex) => {
6
6
  let string = `\nProcessing "${platforms[platformIndex]}" platform`;
@@ -9,13 +9,8 @@ const getProgressMessage = (platforms, platformIndex, flavours, flavourIndex) =>
9
9
  string += ` (${flavourIndex + 1}/${flavours.length})...`;
10
10
  return string;
11
11
  };
12
- exports.getProgressMessage = getProgressMessage;
13
- const forEachSupportedPlatformFlavour = (c, cb, ignoredPlatforms = []) => {
12
+ const forEachSupportedPlatformFlavour = (c, cb) => {
14
13
  const processPlatformFlavours = (platform, platformIndex, platforms) => {
15
- if (ignoredPlatforms.includes(platform)) {
16
- console.log(`\nSkipping "${platforms[platformIndex]}" platform (${platformIndex + 1}/${platforms.length}).`);
17
- return;
18
- }
19
14
  const processFlavour = (flavour, flavourIndex, flavours) => {
20
15
  console.log(getProgressMessage(platforms, platformIndex, flavours, flavourIndex));
21
16
  const { scheme } = c.runtime;
@@ -29,7 +29,7 @@ const path_1 = require("path");
29
29
  const child_process_1 = require("child_process");
30
30
  const glob = __importStar(require("glob"));
31
31
  const resolvers_1 = require("../resolvers");
32
- const zipDir = (dir, outputFile) => (0, child_process_1.execSync)(`zip ${outputFile} -0 -j ${dir}/*`);
32
+ const zipDir = (srcDir, outputFile) => (0, child_process_1.execSync)(`zip ${outputFile} -0 -j ${srcDir}/*`);
33
33
  const getPlatformBuildsPaths = (c, platformName) => {
34
34
  const { platformBuildsDir } = c.buildConfig.paths;
35
35
  const outputGlob = `${platformBuildsDir}/**/output`;
@@ -282,50 +282,6 @@ class BridgeFromJavaScript(
282
282
  viewModel.subtitleTrack?.let { toJson(it) } ?: DISABLED_SUBTITLE_TRACK
283
283
  }
284
284
 
285
- /*
286
- Returns VIDEO track BITRATE, if not available returns null
287
- */
288
- @JavascriptInterface
289
- fun bridgeJavaScriptToAndroid_GetBitrate(): Int? = runBlocking("bridgeJavaScriptToAndroid_GetBitrate") {
290
- viewModel.videoTrack?.bitrate
291
- }
292
-
293
- /*
294
- Returns VIDEO track RENDITION, if not available returns null
295
- */
296
- @JavascriptInterface
297
- fun bridgeJavaScriptToAndroid_GetRendition(): String? = runBlocking("bridgeJavaScriptToAndroid_GetRendition") {
298
- viewModel.videoTrack?.run {
299
- return@runBlocking "${width}x${height}${formatBitrate(bitrate)}"
300
- }
301
- null
302
- }
303
-
304
- private fun formatBitrate(bitrate: Int): String {
305
- return when {
306
- bitrate <= 0 -> ""
307
- bitrate < 1e3 -> "@${bitrate}bps"
308
- bitrate < 1e6 -> "@${(bitrate / 1e3).roundToInt()}Kbps"
309
- else -> "@${(bitrate / 1e4).roundToInt() / 1e2}Mbps"
310
- }
311
- }
312
-
313
- /*
314
- Returns AUDIO track CODEC, if not available returns null
315
- */
316
- @JavascriptInterface
317
- fun bridgeJavaScriptToAndroid_GetAudioCodec(): String? = runBlocking("bridgeJavaScriptToAndroid_GetAudioCodec") {
318
- viewModel.audioTrack?.codec
319
- }
320
-
321
- /*
322
- Returns VIDEO track CODEC, if not available returns null
323
- */
324
- @JavascriptInterface
325
- fun bridgeJavaScriptToAndroid_GetVideoCodec(): String? = runBlocking("bridgeJavaScriptToAndroid_GetVideoCodec") {
326
- viewModel.videoTrack?.codec
327
- }
328
-
329
285
  /*
330
286
  Set the cookies to localstorage
331
287
  */
@@ -8,10 +8,8 @@ object MediaEventType {
8
8
  const val ERROR = "error"
9
9
  const val PLAYING = "playing"
10
10
  const val PAUSE = "pause"
11
- const val PLAY = "play"
11
+ const val PLAY = "pause"
12
12
  const val ENDED = "ended"
13
- const val CANPLAY = "canplay"
14
- const val LOADEDMETADATA = "loadedmetadata"
15
13
  const val WAITING = "waiting"
16
14
  const val SEEKING = "seeking"
17
15
  const val SEEKED = "seeked"
@@ -68,8 +68,6 @@ class WebViewModel @Inject constructor(
68
68
 
69
69
  private var contentModel: ContentModel? = null
70
70
 
71
- val videoTrack: VideoTrack?
72
- get() = player?.selectedVideoTrack
73
71
  val audioTrack: AudioTrack?
74
72
  get() = player?.selectedAudioTrack
75
73
  val subtitleTrack: TextTrack?
@@ -357,12 +355,6 @@ class WebViewModel @Inject constructor(
357
355
  jsBridge.bridgeAndroidToJavaScript_ErrorEvent(MediaEventType.ERROR, "${event.error.message} - ${event.error.nativeCode}")
358
356
  stopPlayer()
359
357
  }
360
- is LoadedMetadataEvent -> {
361
- jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.LOADEDMETADATA)
362
- }
363
- is CanPlayEvent -> {
364
- jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.CANPLAY)
365
- }
366
358
  is EndedEvent -> {
367
359
  jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.ENDED)
368
360
  }
@@ -373,9 +365,6 @@ class WebViewModel @Inject constructor(
373
365
  view?.setBlackCurtainVisibility(View.GONE)
374
366
  jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.PLAYING)
375
367
  }
376
- is SeekingEvent -> {
377
- jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.SEEKING)
378
- }
379
368
  is SeekedEvent -> {
380
369
  jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.SEEKED)
381
370
  }
package/jest.config.js CHANGED
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
- ...require('../../jest.config.base'),
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'node',
3
4
  transformIgnorePatterns: [
4
5
  '/node_modules/ansi-color/', // compiler error: Octal literal in strict mode
5
6
  '/node_modules/fstream', // compiler error: Octal literal in strict mode
6
7
  ],
7
- testEnvironment: 'node',
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.5-alpha.2284",
3
+ "version": "0.17.5",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NO_CONTENT_FOLDER_PLATFORMS = exports.UNSUPPORTED_PLATFORMS = void 0;
4
- const platforms_1 = require("./platforms");
5
- const UNSUPPORTED_PLATFORMS = [
6
- platforms_1.Platforms.WEBTV,
7
- ];
8
- exports.UNSUPPORTED_PLATFORMS = UNSUPPORTED_PLATFORMS;
9
- const NO_CONTENT_FOLDER_PLATFORMS = [
10
- platforms_1.Platforms.VIDAA,
11
- platforms_1.Platforms.ANDROIDTV,
12
- ];
13
- exports.NO_CONTENT_FOLDER_PLATFORMS = NO_CONTENT_FOLDER_PLATFORMS;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
4
- const resolvers_1 = require("../resolvers");
5
- const delopyLivePlatforms_1 = require("../constants/delopyLivePlatforms");
6
- const distToLiveS3_1 = require("../tasks/deploy/aswS3/distToLiveS3");
7
- const buildSchemes_1 = require("../constants/buildSchemes");
8
- const deployLiveAll = () => {
9
- const version = process.argv[2];
10
- if (!version) {
11
- throw new Error('No version supplied! Please provide distribution version to publish live.');
12
- }
13
- const c = (0, resolvers_1.getBaseConfig)();
14
- c.runtime.scheme = buildSchemes_1.BuildSchemes.RELEASE_DIST;
15
- (0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (o) => {
16
- (0, distToLiveS3_1.checkDistVersionAvailability)(o, version);
17
- }, delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS);
18
- (0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (o) => {
19
- (0, distToLiveS3_1.distToLiveS3)(o, version, delopyLivePlatforms_1.NO_CONTENT_FOLDER_PLATFORMS.includes(o.platform));
20
- }, delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS);
21
- return true;
22
- };
23
- const startTimestamp = Date.now();
24
- deployLiveAll();
25
- const msPerSecond = 1000;
26
- const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
27
- console.log(`deployLiveAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
4
- const resolvers_1 = require("../resolvers");
5
- const delopyLivePlatforms_1 = require("../constants/delopyLivePlatforms");
6
- const distToLiveS3_1 = require("../tasks/deploy/aswS3/distToLiveS3");
7
- const buildSchemes_1 = require("../constants/buildSchemes");
8
- const deployLivePlatform = () => {
9
- const version = process.argv[2];
10
- const platform = process.argv[3];
11
- if (!version) {
12
- throw new Error('No version supplied! Please provide distribution version to publish live.');
13
- }
14
- if (!platform) {
15
- throw new Error('No platform name to use found! Please use rnv platform name as a param.');
16
- }
17
- if (delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS.includes(platform)) {
18
- throw new Error(`Platform "${platform}" not supported!`);
19
- }
20
- const c = (0, resolvers_1.getBaseConfig)();
21
- c.platform = platform;
22
- c.runtime.scheme = buildSchemes_1.BuildSchemes.RELEASE_DIST;
23
- const { scheme } = c.runtime;
24
- const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
25
- const o = { scheme, platform };
26
- supportedFlavours.forEach((flavour, i) => {
27
- console.log((0, forEachSupportedPlatformFlavour_1.getProgressMessage)([platform], 0, supportedFlavours, i));
28
- (0, distToLiveS3_1.checkDistVersionAvailability)({ ...o, flavour }, version);
29
- });
30
- supportedFlavours.forEach((flavour, i) => {
31
- console.log((0, forEachSupportedPlatformFlavour_1.getProgressMessage)([platform], 0, supportedFlavours, i));
32
- (0, distToLiveS3_1.distToLiveS3)({ ...o, flavour }, version, delopyLivePlatforms_1.NO_CONTENT_FOLDER_PLATFORMS.includes(o.platform));
33
- });
34
- return true;
35
- };
36
- const startTimestamp = Date.now();
37
- deployLivePlatform();
38
- const msPerSecond = 1000;
39
- const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
40
- console.log(`deployLivePlatform: done in ${scriptTotalTimeInSeconds} second(s)!`);