fix: fix issues with Sidekick, cloud builds and multiple projects/devices #4806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix attaching/detaching from PREPARE_READY_EVENT
Currently we're attaching on
PREPARE_READY_EVENTwhen run method is called. As Sidekick is long living process and run on device can be called more than once, we'll have more than one handlers forPREPARE_READY_EVENT. This means that we'll sync the changed files more than once. This PR fixes this behavior as ensures that we're attаching only once onPREPARE_READY_EVENTevent and detaching from it on stop method.Don't provide device descriptors initially on syncChangedDataOnDevices
Currently CLI provides deviceDescriptors only initially when
syncChangedDataOnDevicesmethod is called. As Sidekick can add additional deviceDescriptors, CLI doesn't respect them when files are changed and syncs only initially set deviceDescriptors.Fix shouldBuild method for release cloud builds
Currently CLI throws an error for release cloud build as
this.$projectChangesService.currentChangesis undefined and CLI is not able to read.hasChangesof undefined.this.$projectChangesService.currentChangesis populated whenthis.$projectChangesService.checkForChangesmethod is called. This method is called from nativePrepeare method which is not called for cloud builds asskipNativePrepareflag is true. Due to these reasonsthis.$projectChangesService.currentChangesis undefined. This PR fixes this behavior as ensures thatthis.$projectChangesService.checkForChangeswill be called andthis.$projectChangesService.currentChangeswill be populated.Fix
tns runcommand when there is both iOS and android device and at least one platform is not addedWhen
tns runcommand is executed and there is bothiOSandandroiddevice and at least one platform is not added, CLI adds the missing platform and writes the version in package.json. As the native watcher watches thepackage.jsonfile, it reports that there is a native change. After that CLI rebuilds again the project as the native change is reported. In order to avoid such behavior, this PR callcheckForChangesmethod before syncing the changed files when there is a native change.PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].