|
1 | 1 | import { ANDROID_RELEASE_BUILD_ERROR_MESSAGE, AndroidAppBundleMessages } from "../constants"; |
2 | 2 | import { ValidatePlatformCommandBase } from "./command-base"; |
3 | | -import { MainController } from "../controllers/main-controller"; |
| 3 | +import { BuildController } from "../controllers/build-controller"; |
| 4 | +import { BuildDataService } from "../services/build-data-service"; |
4 | 5 |
|
5 | 6 | export abstract class BuildCommandBase extends ValidatePlatformCommandBase { |
6 | 7 | constructor($options: IOptions, |
7 | 8 | protected $errors: IErrors, |
8 | 9 | $projectData: IProjectData, |
9 | 10 | $platformsData: IPlatformsData, |
10 | 11 | protected $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
11 | | - protected $mainController: MainController, |
| 12 | + protected $buildController: BuildController, |
12 | 13 | $platformValidationService: IPlatformValidationService, |
13 | 14 | private $bundleValidatorHelper: IBundleValidatorHelper, |
| 15 | + private $buildDataService: BuildDataService, |
14 | 16 | protected $logger: ILogger) { |
15 | 17 | super($options, $platformsData, $platformValidationService, $projectData); |
16 | 18 | this.$projectData.initializeProjectData(); |
17 | 19 | } |
18 | 20 |
|
| 21 | + public dashedOptions = { |
| 22 | + watch: { type: OptionType.Boolean, default: false, hasSensitiveValue: false }, |
| 23 | + }; |
| 24 | + |
19 | 25 | public async executeCore(args: string[]): Promise<string> { |
20 | 26 | const platform = args[0].toLowerCase(); |
21 | | - const outputPath = await this.$mainController.buildPlatform(platform, this.$projectData.projectDir, this.$options); |
| 27 | + const buildData = this.$buildDataService.getBuildData(this.$projectData.projectDir, platform, this.$options); |
| 28 | + const outputPath = await this.$buildController.prepareAndBuildPlatform(buildData); |
22 | 29 |
|
23 | 30 | return outputPath; |
24 | 31 | } |
@@ -57,11 +64,12 @@ export class BuildIosCommand extends BuildCommandBase implements ICommand { |
57 | 64 | $projectData: IProjectData, |
58 | 65 | $platformsData: IPlatformsData, |
59 | 66 | $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
60 | | - $mainController: MainController, |
| 67 | + $buildController: BuildController, |
61 | 68 | $platformValidationService: IPlatformValidationService, |
62 | 69 | $bundleValidatorHelper: IBundleValidatorHelper, |
63 | | - $logger: ILogger) { |
64 | | - super($options, $errors, $projectData, $platformsData, $devicePlatformsConstants, $mainController, $platformValidationService, $bundleValidatorHelper, $logger); |
| 70 | + $logger: ILogger, |
| 71 | + $buildDataService: BuildDataService) { |
| 72 | + super($options, $errors, $projectData, $platformsData, $devicePlatformsConstants, $buildController, $platformValidationService, $bundleValidatorHelper, $buildDataService, $logger); |
65 | 73 | } |
66 | 74 |
|
67 | 75 | public async execute(args: string[]): Promise<void> { |
@@ -92,12 +100,13 @@ export class BuildAndroidCommand extends BuildCommandBase implements ICommand { |
92 | 100 | $projectData: IProjectData, |
93 | 101 | $platformsData: IPlatformsData, |
94 | 102 | $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
95 | | - $mainController: MainController, |
| 103 | + $buildController: BuildController, |
96 | 104 | $platformValidationService: IPlatformValidationService, |
97 | 105 | $bundleValidatorHelper: IBundleValidatorHelper, |
98 | 106 | protected $androidBundleValidatorHelper: IAndroidBundleValidatorHelper, |
| 107 | + $buildDataService: BuildDataService, |
99 | 108 | protected $logger: ILogger) { |
100 | | - super($options, $errors, $projectData, $platformsData, $devicePlatformsConstants, $mainController, $platformValidationService, $bundleValidatorHelper, $logger); |
| 109 | + super($options, $errors, $projectData, $platformsData, $devicePlatformsConstants, $buildController, $platformValidationService, $bundleValidatorHelper, $buildDataService, $logger); |
101 | 110 | } |
102 | 111 |
|
103 | 112 | public async execute(args: string[]): Promise<void> { |
|
0 commit comments