Skip to content

Commit 297814e

Browse files
committed
fix: fix PR comments
1 parent 4fc6b8e commit 297814e

File tree

81 files changed

+575
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+575
-478
lines changed

PublicAPI.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,6 @@ interface IDebugData {
656656
*/
657657
applicationIdentifier: string;
658658

659-
/**
660-
* Path to .app built for iOS Simulator.
661-
*/
662-
pathToAppPackage?: string;
663-
664659
/**
665660
* The name of the application, for example `MyProject`.
666661
*/

lib/bootstrap.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,21 @@ $injector.require("addPlatformService", "./services/platform/add-platform-servic
3737
$injector.require("buildInfoFileService", "./services/build-info-file-service");
3838
$injector.require("prepareNativePlatformService", "./services/platform/prepare-native-platform-service");
3939
$injector.require("platformValidationService", "./services/platform/platform-validation-service");
40-
$injector.require("platformCommandsService", "./services/platform/platform-commands-service");
4140

4241
$injector.require("buildArtefactsService", "./services/build-artefacts-service");
4342

4443
$injector.require("deviceDebugAppService", "./services/device/device-debug-app-service");
4544
$injector.require("deviceInstallAppService", "./services/device/device-install-app-service");
4645
$injector.require("deviceRefreshAppService", "./services/device/device-refresh-app-service");
4746

48-
$injector.require("runOnDevicesDataService", "./services/run-on-devices-data-service");
47+
$injector.require("runEmitter", "./emitters/run-emitter");
48+
$injector.require("previewAppEmitter", "./emitters/preview-app-emitter");
4949

50-
$injector.require("runOnDevicesEmitter", "./run-on-devices-emitter");
51-
$injector.require("previewAppEmitter", "./preview-app-emitter");
52-
53-
$injector.require("addPlatformController", "./controllers/add-platform-controller");
50+
$injector.require("platformController", "./controllers/platform-controller");
5451
$injector.require("prepareController", "./controllers/prepare-controller");
5552
$injector.require("buildController", "./controllers/build-controller");
56-
$injector.require("deployOnDevicesController", "./controllers/deploy-on-devices-controller");
57-
$injector.require("runOnDevicesController", "./controllers/run-on-devices-controller");
53+
$injector.require("deployController", "./controllers/deploy-controller");
54+
$injector.require("runController", "./controllers/run-controller");
5855
$injector.require("previewAppController", "./controllers/preview-app-controller");
5956

6057
$injector.require("prepareDataService", "./services/prepare-data-service");
@@ -155,6 +152,7 @@ $injector.require("bundleValidatorHelper", "./helpers/bundle-validator-helper");
155152
$injector.require("androidBundleValidatorHelper", "./helpers/android-bundle-validator-helper");
156153
$injector.require("liveSyncCommandHelper", "./helpers/livesync-command-helper");
157154
$injector.require("deployCommandHelper", "./helpers/deploy-command-helper");
155+
$injector.require("platformCommandHelper", "./helpers/platform-command-helper");
158156
$injector.require("optionsTracker", "./helpers/options-track-helper");
159157

160158
$injector.requirePublicClass("localBuildService", "./services/local-build-service");

lib/commands/add-platform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
44
public allowedParameters: ICommandParameter[] = [];
55

66
constructor($options: IOptions,
7-
private $platformCommandsService: IPlatformCommandsService,
7+
private $platformCommandHelper: IPlatformCommandHelper,
88
$platformValidationService: IPlatformValidationService,
99
$projectData: IProjectData,
1010
$platformsDataService: IPlatformsDataService,
@@ -14,7 +14,7 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
1414
}
1515

1616
public async execute(args: string[]): Promise<void> {
17-
await this.$platformCommandsService.addPlatforms(args, this.$projectData, this.$options.frameworkPath);
17+
await this.$platformCommandHelper.addPlatforms(args, this.$projectData, this.$options.frameworkPath);
1818
}
1919

2020
public async canExecute(args: string[]): Promise<ICanExecuteCommandOutput> {

lib/commands/appstore-upload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export class PublishIOS implements ICommand {
5757
this.$options.forDevice = true;
5858

5959
const buildData = new IOSBuildData(this.$projectData.projectDir, platform, this.$options);
60-
ipaFilePath = await this.$buildController.prepareAndBuildPlatform(buildData);
60+
ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
6161
} else {
6262
this.$logger.info("No .ipa, mobile provision or certificate set. Perfect! Now we'll build .xcarchive and let Xcode pick the distribution certificate and provisioning profile for you when exporting .ipa for AppStore submission.");
6363
const buildData = new IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options, buildForAppStore: true });
64-
ipaFilePath = await this.$buildController.prepareAndBuildPlatform(buildData);
64+
ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
6565
this.$logger.info(`Export at: ${ipaFilePath}`);
6666
}
6767
}

lib/commands/build.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { ANDROID_RELEASE_BUILD_ERROR_MESSAGE, AndroidAppBundleMessages } from "../constants";
22
import { ValidatePlatformCommandBase } from "./command-base";
3-
import { BuildController } from "../controllers/build-controller";
4-
import { BuildDataService } from "../services/build-data-service";
53

64
export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
75
constructor($options: IOptions,
86
protected $errors: IErrors,
97
$projectData: IProjectData,
108
$platformsDataService: IPlatformsDataService,
119
protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
12-
protected $buildController: BuildController,
10+
protected $buildController: IBuildController,
1311
$platformValidationService: IPlatformValidationService,
1412
private $bundleValidatorHelper: IBundleValidatorHelper,
15-
private $buildDataService: BuildDataService,
13+
private $buildDataService: IBuildDataService,
1614
protected $logger: ILogger) {
1715
super($options, $platformsDataService, $platformValidationService, $projectData);
1816
this.$projectData.initializeProjectData();
@@ -25,7 +23,7 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
2523
public async executeCore(args: string[]): Promise<string> {
2624
const platform = args[0].toLowerCase();
2725
const buildData = this.$buildDataService.getBuildData(this.$projectData.projectDir, platform, this.$options);
28-
const outputPath = await this.$buildController.prepareAndBuildPlatform(buildData);
26+
const outputPath = await this.$buildController.prepareAndBuild(buildData);
2927

3028
return outputPath;
3129
}
@@ -64,16 +62,16 @@ export class BuildIosCommand extends BuildCommandBase implements ICommand {
6462
$projectData: IProjectData,
6563
$platformsDataService: IPlatformsDataService,
6664
$devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
67-
$buildController: BuildController,
65+
$buildController: IBuildController,
6866
$platformValidationService: IPlatformValidationService,
6967
$bundleValidatorHelper: IBundleValidatorHelper,
7068
$logger: ILogger,
71-
$buildDataService: BuildDataService) {
69+
$buildDataService: IBuildDataService) {
7270
super($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $bundleValidatorHelper, $buildDataService, $logger);
7371
}
7472

7573
public async execute(args: string[]): Promise<void> {
76-
await this.executeCore([this.$platformsDataService.availablePlatforms.iOS]);
74+
await this.executeCore([this.$devicePlatformsConstants.iOS.toLowerCase()]);
7775
}
7876

7977
public async canExecute(args: string[]): Promise<boolean | ICanExecuteCommandOutput> {
@@ -98,19 +96,19 @@ export class BuildAndroidCommand extends BuildCommandBase implements ICommand {
9896
constructor(protected $options: IOptions,
9997
protected $errors: IErrors,
10098
$projectData: IProjectData,
101-
$platformsDataService: IPlatformsDataService,
99+
platformsDataService: IPlatformsDataService,
102100
$devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
103-
$buildController: BuildController,
101+
$buildController: IBuildController,
104102
$platformValidationService: IPlatformValidationService,
105103
$bundleValidatorHelper: IBundleValidatorHelper,
106104
protected $androidBundleValidatorHelper: IAndroidBundleValidatorHelper,
107-
$buildDataService: BuildDataService,
105+
$buildDataService: IBuildDataService,
108106
protected $logger: ILogger) {
109-
super($options, $errors, $projectData, $platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $bundleValidatorHelper, $buildDataService, $logger);
107+
super($options, $errors, $projectData, platformsDataService, $devicePlatformsConstants, $buildController, $platformValidationService, $bundleValidatorHelper, $buildDataService, $logger);
110108
}
111109

112110
public async execute(args: string[]): Promise<void> {
113-
await this.executeCore([this.$platformsDataService.availablePlatforms.Android]);
111+
await this.executeCore([this.$devicePlatformsConstants.Android.toLowerCase()]);
114112

115113
if (this.$options.aab) {
116114
this.$logger.info(AndroidAppBundleMessages.ANDROID_APP_BUNDLE_DOCS_MESSAGE);

lib/commands/install.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ export class InstallCommand implements ICommand {
55
public allowedParameters: ICommandParameter[] = [this.$stringParameter];
66

77
constructor(private $options: IOptions,
8+
private $mobileHelper: Mobile.IMobileHelper,
89
private $platformsDataService: IPlatformsDataService,
9-
private $platformCommandsService: IPlatformCommandsService,
10+
private $platformCommandHelper: IPlatformCommandHelper,
1011
private $projectData: IProjectData,
1112
private $projectDataService: IProjectDataService,
1213
private $pluginsService: IPluginsService,
@@ -26,15 +27,15 @@ export class InstallCommand implements ICommand {
2627

2728
await this.$pluginsService.ensureAllDependenciesAreInstalled(this.$projectData);
2829

29-
for (const platform of this.$platformsDataService.platformsNames) {
30+
for (const platform of this.$mobileHelper.platformNames) {
3031
const platformData = this.$platformsDataService.getPlatformData(platform, this.$projectData);
3132
const frameworkPackageData = this.$projectDataService.getNSValue(this.$projectData.projectDir, platformData.frameworkPackageName);
3233
if (frameworkPackageData && frameworkPackageData.version) {
3334
try {
3435
const platformProjectService = platformData.platformProjectService;
3536
await platformProjectService.validate(this.$projectData, this.$options);
3637

37-
await this.$platformCommandsService.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$projectData, this.$options.frameworkPath);
38+
await this.$platformCommandHelper.addPlatforms([`${platform}@${frameworkPackageData.version}`], this.$projectData, this.$options.frameworkPath);
3839
} catch (err) {
3940
error = `${error}${EOL}${err}`;
4041
}

lib/commands/list-platforms.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import * as helpers from "../common/helpers";
33
export class ListPlatformsCommand implements ICommand {
44
public allowedParameters: ICommandParameter[] = [];
55

6-
constructor(private $platformCommandsService: IPlatformCommandsService,
6+
constructor(private $platformCommandHelper: IPlatformCommandHelper,
77
private $projectData: IProjectData,
88
private $logger: ILogger) {
99
this.$projectData.initializeProjectData();
1010
}
1111

1212
public async execute(args: string[]): Promise<void> {
13-
const installedPlatforms = this.$platformCommandsService.getInstalledPlatforms(this.$projectData);
13+
const installedPlatforms = this.$platformCommandHelper.getInstalledPlatforms(this.$projectData);
1414

1515
if (installedPlatforms.length > 0) {
16-
const preparedPlatforms = this.$platformCommandsService.getPreparedPlatforms(this.$projectData);
16+
const preparedPlatforms = this.$platformCommandHelper.getPreparedPlatforms(this.$projectData);
1717
if (preparedPlatforms.length > 0) {
1818
this.$logger.out("The project is prepared for: ", helpers.formatListOfNames(preparedPlatforms, "and"));
1919
} else {
@@ -22,7 +22,7 @@ export class ListPlatformsCommand implements ICommand {
2222

2323
this.$logger.out("Installed platforms: ", helpers.formatListOfNames(installedPlatforms, "and"));
2424
} else {
25-
const formattedPlatformsList = helpers.formatListOfNames(this.$platformCommandsService.getAvailablePlatforms(this.$projectData), "and");
25+
const formattedPlatformsList = helpers.formatListOfNames(this.$platformCommandHelper.getAvailablePlatforms(this.$projectData), "and");
2626
this.$logger.out("Available platforms for this OS: ", formattedPlatformsList);
2727
this.$logger.out("No installed platforms found. Use $ tns platform add");
2828
}

lib/commands/platform-clean.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import { PlatformCommandsService } from "../services/platform/platform-commands-service";
2-
31
export class CleanCommand implements ICommand {
42
public allowedParameters: ICommandParameter[] = [];
53

64
constructor(
75
private $errors: IErrors,
86
private $options: IOptions,
9-
private $platformCommandsService: PlatformCommandsService,
7+
private $platformCommandHelper: IPlatformCommandHelper,
108
private $platformValidationService: IPlatformValidationService,
119
private $platformEnvironmentRequirements: IPlatformEnvironmentRequirements,
1210
private $projectData: IProjectData
@@ -15,7 +13,7 @@ export class CleanCommand implements ICommand {
1513
}
1614

1715
public async execute(args: string[]): Promise<void> {
18-
await this.$platformCommandsService.cleanPlatforms(args, this.$projectData, this.$options.frameworkPath);
16+
await this.$platformCommandHelper.cleanPlatforms(args, this.$projectData, this.$options.frameworkPath);
1917
}
2018

2119
public async canExecute(args: string[]): Promise<boolean> {
@@ -30,7 +28,7 @@ export class CleanCommand implements ICommand {
3028
for (const platform of args) {
3129
this.$platformValidationService.validatePlatformInstalled(platform, this.$projectData);
3230

33-
const currentRuntimeVersion = this.$platformCommandsService.getCurrentPlatformVersion(platform, this.$projectData);
31+
const currentRuntimeVersion = this.$platformCommandHelper.getCurrentPlatformVersion(platform, this.$projectData);
3432
await this.$platformEnvironmentRequirements.checkEnvironmentRequirements({
3533
platform,
3634
projectDir: this.$projectData.projectDir,

lib/commands/prepare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
2424
const platform = args[0];
2525

2626
const prepareData = this.$prepareDataService.getPrepareData(this.$projectData.projectDir, platform, this.$options);
27-
await this.$prepareController.preparePlatform(prepareData);
27+
await this.$prepareController.prepare(prepareData);
2828
}
2929

3030
public async canExecute(args: string[]): Promise<boolean | ICanExecuteCommandOutput> {

lib/commands/remove-platform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ export class RemovePlatformCommand implements ICommand {
33

44
constructor(
55
private $errors: IErrors,
6-
private $platformCommandsService: IPlatformCommandsService,
6+
private $platformCommandHelper: IPlatformCommandHelper,
77
private $platformValidationService: IPlatformValidationService,
88
private $projectData: IProjectData
99
) {
1010
this.$projectData.initializeProjectData();
1111
}
1212

1313
public execute(args: string[]): Promise<void> {
14-
return this.$platformCommandsService.removePlatforms(args, this.$projectData);
14+
return this.$platformCommandHelper.removePlatforms(args, this.$projectData);
1515
}
1616

1717
public async canExecute(args: string[]): Promise<boolean> {

0 commit comments

Comments
 (0)