-
-
Notifications
You must be signed in to change notification settings - Fork 197
Allow local builds when {N} CLI is required as a library #2574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
export class EmulateCommandBase { | ||
constructor(private $platformService: IPlatformService) { } | ||
constructor(private $options: IOptions, | ||
private $projectData: IProjectData, | ||
private $platformService: IPlatformService) { | ||
this.$projectData.initializeProjectData(); | ||
} | ||
|
||
public async executeCore(args: string[]): Promise<void> { | ||
return this.$platformService.emulatePlatform(args[0]); | ||
this.$options.emulator = true; | ||
const appFilesUpdaterOptions: IAppFilesUpdaterOptions = { bundle: this.$options.bundle, release: this.$options.release }; | ||
const emulateOptions: IEmulatePlatformOptions = { | ||
avd: this.$options.avd, | ||
clean: this.$options.clean, | ||
device: this.$options.device, | ||
release: this.$options.release, | ||
emulator: this.$options.emulator, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of setting the value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to reuse the variable 😇 |
||
projectDir: this.$options.path, | ||
justlaunch: this.$options.justlaunch, | ||
availableDevices: this.$options.availableDevices, | ||
platformTemplate: this.$options.platformTemplate, | ||
provision: this.$options.provision, | ||
teamId: this.$options.teamId | ||
}; | ||
return this.$platformService.emulatePlatform(args[0], appFilesUpdaterOptions, emulateOptions, this.$projectData, this.$options.provision); | ||
} | ||
} | ||
|
||
export class EmulateIosCommand extends EmulateCommandBase implements ICommand { | ||
public allowedParameters: ICommandParameter[] = []; | ||
|
||
constructor($platformService: IPlatformService, | ||
constructor($options: IOptions, | ||
$projectData: IProjectData, | ||
$platformService: IPlatformService, | ||
private $platformsData: IPlatformsData) { | ||
super($platformService); | ||
super($options, $projectData, $platformService); | ||
} | ||
|
||
public async execute(args: string[]): Promise<void> { | ||
|
@@ -22,9 +43,11 @@ export class EmulateIosCommand extends EmulateCommandBase implements ICommand { | |
$injector.registerCommand("emulate|ios", EmulateIosCommand); | ||
|
||
export class EmulateAndroidCommand extends EmulateCommandBase implements ICommand { | ||
constructor($platformService: IPlatformService, | ||
constructor($options: IOptions, | ||
$projectData: IProjectData, | ||
$platformService: IPlatformService, | ||
private $platformsData: IPlatformsData) { | ||
super($platformService); | ||
super($options, $projectData, $platformService); | ||
} | ||
|
||
public allowedParameters: ICommandParameter[] = []; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I have not removed the
$options
dependency from all services I cannot guarantee that the code will run the same if I remove this.