Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit 469a341

Browse files
committed
fix: make bundle validation backward compatible
1 parent f0a5665 commit 469a341

File tree

6 files changed

+37
-16
lines changed

6 files changed

+37
-16
lines changed

lib/bootstrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $injector.require("nsCloudOptionsProvider", path.join(__dirname, "cloud-options-
99
$injector.require("nsCloudBuildHelper", path.join(__dirname, "cloud-build-helper"));
1010
$injector.require("nsCloudBuildCommandHelper", path.join(__dirname, "commands", "build-command-helper"));
1111
$injector.require("nsCloudEulaCommandHelper", path.join(__dirname, "commands", "eula-command-helper"));
12+
$injector.require("nsCloudAndroidBundleValidatorHelper", path.join(__dirname, "cloud-android-bundle-validator-helper"));
1213
$injector.require("nsCloudKinveyUserService", path.join(__dirname, "services", "kinvey-user-service"));
1314
$injector.require("nsCloudTelerikUserService", path.join(__dirname, "services", "telerik-user-service"));
1415

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export class CloudAndroidBundleValidatorHelper implements IAndroidBundleValidatorHelper {
2+
protected get $bundleValidatorHelper(): IAndroidBundleValidatorHelper {
3+
return this.$nsCloudPolyfillService.getPolyfillObject<IAndroidBundleValidatorHelper>("androidBundleValidatorHelper", {
4+
validateNoAab: () => { /* Mock */ },
5+
validateRuntimeVersion: () => { /* Mock */ }
6+
});
7+
}
8+
9+
constructor(private $nsCloudPolyfillService: IPolyfillService) { }
10+
11+
validateNoAab() {
12+
return this.$bundleValidatorHelper.validateNoAab();
13+
}
14+
15+
validateRuntimeVersion(projectData: IProjectData) {
16+
return this.$bundleValidatorHelper.validateRuntimeVersion(projectData);
17+
}
18+
}
19+
20+
$injector.register("nsCloudAndroidBundleValidatorHelper", CloudAndroidBundleValidatorHelper);

lib/commands/cloud-build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class CloudBuildCommand extends BundleValidatorBaseCommand implements ICo
1515
private $nsCloudOptionsProvider: ICloudOptionsProvider,
1616
private $options: ICloudOptions,
1717
private $projectData: IProjectData,
18-
private $androidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
18+
private $nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
1919
super($nsCloudPolyfillService);
2020
this.$projectData.initializeProjectData();
2121
}
@@ -32,7 +32,7 @@ export class CloudBuildCommand extends BundleValidatorBaseCommand implements ICo
3232
public async canExecute(args: string[]): Promise<boolean> {
3333
this.$bundleValidatorHelper.validate();
3434
await this.$nsCloudEulaCommandHelper.ensureEulaIsAccepted();
35-
this.$androidBundleValidatorHelper.validateNoAab();
35+
this.$nsCloudAndroidBundleValidatorHelper.validateNoAab();
3636

3737
if (!args || !args.length) {
3838
this.$errors.fail("Provide platform.");

lib/commands/cloud-deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class CloudDeploy extends BundleValidatorBaseCommand implements ICommand
1717
private $nsCloudOptionsProvider: ICloudOptionsProvider,
1818
private $options: ICloudOptions,
1919
private $projectData: IProjectData,
20-
private $androidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
20+
private $nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
2121
super($nsCloudPolyfillService);
2222
this.$projectData.initializeProjectData();
2323
}
@@ -41,7 +41,7 @@ export class CloudDeploy extends BundleValidatorBaseCommand implements ICommand
4141
public async canExecute(args: string[]): Promise<boolean> {
4242
this.$bundleValidatorHelper.validate();
4343
await this.$nsCloudEulaCommandHelper.ensureEulaIsAccepted();
44-
this.$androidBundleValidatorHelper.validateNoAab();
44+
this.$nsCloudAndroidBundleValidatorHelper.validateNoAab();
4545

4646
if (!args || !args.length) {
4747
this.$errors.fail("Provide platform.");

lib/commands/cloud-publish.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ abstract class CloudPublish implements ICommand {
1212
protected $projectData: IProjectData,
1313
protected $options: ICloudOptions,
1414
protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
15-
protected $androidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
15+
protected $nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
1616
this.$projectData.initializeProjectData();
1717
}
1818

1919
public abstract execute(args: string[]): Promise<void>;
2020

2121
public async canExecute(args: string[]): Promise<boolean> {
22-
this.$androidBundleValidatorHelper.validateNoAab();
22+
this.$nsCloudAndroidBundleValidatorHelper.validateNoAab();
2323

2424
return true;
2525
}
@@ -35,9 +35,9 @@ export class CloudPublishAndroid extends CloudPublish implements ICommand {
3535
protected $projectData: IProjectData,
3636
protected $options: ICloudOptions,
3737
protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
38-
$androidBundleValidatorHelper: IAndroidBundleValidatorHelper
38+
$nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper
3939
) {
40-
super($nsCloudOptionsProvider, $prompter, $projectData, $options, $devicePlatformsConstants, $androidBundleValidatorHelper);
40+
super($nsCloudOptionsProvider, $prompter, $projectData, $options, $devicePlatformsConstants, $nsCloudAndroidBundleValidatorHelper);
4141
}
4242

4343
public async execute(args: string[]): Promise<void> {
@@ -87,8 +87,8 @@ export class CloudPublishIos extends CloudPublish implements ICommand {
8787
protected $projectData: IProjectData,
8888
protected $options: ICloudOptions,
8989
protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
90-
$androidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
91-
super($nsCloudOptionsProvider, $prompter, $projectData, $options, $devicePlatformsConstants, $androidBundleValidatorHelper);
90+
$nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
91+
super($nsCloudOptionsProvider, $prompter, $projectData, $options, $devicePlatformsConstants, $nsCloudAndroidBundleValidatorHelper);
9292
}
9393

9494
public async execute(args: string[]): Promise<void> {

lib/commands/cloud-run.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class CloudRunCommand implements ICommand {
1313
private $errors: IErrors,
1414
private $nsCloudOptionsProvider: ICloudOptionsProvider,
1515
private $projectData: IProjectData,
16-
private $androidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
16+
private $nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper) {
1717
this.$projectData.initializeProjectData();
1818
}
1919

@@ -27,7 +27,7 @@ export class CloudRunCommand implements ICommand {
2727

2828
public async canExecute(args: string[]): Promise<boolean> {
2929
await this.$nsCloudEulaCommandHelper.ensureEulaIsAccepted();
30-
this.$androidBundleValidatorHelper.validateNoAab();
30+
this.$nsCloudAndroidBundleValidatorHelper.validateNoAab();
3131

3232
if (args.length) {
3333
this.$errors.fail("This input is not valid for the cloud run command");
@@ -53,9 +53,9 @@ export class CloudRunIosCommand extends CloudRunCommand implements ICommand {
5353
$nsCloudOptionsProvider: ICloudOptionsProvider,
5454
$devicesService: Mobile.IDevicesService,
5555
$projectData: IProjectData,
56-
$androidBundleValidatorHelper: IAndroidBundleValidatorHelper,
56+
$nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper,
5757
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) {
58-
super($liveSyncCommandHelper, $nsCloudEulaCommandHelper, $nsCloudBuildService, $nsCloudBuildCommandHelper, $errors, $nsCloudOptionsProvider, $projectData, $androidBundleValidatorHelper);
58+
super($liveSyncCommandHelper, $nsCloudEulaCommandHelper, $nsCloudBuildService, $nsCloudBuildCommandHelper, $errors, $nsCloudOptionsProvider, $projectData, $nsCloudAndroidBundleValidatorHelper);
5959
}
6060
}
6161

@@ -75,9 +75,9 @@ export class CloudRunAndroidCommand extends CloudRunCommand implements ICommand
7575
$nsCloudOptionsProvider: ICloudOptionsProvider,
7676
$devicesService: Mobile.IDevicesService,
7777
$projectData: IProjectData,
78-
$androidBundleValidatorHelper: IAndroidBundleValidatorHelper,
78+
$nsCloudAndroidBundleValidatorHelper: IAndroidBundleValidatorHelper,
7979
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) {
80-
super($liveSyncCommandHelper, $nsCloudEulaCommandHelper, $nsCloudBuildService, $nsCloudBuildCommandHelper, $errors, $nsCloudOptionsProvider, $projectData, $androidBundleValidatorHelper);
80+
super($liveSyncCommandHelper, $nsCloudEulaCommandHelper, $nsCloudBuildService, $nsCloudBuildCommandHelper, $errors, $nsCloudOptionsProvider, $projectData, $nsCloudAndroidBundleValidatorHelper);
8181
}
8282
}
8383

0 commit comments

Comments
 (0)