@24i/smartapps-bigscreen-rnv-build-engine 0.17.24 → 0.17.25-alpha.2723

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.
@@ -12,10 +12,10 @@ const getBuildVersionForFileName = (c) => {
12
12
  return 'latest.dev';
13
13
  case constants_1.BuildSchemes.RC_STAGING_LATEST:
14
14
  case constants_1.BuildSchemes.RC_PROD_LATEST:
15
- return `latest.rc`;
15
+ return 'latest.rc';
16
16
  case constants_1.BuildSchemes.RELEASE_STAGING_LATEST:
17
17
  case constants_1.BuildSchemes.RELEASE_PROD_LATEST:
18
- return `latest.release`;
18
+ return 'latest.release';
19
19
  default:
20
20
  return (0, resolveBuildVersion_1.resolveBuildVersion)({
21
21
  platform,
@@ -26,7 +26,7 @@ const getBuildVersionForFileName = (c) => {
26
26
  };
27
27
  const resolveBuildFileBaseName = (c) => {
28
28
  const platformName = c.platform;
29
- const scheme = c.runtime.scheme;
29
+ const { scheme } = c.runtime;
30
30
  const { appNameInFileName } = c.buildConfig.common;
31
31
  if (!appNameInFileName) {
32
32
  throw new Error('Missing value for "c.buildConfig.common.appNameInFileName"!');
@@ -22,7 +22,7 @@ const getMergedPullRequestsOffsetFromBranch = (branch) => {
22
22
  }
23
23
  };
24
24
  const resolveBuildVersionOffset = (c) => {
25
- const { branchNames } = c.buildConfig?.common?.git;
25
+ const { branchNames } = c.buildConfig?.common?.git || {};
26
26
  switch (getCurrentGitBranchName()) {
27
27
  case branchNames.dev:
28
28
  return getMergedPullRequestsOffsetFromBranch(branchNames.dist);
@@ -48,10 +48,8 @@ const resolvePackageVersions = (projectDir, { sdkName = '@24i/bigscreen-sdk', wl
48
48
  const packageVersions = [
49
49
  { name: 'WL', version: packageWl?.version || '' },
50
50
  { name: 'SDK', version: packageSdk?.version || '' },
51
- { name: 'DL', version: packageDl?.version || '' }
51
+ { name: 'DL', version: packageDl?.version || '' },
52
52
  ];
53
- return packageVersions.map((item) => {
54
- return item.version ? `${item.name}: ${item.version}` : '';
55
- }).filter(() => { return true; }).join(' | ');
53
+ return packageVersions.map((item) => (item.version ? `${item.name}: ${item.version}` : '')).filter(() => true).join(' | ');
56
54
  };
57
55
  exports.resolvePackageVersions = resolvePackageVersions;
@@ -29,8 +29,9 @@ const path = __importStar(require("path"));
29
29
  const fse = __importStar(require("fs-extra"));
30
30
  const getSafeSchemeString_1 = require("../utils/getSafeSchemeString");
31
31
  const resolvers_1 = require("../resolvers");
32
+ const getArgs_1 = require("./utils/getArgs");
32
33
  const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, flavours, flavourIndex, }) => {
33
- let string = `\nProcessing`;
34
+ let string = '\nProcessing';
34
35
  string += ` "${platforms[platformIndex]}" platform`;
35
36
  string += ` (${platformIndex + 1}/${platforms.length}),`;
36
37
  string += ` "${schemes[schemeIndex]}" scheme"`;
@@ -46,7 +47,6 @@ const buildTask = (options, c) => {
46
47
  const publicBuildDirName = `${flavour}_${platform}-public`;
47
48
  const buildDirPath = path.join(platformBuildsDir, buildDirName);
48
49
  const publicBuildDirPath = path.join(platformBuildsDir, publicBuildDirName);
49
- ;
50
50
  fs.rmSync(buildDirPath, { recursive: true, force: true });
51
51
  fs.rmSync(publicBuildDirPath, { recursive: true, force: true });
52
52
  const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci --mono`;
@@ -60,14 +60,18 @@ const buildTask = (options, c) => {
60
60
  }
61
61
  };
62
62
  const buildAllWithSchemes = () => {
63
- const schemes = process.argv.slice(2);
64
- if (!schemes.length) {
63
+ const { schemes: buildSchemes, include, exclude } = (0, getArgs_1.getArgs)();
64
+ if (!buildSchemes.length) {
65
65
  throw new Error('No scheme name to use found! Please use rnv scheme names as a param.');
66
66
  }
67
67
  const c = (0, resolvers_1.getBaseConfig)();
68
- const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
68
+ const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c).filter((platform) => {
69
+ if (include)
70
+ return include.includes(platform);
71
+ return !exclude.includes(platform);
72
+ });
69
73
  supportedPlatforms.forEach((platform, platformIndex, platforms) => {
70
- schemes.forEach((scheme, schemeIndex, schemes) => {
74
+ buildSchemes.forEach((scheme, schemeIndex, schemes) => {
71
75
  c.runtime.scheme = scheme;
72
76
  const supportedFlavours = (0, resolvers_1.resolveSupportedFlavoursForPlatform)(c, platform);
73
77
  supportedFlavours.forEach((flavour, flavourIndex, flavours) => {
@@ -116,16 +116,16 @@ const schemesMeta = {
116
116
  '*In opened URL, just replace `<VERSION>` placeholder with requested app version.*',
117
117
  '',
118
118
  ],
119
- }
119
+ },
120
120
  };
121
121
  const makeMarkdownFileContentRows = (rnvC) => {
122
- let content = [
122
+ const content = [
123
123
  `# ${rnvC.buildConfig.projectName}`,
124
124
  '## Deploy URLs',
125
125
  '',
126
126
  '---',
127
127
  ];
128
- const supportedSchemes = rnvC.buildConfig.common.deploy.supportedSchemes;
128
+ const { supportedSchemes } = rnvC.buildConfig.common.deploy;
129
129
  const schemesContent = supportedSchemes.reduce((acc, scheme) => {
130
130
  if (!(scheme in schemesMeta)) {
131
131
  throw new Error(`Unknown meta in schemesMeta for scheme: ${scheme}`);
@@ -3,38 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const child_process_1 = require("child_process");
4
4
  const resolvers_1 = require("../resolvers");
5
5
  const constants_1 = require("../constants");
6
- const purgeCloudfrontCache = () => {
7
- const alternateDomainName = process.argv[2];
8
- const scheme = process.argv[3];
9
- if (!scheme) {
10
- throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
11
- }
12
- console.log(`Alternative domain name is ${alternateDomainName}`);
13
- const paths = getPathsToPurge(scheme);
14
- const distributionId = (0, child_process_1.execSync)(`aws cloudfront list-distributions --query "DistributionList.Items[?Aliases.Items[0] == '${alternateDomainName}'].{Id:Id}" --output text`).toString().trim();
15
- if (!distributionId) {
16
- throw new Error('Distribution ID is empty. No matching distribution found for the given alternate domain name.');
17
- }
18
- console.log(`CloudFront Distribution ID: ${distributionId}`);
19
- console.log(`Paths that will be purged: ${paths}`);
20
- const result = (0, child_process_1.execSync)(`aws cloudfront create-invalidation --distribution-id "${distributionId}" --paths ${paths}`).toString();
21
- console.log(result);
22
- };
23
- const getPathsToPurge = (scheme) => {
24
- const supportedSet = getSupportedSet(scheme);
25
- const env = (0, resolvers_1.resolveBuildEnvName)(scheme);
26
- const paths = [];
27
- if (scheme === constants_1.BuildSchemes.RC_PROD_LATEST) {
28
- const limitedSet = getLimitedSetForRC(supportedSet);
29
- limitedSet.forEach(({ platform, flavour }) => {
30
- paths.push(`"/builds/${platform}/${flavour}/latest/rc/${env}*"`);
31
- });
32
- }
33
- else {
34
- throw new Error(`Not supported for scheme: ${scheme}`);
35
- }
36
- return paths.join(' ');
37
- };
38
6
  const getLimitedSetForRC = (supportedSet) => {
39
7
  const limitedSet = [];
40
8
  supportedSet.forEach((item) => {
@@ -64,6 +32,38 @@ const getSupportedSet = (scheme) => {
64
32
  });
65
33
  return supportedSet;
66
34
  };
35
+ const getPathsToPurge = (scheme) => {
36
+ const supportedSet = getSupportedSet(scheme);
37
+ const env = (0, resolvers_1.resolveBuildEnvName)(scheme);
38
+ const paths = [];
39
+ if (scheme === constants_1.BuildSchemes.RC_PROD_LATEST) {
40
+ const limitedSet = getLimitedSetForRC(supportedSet);
41
+ limitedSet.forEach(({ platform, flavour }) => {
42
+ paths.push(`"/builds/${platform}/${flavour}/latest/rc/${env}*"`);
43
+ });
44
+ }
45
+ else {
46
+ throw new Error(`Not supported for scheme: ${scheme}`);
47
+ }
48
+ return paths.join(' ');
49
+ };
50
+ const purgeCloudfrontCache = () => {
51
+ const alternateDomainName = process.argv[2];
52
+ const scheme = process.argv[3];
53
+ if (!scheme) {
54
+ throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
55
+ }
56
+ console.log(`Alternative domain name is ${alternateDomainName}`);
57
+ const paths = getPathsToPurge(scheme);
58
+ const distributionId = (0, child_process_1.execSync)(`aws cloudfront list-distributions --query "DistributionList.Items[?Aliases.Items[0] == '${alternateDomainName}'].{Id:Id}" --output text`).toString().trim();
59
+ if (!distributionId) {
60
+ throw new Error('Distribution ID is empty. No matching distribution found for the given alternate domain name.');
61
+ }
62
+ console.log(`CloudFront Distribution ID: ${distributionId}`);
63
+ console.log(`Paths that will be purged: ${paths}`);
64
+ const result = (0, child_process_1.execSync)(`aws cloudfront create-invalidation --distribution-id "${distributionId}" --paths ${paths}`).toString();
65
+ console.log(result);
66
+ };
67
67
  const startTimestamp = Date.now();
68
68
  purgeCloudfrontCache();
69
69
  const msPerSecond = 1000;
@@ -60,23 +60,21 @@ const getPlatformPackagesList = (c) => {
60
60
  const platformObj = {
61
61
  platformName: platform,
62
62
  packages: supportedFlavours.map((appConfigID) => {
63
- const c = (0, resolvers_1.getBaseConfig)({
64
- platform, scheme, appConfigID, productionPackagesHostedUrl: true
63
+ const config = (0, resolvers_1.getBaseConfig)({
64
+ platform, scheme, appConfigID, productionPackagesHostedUrl: true,
65
65
  });
66
66
  return {
67
- name: (0, resolvers_1.resolveBuildFileName)(c),
67
+ name: (0, resolvers_1.resolveBuildFileName)(config),
68
68
  flavour: appConfigID,
69
69
  hostedUrl: `${(0, resolvers_1.resolveProductionPackagesBaseUrl)(c)}/public`,
70
70
  };
71
- })
71
+ }),
72
72
  };
73
73
  packagesList.push(platformObj);
74
74
  });
75
75
  return packagesList;
76
76
  };
77
- const getAppCenterToken = () => {
78
- return process.env[ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES] || '';
79
- };
77
+ const getAppCenterToken = () => process.env[ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES] || '';
80
78
  const deployProductionPackagesToAppCenter = (c) => {
81
79
  console.log('deployProductionPackagesToAppCenter');
82
80
  const appCenterConfig = getAppCenterConfig(c);
@@ -88,13 +86,14 @@ const deployProductionPackagesToAppCenter = (c) => {
88
86
  const { appName } = c.buildConfig.common;
89
87
  if (!centerAppName)
90
88
  throw new Error('Missing AppName in appCenterConfig');
91
- if (!token)
89
+ if (!token) {
92
90
  throw new Error(`Missing App Center Token. To fix it, set "${ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES}" env variable`);
91
+ }
93
92
  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`);
93
+ const { dir, name: fileName } = path.parse(originalZipPath);
94
+ const zipPath = path.join(dir, `${fileName}_${formatDateTime(new Date())}.zip`);
96
95
  fs.renameSync(originalZipPath, zipPath);
97
- const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_PRODUCTION_PACKAGES.md`;
96
+ const tempReleaseNotesPath = 'RELEASE_NOTES_APPCENTER_PRODUCTION_PACKAGES.md';
98
97
  if (fs.existsSync(tempReleaseNotesPath)) {
99
98
  fs.unlinkSync(tempReleaseNotesPath);
100
99
  }
@@ -109,13 +108,13 @@ const deployProductionPackagesToAppCenter = (c) => {
109
108
  ...packages.reduce((accPackages, { name, hostedUrl }) => ([
110
109
  ...accPackages,
111
110
  ` - ${name}`,
112
- ` - App URL: ${hostedUrl}`
111
+ ` - App URL: ${hostedUrl}`,
113
112
  ]), []),
114
113
  ]), []),
115
114
  ];
116
115
  const packagesMarkdown = notes.join(newLine);
117
116
  (0, child_process_1.execSync)(`echo "${packagesMarkdown}" >> ${tempReleaseNotesPath}`);
118
- console.log(`Deploying Production packages to AppCenter.ms...`);
117
+ console.log('Deploying Production packages to AppCenter.ms...');
119
118
  (0, appCenter_1.appCenterRelease)({
120
119
  projectName: centerAppName,
121
120
  buildVersion: '0',
@@ -71,6 +71,7 @@ const doDistributionRelease = (c, schemes) => {
71
71
  const schemeArr = schemes.map((scheme) => scheme?.type).filter(Boolean);
72
72
  (0, notifySlack_1.notifySlack)(c, schemeArr);
73
73
  };
74
+ const findSchemes = (schemesArray, schemesToFind) => schemesToFind.map((schemeToFind) => (schemesArray.find((schemeObj) => schemeObj.type === schemeToFind)));
74
75
  const releaseAllWithSchemes = () => {
75
76
  const schemes = process.argv.slice(2);
76
77
  if (!schemes.length) {
@@ -148,9 +149,6 @@ const releaseAllWithSchemes = () => {
148
149
  console.log(JSON.stringify(deployLocations, null, spacing));
149
150
  return true;
150
151
  };
151
- const findSchemes = (schemesArray, schemesToFind) => {
152
- return schemesToFind.map((schemeToFind) => (schemesArray.find((schemeObj) => schemeObj.type === schemeToFind)));
153
- };
154
152
  const startTimestamp = Date.now();
155
153
  releaseAllWithSchemes();
156
154
  const msPerSecond = 1000;
@@ -3,19 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notifySlack = exports.getFailSlackPayload = exports.getSuccessSlackPayload = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const slackBlockKitBuilder_1 = require("../utils/slackBlockKitBuilder");
6
- const getSuccessSlackPayload = (params) => {
7
- const { appName, suitestConfigId } = params;
8
- const title = `Smoke test *succeeded* for *${appName}* app! :large_green_circle:`;
9
- return getSlackPayload({ title, suitestConfigId });
10
- };
11
- exports.getSuccessSlackPayload = getSuccessSlackPayload;
12
- const getFailSlackPayload = (params) => {
13
- const { appName, suitestConfigId, logsZipUrl } = params;
14
- const title = `Smoke test *failed* for *${appName}* app! :red_circle:`;
15
- return getSlackPayload({ title, suitestConfigId, logsZipUrl });
16
- ;
17
- };
18
- exports.getFailSlackPayload = getFailSlackPayload;
19
6
  const getSlackPayload = (params) => {
20
7
  const { title, suitestConfigId, logsZipUrl } = params;
21
8
  return {
@@ -38,6 +25,18 @@ const getSlackPayload = (params) => {
38
25
  ],
39
26
  };
40
27
  };
28
+ const getSuccessSlackPayload = (params) => {
29
+ const { appName, suitestConfigId } = params;
30
+ const title = `Smoke test *succeeded* for *${appName}* app! :large_green_circle:`;
31
+ return getSlackPayload({ title, suitestConfigId });
32
+ };
33
+ exports.getSuccessSlackPayload = getSuccessSlackPayload;
34
+ const getFailSlackPayload = (params) => {
35
+ const { appName, suitestConfigId, logsZipUrl } = params;
36
+ const title = `Smoke test *failed* for *${appName}* app! :red_circle:`;
37
+ return getSlackPayload({ title, suitestConfigId, logsZipUrl });
38
+ };
39
+ exports.getFailSlackPayload = getFailSlackPayload;
41
40
  const notifySlack = (webHookUrl, data) => {
42
41
  const contentType = '"Content-type: application/json"';
43
42
  const cmd = `curl -X POST -H ${contentType} --data '${data}' ${webHookUrl}`;
@@ -30,8 +30,8 @@ const fs = __importStar(require("fs"));
30
30
  const aws = __importStar(require("../../tasks/deploy/aswS3/aws"));
31
31
  const notifySlack_1 = require("./notifySlack");
32
32
  const execTestbedCmd = (cmd) => {
33
- const configIdRegex = /^.*app configuration id: ([a-z\d\-]+)/m;
34
- return new Promise((resolve, reject) => {
33
+ const configIdRegex = /^.*app configuration id: ([a-z\d-]+)/m;
34
+ return new Promise((resolve) => {
35
35
  const child = (0, child_process_1.exec)(cmd, (error, stdout) => {
36
36
  const matches = stdout.match(configIdRegex) || [];
37
37
  const suitestConfigId = matches[1] ?? '';
@@ -68,6 +68,15 @@ const sendFailToSlack = (c, params) => {
68
68
  (0, notifySlack_1.notifySlack)(webHookUrl, JSON.stringify(data));
69
69
  };
70
70
  exports.sendFailToSlack = sendFailToSlack;
71
+ const formatDateTime = (date) => {
72
+ const year = date.getFullYear();
73
+ const month = String(date.getMonth() + 1).padStart(2, '0');
74
+ const day = String(date.getDate()).padStart(2, '0');
75
+ const h = String(date.getHours()).padStart(2, '0');
76
+ const m = String(date.getMinutes()).padStart(2, '0');
77
+ const s = String(date.getSeconds()).padStart(2, '0');
78
+ return `${year}-${month}-${day}T${h}-${m}-${s}`;
79
+ };
71
80
  const generateLogsZipName = (c) => {
72
81
  const appNameInFileName = c.buildConfig.common.appNameInFileName ?? '';
73
82
  return `${appNameInFileName}_${formatDateTime(new Date())}.zip`;
@@ -79,15 +88,6 @@ const zipLogFiles = (c, outputZipFilePath, logDir) => {
79
88
  (0, child_process_1.execSync)(`zip ${outputZipFilePath} -0 -r *`, { cwd: srcDir });
80
89
  };
81
90
  exports.zipLogFiles = zipLogFiles;
82
- const formatDateTime = (date) => {
83
- const year = date.getFullYear();
84
- const month = String(date.getMonth() + 1).padStart(2, '0');
85
- const day = String(date.getDate()).padStart(2, '0');
86
- const h = String(date.getHours()).padStart(2, '0');
87
- const m = String(date.getMinutes()).padStart(2, '0');
88
- const s = String(date.getSeconds()).padStart(2, '0');
89
- return `${year}-${month}-${day}T${h}-${m}-${s}`;
90
- };
91
91
  const logsDirPathOnS3 = () => 'testbed';
92
92
  const uploadLogsZipToS3 = (c, zipFilePath) => {
93
93
  const zipFileName = path.parse(zipFilePath).base;
@@ -34,16 +34,16 @@ const smokeTest = async () => {
34
34
  const suitestUserName = process.env.SUITEST_USERNAME ?? '';
35
35
  const suitestUserPassword = process.env.SUITEST_PASSWORD ?? '';
36
36
  const logDir = './testbed_log/';
37
- let cmd = command ?? [
38
- `npx testbed run`,
37
+ const cmd = command ?? [
38
+ 'npx testbed run',
39
39
  tokenId ? `-k ${tokenId}` : '',
40
40
  tokenPassword ? `-p ${tokenPassword}` : '',
41
41
  suitestUserName ? `-u ${suitestUserName}` : '',
42
42
  suitestUserPassword ? `-up ${suitestUserPassword}` : '',
43
- `-C .suitestrc_tizen`,
43
+ '-C .suitestrc_tizen',
44
44
  `--log-dir ${logDir}`,
45
- `--log-level "normal"`,
46
- `-- mocha "./test/platforms/common/smoke.test-suite.ts"`,
45
+ '--log-level "normal"',
46
+ '-- mocha "./test/platforms/common/smoke.test-suite.ts"',
47
47
  ].filter(Boolean).join(' ');
48
48
  const c = (0, resolvers_1.getBaseConfig)({ platform: constants_1.Platforms.TIZEN });
49
49
  const { status, suitestConfigId } = await (0, smokeTestUtils_1.execTestbedCmd)(cmd);
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getArgs = void 0;
4
+ const getArgs = () => process.argv.reduce((args, arg) => {
5
+ if (arg.startsWith('--')) {
6
+ const longArg = arg.split('=');
7
+ const longArgFlag = longArg[0].slice(2);
8
+ let longArgValue = longArg.length > 1 ? longArg[1] : true;
9
+ if (typeof longArgValue === 'string' && longArgValue.includes(',')) {
10
+ longArgValue = longArgValue.split(',');
11
+ }
12
+ args[longArgFlag] = longArgValue;
13
+ }
14
+ else if (arg.startsWith('-')) {
15
+ const flags = arg.slice(1).split('');
16
+ flags.forEach((flag) => {
17
+ args[flag] = true;
18
+ });
19
+ }
20
+ return args;
21
+ }, {});
22
+ exports.getArgs = getArgs;
@@ -42,10 +42,9 @@ const resolvers_1 = require("../../resolvers");
42
42
  const copyTheoPlayerLibs_1 = require("../../utils/copyTheoPlayerLibs");
43
43
  const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
44
44
  const constants_1 = require("../../constants");
45
+ const buildGradleFileName = 'build.gradle';
45
46
  const flavourName = 'bigscreenAppstage';
46
- const capitalizeFirstLetter = (str) => {
47
- return str.charAt(0).toUpperCase() + str.slice(1);
48
- };
47
+ const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);
49
48
  const buildAndroidTVProject = async (c) => {
50
49
  rnv_1.Logger.logTask('buildAndroidTVProject');
51
50
  await (0, sdk_webpack_2.buildCoreWebpackProject)(c);
@@ -89,7 +88,6 @@ const buildAndroidTVProject = async (c) => {
89
88
  exports.buildAndroidTVProject = buildAndroidTVProject;
90
89
  const configureSigning = (c) => {
91
90
  rnv_1.Logger.logTask('configureSigning');
92
- const buildGradleFileName = 'build.gradle';
93
91
  const buildGradleFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'app', buildGradleFileName);
94
92
  if (c.runtime.scheme === constants_1.BuildSchemes.DEBUG) {
95
93
  const injects = [{
@@ -136,7 +134,6 @@ const configureSigning = (c) => {
136
134
  };
137
135
  const configureProject = (c) => {
138
136
  rnv_1.Logger.logTask('configureProject');
139
- const buildGradleFileName = 'build.gradle';
140
137
  const buildGradleFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'app', buildGradleFileName);
141
138
  const version = semver.coerce(rnv_1.Common.getAppVersion(c, c.platform));
142
139
  const semVerObj = semver.parse(version);
@@ -197,13 +194,12 @@ const getHostedAppEntryUrl = (c) => {
197
194
  };
198
195
  const configureEntryUrl = (c) => {
199
196
  rnv_1.Logger.logTask('configureEntryUrl');
200
- const buildGradleFileName = 'build.gradle';
201
197
  const buildGradleFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'app', buildGradleFileName);
202
198
  const entryUrl = getHostedAppEntryUrl(c);
203
- const theoLicense = process.env['THEO_LICENSE'] ||
204
- rnv_1.Common.getConfigProp(c, c.platform, 'theoLicense', '');
205
- const npawAccountCode = process.env['NPAW_ACCOUNT_CODE'] ||
206
- rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
199
+ const theoLicense = process.env.THEO_LICENSE
200
+ || rnv_1.Common.getConfigProp(c, c.platform, 'theoLicense', '');
201
+ const npawAccountCode = process.env.NPAW_ACCOUNT_CODE
202
+ || rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
207
203
  const injects = [{
208
204
  pattern: '{{APP_URL}}',
209
205
  override: entryUrl,
@@ -217,10 +213,23 @@ const configureEntryUrl = (c) => {
217
213
  rnv_1.Common.addSystemInjects(c, injects);
218
214
  rnv_1.FileUtils.writeCleanFile(buildGradleFilePath, buildGradleFilePath, injects, null, c);
219
215
  };
216
+ const configureAndroidProperties = async (c) => {
217
+ rnv_1.Logger.logTask('configureAndroidProperties');
218
+ let sdkDir = c.buildConfig?.sdks?.ANDROID_SDK || '';
219
+ if (rnv_1.Utils.isSystemWin) {
220
+ sdkDir = sdkDir.replace(/\\/g, '/');
221
+ }
222
+ const localPropertiesFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'local.properties');
223
+ const fileContent = `## Generated by ReNative (https://renative.org)
224
+ # from @24i/smartapps-bigscreen-rnv-build-engine package
225
+ sdk.dir=${sdkDir}`;
226
+ fs.writeFileSync(localPropertiesFilePath, fileContent);
227
+ return true;
228
+ };
220
229
  const configureAndroidTVProject = async (c) => {
221
230
  rnv_1.Logger.logTask('configureAndroidTVProject');
222
231
  c.runtime.platformBuildsProjectPath = rnv_1.Common.getPlatformProjectDir(c);
223
- const platform = c.platform;
232
+ const { platform } = c;
224
233
  const resSubPath = `app/src/${flavourName}/res`;
225
234
  await rnv_1.ProjectManager.copyAssetsFolder(c, platform, resSubPath);
226
235
  (0, copyEnvironmentFolder_1.copyEnvFolderInProject)(c, resSubPath);
@@ -236,19 +245,6 @@ const configureAndroidTVProject = async (c) => {
236
245
  (0, copyTheoPlayerLibs_1.copyTheoPlayerLibs)(c);
237
246
  };
238
247
  exports.configureAndroidTVProject = configureAndroidTVProject;
239
- const configureAndroidProperties = async (c) => {
240
- rnv_1.Logger.logTask('configureAndroidProperties');
241
- let sdkDir = c.buildConfig?.sdks?.ANDROID_SDK || '';
242
- if (rnv_1.Utils.isSystemWin) {
243
- sdkDir = sdkDir.replace(/\\/g, '/');
244
- }
245
- const localPropertiesFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'local.properties');
246
- const fileContent = `## Generated by ReNative (https://renative.org)
247
- # from @24i/smartapps-bigscreen-rnv-build-engine package
248
- sdk.dir=${sdkDir}`;
249
- fs.writeFileSync(localPropertiesFilePath, fileContent);
250
- return true;
251
- };
252
248
  const getSdkInstallerUrl = () => {
253
249
  const folderUrl = 'https://dl.google.com/android/repository';
254
250
  switch (os.platform()) {
@@ -282,13 +278,13 @@ const handleAndroidTVSdk = async (c) => {
282
278
  rnv_1.Logger.logInfo(`Downloading ${sdkName} SDK...`);
283
279
  rnv_1.Logger.logDebug(`Downloading ${sdkName} SDK to ${downloadedFilePath} from ${ANDROID_SDK_INSTALLER_URL}`);
284
280
  await (0, services_1.download)(ANDROID_SDK_INSTALLER_URL, downloadedFilePath);
285
- rnv_1.Logger.logInfo(`Unpacking...`);
281
+ rnv_1.Logger.logInfo('Unpacking...');
286
282
  rnv_1.Logger.logDebug(`Unpacking from ${downloadedFilePath} to ${unzippedDirPath}`);
287
283
  (0, services_1.unzip)(downloadedFilePath, unzippedDirPath);
288
284
  fs.mkdirSync(`${installPath}/cmdline-tools/latest`, { recursive: true });
289
285
  (0, child_process_1.execSync)(`cp -r ${unzippedDirPath}/cmdline-tools/. ${installPath}/cmdline-tools/latest`);
290
- rnv_1.Logger.logInfo(`Installing...`);
291
- rnv_1.Logger.logDebug(`Accepting licenses`);
286
+ rnv_1.Logger.logInfo('Installing...');
287
+ rnv_1.Logger.logDebug('Accepting licenses');
292
288
  (0, child_process_1.execSync)(`yes | ${installPath}/cmdline-tools/latest/bin/sdkmanager --licenses`);
293
289
  rnv_1.Logger.logDebug(`Installing SDKs ${sdksToInstall}`);
294
290
  (0, child_process_1.execSync)(`${installPath}/cmdline-tools/latest/bin/sdkmanager ${sdksToInstall}`);
@@ -120,7 +120,7 @@ const setTizenCertificate = (c) => {
120
120
  throw new Error(err);
121
121
  }
122
122
  if (!TIZEN_AUTHOR_CERTIFICATE_PASSWORD) {
123
- const err = `'process.env.TIZEN_AUTHOR_CERTIFICATE_PASSWORD' password is not set`;
123
+ const err = '\'process.env.TIZEN_AUTHOR_CERTIFICATE_PASSWORD\' password is not set';
124
124
  if (isDebug) {
125
125
  rnv_1.Logger.logWarning(err);
126
126
  return false;
@@ -128,7 +128,7 @@ const setTizenCertificate = (c) => {
128
128
  throw new Error(err);
129
129
  }
130
130
  if (!tizenCliPath) {
131
- const err = `'c.cli.tizen\' is not set`;
131
+ const err = '\'c.cli.tizen\' is not set';
132
132
  if (isDebug) {
133
133
  rnv_1.Logger.logWarning(err);
134
134
  return false;
@@ -46,7 +46,7 @@ const uploadPublicDir = (sourcePath, uploadPath) => {
46
46
  aws.cp(publicDirLocalPath, publicDirRemotePath);
47
47
  };
48
48
  const deployToS3 = async (c) => {
49
- rnv_1.Logger.logTask(`deployToS3`);
49
+ rnv_1.Logger.logTask('deployToS3');
50
50
  const { platform, runtime } = c;
51
51
  const schemeDirName = c.program.schemeFolder ? (0, getSafeSchemeString_1.getSafeSchemeString)(runtime.scheme) : '';
52
52
  const sourcePath = path.join(c.paths.project.builds.dir, schemeDirName, `${runtime.appId}_${platform}`);
@@ -28,7 +28,7 @@ const resolvers_1 = require("../../../resolvers");
28
28
  const resolveGenericRnvConfig_1 = require("../../../resolvers/resolveGenericRnvConfig");
29
29
  const aws = __importStar(require("./aws"));
30
30
  const getUploadPath = (options, version) => {
31
- const { packageVersion } = (0, resolveGenericRnvConfig_1.getBaseConfig)().buildConfig?.common;
31
+ const { packageVersion } = (0, resolveGenericRnvConfig_1.getBaseConfig)().buildConfig?.common || {};
32
32
  const s3BucketAppPath = (0, resolvers_1.resolveS3BucketAppPath)(options);
33
33
  if (!s3BucketAppPath) {
34
34
  return undefined;
@@ -55,8 +55,7 @@ const checkDistVersionAvailability = (options, version) => {
55
55
  process.stdout.write('OK.\n');
56
56
  }
57
57
  catch {
58
- throw new Error(`Failed to locate distribution version ${version} for platform "${options.platform}" flavour ${options.flavour}.
59
- attempted to look at: ${uploadPath}.\n`);
58
+ throw new Error(`Failed to locate distribution version ${version} for platform "${options.platform}" flavour ${options.flavour}. Attempted to look at: ${uploadPath}.\n`);
60
59
  }
61
60
  return true;
62
61
  };
@@ -38,7 +38,7 @@ const PARAM_KEYS = {
38
38
  productionPackagesHostedUrl: {
39
39
  key: 'productionPackagesHostedUrl',
40
40
  description: 'Uses production package hosted URL of App',
41
- }
41
+ },
42
42
  };
43
43
  const makeZipOutput = (c) => {
44
44
  const platformBuildDir = rnv_1.Common.getPlatformBuildDir(c);
@@ -9,7 +9,7 @@ const PARAM_KEYS = {
9
9
  schemeFolder: {
10
10
  key: 'schemeFolder',
11
11
  description: 'Flag to use scheme folder in path of build',
12
- }
12
+ },
13
13
  };
14
14
  const { logErrorPlatform } = rnv_1.PlatformManager;
15
15
  const { logTask } = rnv_1.Logger;
@@ -38,8 +38,8 @@ const taskRnvPlatformConfigure = async (c, parentTask, originTask) => {
38
38
  await rnv_1.TaskManager.executeTask(c, TASK_PROJECT_CONFIGURE, TASK_PLATFORM_CONFIGURE, originTask);
39
39
  await rnv_1.PlatformManager.isPlatformSupported(c);
40
40
  await (0, schemeParser_1.isBuildSchemeSupported)(c);
41
- if (platform === constants_1.Platforms.ANDROIDTV ||
42
- platform === constants_1.Platforms.FIRETV) {
41
+ if (platform === constants_1.Platforms.ANDROIDTV
42
+ || platform === constants_1.Platforms.FIRETV) {
43
43
  await (0, sdks_1.handlePlatformSdk)(c);
44
44
  }
45
45
  else {
@@ -74,11 +74,11 @@ android {
74
74
  bigscreenAppstage {
75
75
  // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
76
76
  dimension "bridge"
77
- versionCode 2025082850
78
- versionName "5.0.13"
79
- applicationId "com.fli.android.newsmaxapp"
80
- resValue "string", "app_name", "Newsmax TV"
81
-
77
+ versionCode {{APP_VERSION_CODE}}
78
+ versionName "{{APP_VERSION_NAME}}"
79
+ applicationId "{{APP_ID}}"
80
+ resValue "string", "app_name", "{{configProps.appName}}"
81
+ {{SIGNING_CONFIG_REF}}
82
82
  }
83
83
  }
84
84
  }
@@ -1,4 +1,5 @@
1
1
  android.enableJetifier=true
2
2
  android.useAndroidX=true
3
+ org.gradle.daemon=false
3
4
  org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
4
5
  # android.enableR8=false -- has no longer any effect, R8 is always used and cannot be disabled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.24",
3
+ "version": "0.17.25-alpha.2723",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {