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_EVENT
when 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_EVENT
event and detaching from it on stop method.Don't provide device descriptors initially on syncChangedDataOnDevices
Currently CLI provides deviceDescriptors only initially when
syncChangedDataOnDevices
method 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.currentChanges
is undefined and CLI is not able to read.hasChanges
of undefined.this.$projectChangesService.currentChanges
is populated whenthis.$projectChangesService.checkForChanges
method is called. This method is called from nativePrepeare method which is not called for cloud builds asskipNativePrepare
flag is true. Due to these reasonsthis.$projectChangesService.currentChanges
is undefined. This PR fixes this behavior as ensures thatthis.$projectChangesService.checkForChanges
will be called andthis.$projectChangesService.currentChanges
will be populated.Fix
tns run
command when there is both iOS and android device and at least one platform is not addedWhen
tns run
command is executed and there is bothiOS
andandroid
device 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.json
file, 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 callcheckForChanges
method 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].