Do not copy app files to platform dir if using --bundle #2147
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.
Cleaning up the target app dir turned out to be a hairy issue here. There is no way to know if the target app dir has been prepared without
--bundle
before the current prepare step. If it has, it needs to be cleaned up, but if it hasn't... it's highly likely that a custom webpack process ran just before preparing the app, and we should not touch anything.The solution I came up with is the following:
tns clean-app android
before bundlingtns build
or atns run
command.I moved app updates (clean/copy) to a separate class, and added unit tests. This PR also fixes the test failure crash due to trying to send the assertion exception details via our analytics service.
Fixes #2111