@24i/smartapps-bigscreen-rnv-build-engine 0.17.2-alpha.2160 → 0.17.2-alpha.2162

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.
@@ -23,35 +23,64 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.handleAndroidTVSdk = exports.configureAndroidTVProject = void 0;
26
+ exports.handleAndroidTVSdk = exports.configureAndroidTVProject = exports.buildAndroidTVProject = void 0;
27
27
  const fs = __importStar(require("fs"));
28
28
  const path = __importStar(require("path"));
29
29
  const os = __importStar(require("os"));
30
+ const semver = __importStar(require("semver"));
30
31
  const child_process_1 = require("child_process");
31
32
  const rnv_1 = require("rnv");
32
33
  const sdk_webpack_1 = require("@rnv/sdk-webpack");
34
+ const sdk_webpack_2 = require("../sdk-webpack");
33
35
  const sdk_utils_1 = require("../sdk-utils");
34
36
  const services_1 = require("../sdk-utils/sdk-installer/services");
35
37
  const constants_1 = require("../../constants");
38
+ const buildAndroidTVProject = async (c) => {
39
+ rnv_1.Logger.logTask('buildAndroidTVProject');
40
+ await (0, sdk_webpack_2.buildCoreWebpackProject)(c);
41
+ if (!c.program.hosted) {
42
+ const projectDir = rnv_1.Common.getPlatformProjectDir(c);
43
+ const projectParentDir = path.join(projectDir, '..');
44
+ const tOut = path.join(projectParentDir, 'output');
45
+ const flavourName = 'bigscreenAppstage';
46
+ const apkFileName = `app-${flavourName}-debug.apk`;
47
+ const apkFilePath = path.join(projectDir, `app/build/outputs/apk/${flavourName}/debug/${apkFileName}`);
48
+ const gradlew = './gradlew';
49
+ (0, child_process_1.execSync)(`cd ${projectDir} && ${gradlew} assembleBigscreenAppstageDebug`);
50
+ if (!fs.existsSync(tOut)) {
51
+ fs.mkdirSync(tOut);
52
+ }
53
+ const outputFilePath = path.join(tOut, apkFileName);
54
+ fs.copyFileSync(apkFilePath, outputFilePath);
55
+ rnv_1.Logger.logSuccess(`Your APK package is located in ${rnv_1.Logger.chalk().cyan(tOut)} .`);
56
+ }
57
+ };
58
+ exports.buildAndroidTVProject = buildAndroidTVProject;
36
59
  const configureProject = (c) => {
37
60
  rnv_1.Logger.logTask('configureProject');
38
- const configFile = 'appinfo.json';
39
- const configFileSource = path.join(rnv_1.Common.getTemplateProjectDir(c), configFile);
40
- const configFileDest = path.join(rnv_1.Common.getPlatformProjectDir(c), configFile);
41
- rnv_1.FileUtils.writeCleanFile(configFileSource, configFileDest, [], null, c);
42
- let fileContent = fs.readFileSync(configFileDest).toString();
43
- fileContent = fileContent.replace(/"true"/g, 'true');
44
- fileContent = fileContent.replace(/"false"/g, 'false');
45
- fs.writeFileSync(configFileDest, fileContent);
46
- return true;
61
+ const buildGradleFileName = 'build.gradle';
62
+ const buildGradleFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'app', buildGradleFileName);
63
+ const p = c.buildConfig.platforms[c.platform] || {};
64
+ const versionName = semver.coerce(rnv_1.Common.getAppVersion(c, c.platform));
65
+ const versionCode = 123;
66
+ const injects = [{
67
+ pattern: '{{APP_VERSION_CODE}}',
68
+ override: versionCode,
69
+ }, {
70
+ pattern: '{{APP_VERSION_NAME}}',
71
+ override: versionName,
72
+ }];
73
+ rnv_1.Common.addSystemInjects(c, injects);
74
+ rnv_1.FileUtils.writeCleanFile(buildGradleFilePath, buildGradleFilePath, injects, null, c);
47
75
  };
48
76
  const configureAndroidTVProject = async (c) => {
49
- rnv_1.Logger.logTask('configureAndroidTVProjectX');
77
+ rnv_1.Logger.logTask('configureAndroidTVProject');
50
78
  c.runtime.platformBuildsProjectPath = rnv_1.Common.getPlatformProjectDir(c);
51
79
  const platform = constants_1.Platforms.ANDROIDTV;
52
80
  await rnv_1.ProjectManager.copyAssetsFolder(c, platform);
53
81
  await (0, sdk_webpack_1.configureCoreWebProject)(c);
54
82
  await configureAndroidProperties(c);
83
+ configureProject(c);
55
84
  const gradlew = path.join(rnv_1.Common.getPlatformProjectDir(c), 'gradlew');
56
85
  fs.chmodSync(gradlew, '755');
57
86
  await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
@@ -89,10 +118,12 @@ const handleAndroidTVSdk = async (c) => {
89
118
  const rnvSdkKey = 'ANDROID_SDK';
90
119
  const sdkName = 'android';
91
120
  const sdksToInstall = '"build-tools;30.0.2" "emulator" "patcher;v4" "platform-tools" "platforms;android-30"';
121
+ rnv_1.Logger.logInfo(`Check ${sdkName} SDK at ${ANDROID_SDK}`);
92
122
  const isInstalledSDK = ANDROID_SDK ? fs.existsSync(ANDROID_SDK) : false;
93
123
  if (!isInstalledSDK) {
94
124
  if (fs.existsSync(installPath)) {
95
125
  await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installPath);
126
+ rnv_1.Logger.logInfo(`Used ${sdkName} SDK at ${c.buildConfig?.sdks?.ANDROID_SDK}`);
96
127
  }
97
128
  else {
98
129
  const parsedZipPath = path.parse(ANDROID_SDK_INSTALLER_URL);
@@ -111,7 +142,12 @@ const handleAndroidTVSdk = async (c) => {
111
142
  (0, child_process_1.execSync)(`yes | ${installPath}/cmdline-tools/latest/bin/sdkmanager --licenses`);
112
143
  rnv_1.Logger.logDebug(`Installing SDKs ${sdksToInstall}`);
113
144
  (0, child_process_1.execSync)(`${installPath}/cmdline-tools/latest/bin/sdkmanager ${sdksToInstall}`);
145
+ rnv_1.Logger.logSuccess(`SDK successfully installed at: ${installPath}`);
146
+ await (0, sdk_utils_1.registerSdkPath)(c, rnvSdkKey, installPath);
114
147
  }
115
148
  }
149
+ else {
150
+ rnv_1.Logger.logInfo(`Used ${sdkName} SDK at ${c.buildConfig?.sdks?.ANDROID_SDK}`);
151
+ }
116
152
  };
117
153
  exports.handleAndroidTVSdk = handleAndroidTVSdk;
@@ -62,7 +62,6 @@ const buildFn = async (c, parentTask, originTask) => {
62
62
  await (0, sdks_1.handlePlatformSdk)(c);
63
63
  await rnv_1.TaskManager.executeOrSkipTask(c, TASK_PACKAGE, TASK_BUILD, originTask);
64
64
  switch (platform) {
65
- case constants_1.Platforms.ANDROIDTV:
66
65
  case constants_1.Platforms.ENTONE:
67
66
  case constants_1.Platforms.HBBTV:
68
67
  case constants_1.Platforms.KREATV:
@@ -83,6 +82,9 @@ const buildFn = async (c, parentTask, originTask) => {
83
82
  await sdks_1.SDKWebos.buildWebOSProject(c);
84
83
  renameOutput(c);
85
84
  break;
85
+ case constants_1.Platforms.ANDROIDTV:
86
+ await sdks_1.SDKAndroidtv.buildAndroidTVProject(c);
87
+ break;
86
88
  default:
87
89
  rnv_1.PlatformManager.logErrorPlatform(c);
88
90
  }
@@ -70,233 +70,22 @@ android {
70
70
 
71
71
  flavorDimensions "bridge"
72
72
  productFlavors {
73
- portal {
74
- dimension "bridge"
75
- versionCode 2003000
76
- versionName "2.3"
77
- resValue "string", "app_name", "24i Portal"
78
- }
79
- portalDrm {
80
- dimension "bridge"
81
- applicationIdSuffix ".drmCallback"
82
- versionCode 1006000
83
- versionName "1.6"
84
- resValue "string", "app_name", "24i Portal DRM"
85
- }
86
- smartOTT {
87
- dimension "bridge"
88
- applicationIdSuffix ".smartOTT"
89
- versionCode 1
90
- versionName "1.0"
91
- resValue "string", "app_name", "SmartOTT"
92
- }
93
- hummingbird {
94
- dimension "bridge"
95
- applicationIdSuffix ".hummingbird"
96
- versionCode 1
97
- versionName "1.0"
98
- resValue "string", "app_name", "Hummingbird"
99
- }
100
- tennisChannel {
101
- dimension "bridge"
102
- applicationId "com.tennischannel.tceverywhere.amazon"
103
- versionCode 46
104
- versionName "1.1.1"
105
- resValue "string", "app_name", "Tennis Channel Sinclair"
106
- }
107
- cineClick {
108
- dimension "bridge"
109
- applicationIdSuffix ".cineclick"
110
- versionCode 1
111
- versionName "1.0"
112
- resValue "string", "app_name", "Cineclick"
113
- }
114
- hereMedia {
115
- dimension "bridge"
116
- applicationIdSuffix ".heretv"
117
- versionCode 1
118
- versionName "1.0"
119
- resValue "string", "app_name", "Here TV"
120
- }
121
- fuboTV {
122
- dimension "bridge"
123
- applicationIdSuffix ".fuboTV"
124
- versionCode 1
125
- versionName "1.0"
126
- resValue "string", "app_name", "[Fubo TV]"
127
- }
128
- sentai {
129
- dimension "bridge"
130
- applicationIdSuffix ".sentai"
131
- versionCode 1007002
132
- versionName "1.7.2"
133
- resValue "string", "app_name", "HIDIVE"
134
- // uncomment for signing testing builds
135
- // signingConfig signingConfigs.hidiverelease
136
- }
137
- sentaiandroidtv {
138
- dimension "bridge"
139
- applicationId 'com.twentyfouri.androidtv.hidive'
140
- versionCode 1010000
141
- versionName "1.1.0"
142
- resValue "string", "app_name", "HIDIVE"
143
- // uncomment for signing testing builds
144
- // signingConfig signingConfigs.hidiverelease
145
- }
146
- newsmax {
147
- dimension "bridge"
148
- //Android TV
149
- applicationId "com.fli.android.newsmaxapp"
150
- versionCode 1000300
151
- versionName "1.0.2-androidTV"
152
- resValue "string", "app_name", "Newsmax"
153
- //FireTV
154
- // applicationId "com.fli.googletv.newsmaxapp"
155
- // versionCode 1411285562
156
- // versionName "1.0.5-fireTV"
157
- // resValue "string", "app_name", "Newsmax"
158
- }
159
- entel {
160
- dimension "bridge"
161
- applicationIdSuffix ".entel"
162
- versionCode 1
163
- versionName "1.0"
164
- resValue "string", "app_name", "Entel"
165
- }
166
- youFone {
167
- dimension "bridge"
168
- applicationIdSuffix ".youfone"
169
- versionCode 1
170
- versionName "1.0"
171
- resValue "string", "app_name", "YouFone"
172
- }
173
- bbg {
174
- dimension "bridge"
175
- applicationIdSuffix ".bbg"
176
- versionCode 10
177
- versionName "1.8"
178
- resValue "string", "app_name", "BBG"
179
- }
180
- kijk {
181
- dimension "bridge"
182
- applicationIdSuffix ".kijk"
183
- versionCode 2
184
- versionName "1.01"
185
- resValue "string", "app_name", "KIJK"
186
- }
187
- rte {
188
- dimension "bridge"
189
- applicationIdSuffix ".rte"
190
- versionCode 5
191
- versionName "1.0.2"
192
- resValue "string", "app_name", "RTE"
193
- }
194
- alhurra {
195
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
196
- dimension "bridge"
197
- applicationIdSuffix ".alhurra"
198
- versionCode 1000800
199
- versionName "1.0.8"
200
- resValue "string", "app_name", "Alhurra"
201
- }
202
- marti {
203
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
204
- dimension "bridge"
205
- applicationIdSuffix ".marti"
206
- versionCode 1000800
207
- versionName "1.0.8"
208
- resValue "string", "app_name", "Marti"
209
- }
210
- voa {
211
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
212
- dimension "bridge"
213
- applicationIdSuffix ".voa"
214
- versionCode 1000800
215
- versionName "1.0.8"
216
- resValue "string", "app_name", "VOA"
217
- }
218
- voa365 {
219
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
220
- dimension "bridge"
221
- applicationIdSuffix ".voa365"
222
- versionCode 1000300
223
- versionName "1.0.3"
224
- resValue "string", "app_name", "VOA 365"
225
- }
226
- rfe {
227
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
228
- dimension "bridge"
229
- applicationIdSuffix ".rfe"
230
- versionCode 1000100
231
- versionName "1.0.1"
232
- resValue "string", "app_name", "RFE"
233
- }
234
73
  bigscreenAppstage {
235
74
  // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
236
75
  dimension "bridge"
237
- versionCode 1000100
238
- versionName "1.0.1"
239
- applicationId "com.twentyfouri.app.appstagebigscreen"
240
- resValue "string", "app_name", "Appstage BIGscreen"
241
- }
242
- pureflix {
243
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
244
- dimension "bridge"
245
- versionCode 5000900
246
- versionName "5.0.9"
247
- // Android TV
248
- applicationId "com.pureflix"
249
- resValue "string", "app_name", "PureFlix (Android TV)"
250
- // Fire TV
251
- // applicationId "com.rollingstorm.pureflixFTV"
252
- // resValue "string", "app_name", "PureFlix"
253
- }
254
- rfa {
255
- // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
256
- dimension "bridge"
257
- applicationIdSuffix ".rfa"
258
- versionCode 1000300
259
- versionName "1.0.3"
260
- resValue "string", "app_name", "RFA"
261
- }
262
- fuse {
263
- dimension "bridge"
264
- applicationIdSuffix ".fuse"
265
- versionCode 3
266
- versionName "1.0.2"
267
- resValue "string", "app_name", "Fuse"
268
- }
269
- gsn {
270
- dimension "bridge"
271
- applicationId "com.gsn.apptv" // production
272
- // applicationId "com.gsn.test.apptv" // staging
273
- versionCode 1000900
274
- versionName "1.0.9"
275
- resValue "string", "app_name", "GSN"
276
- }
277
- topic {
278
- dimension "bridge"
279
- applicationId "com.flm.topictv" // production
280
- // applicationId "com.twentyfouri.tvbridge.topic" // staging
281
- versionCode 1010000
282
- versionName "1.1.0"
283
- resValue "string", "app_name", "Topic"
284
- }
285
- broadwayhd {
286
- dimension "bridge"
287
- applicationId "com.broadwayhd.apptv" // production
288
- // applicationId "com.twentyfouri.tvbridge.broadwayhd" // staging
289
- versionCode 1000700
290
- versionName "1.0.7"
291
- resValue "string", "app_name", "BroadwayHD"
292
- }
293
- kpn {
294
- dimension "bridge"
295
- applicationId "com.twentyfouri.kpnandroidtv"
296
- versionCode 2
297
- versionName "0.0.2"
298
- resValue "string", "app_name", "KPN iTV"
299
- }
76
+ versionCode {{APP_VERSION_CODE}}
77
+ versionName "{{APP_VERSION_NAME}}"
78
+ applicationId "{{configProps.id}}"
79
+ resValue "string", "app_name", "{{configProps.appName}}"
80
+ }
81
+ // bigscreenAppstage {
82
+ // // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
83
+ // dimension "bridge"
84
+ // versionCode 1000100
85
+ // versionName "1.0.1"
86
+ // applicationId "com.twentyfouri.app.appstagebigscreen"
87
+ // resValue "string", "app_name", "Appstage BIGscreen"
88
+ // }
300
89
  }
301
90
 
302
91
  sourceSets {
@@ -1,5 +1,5 @@
1
1
  {
2
- "baseUrl": "http://smartapps-bigscreen.appstage-bigscreen.24imedia.com.s3.amazonaws.com/builds/androidtv/animated_720/demo/index.html",
2
+ "baseUrl": "{{APP_URL}}",
3
3
  "drm": {
4
4
  "overrideDrmCallback": true
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.2-alpha.2160",
3
+ "version": "0.17.2-alpha.2162",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {