Skip to content

Commit 896f959

Browse files
committed
fix: respect skipWatcher option when setting a value to watch option
When `tns run android --release --env.snapshot` command is executed, `{ skipWatcher: true }` option is provided. On the other side watch option has default true value so as a result we have { skipWatcher: true and watch: true }. This led to the problem that release run is started in watch mode. As the watch option is true, NativeScript CLI starts webpack in watch mode. This led to the problem that webpack reports emitted files before the snapshot generation is completed. (note: there is an another issue inside nativescript-dev-webpack plugin itself about the way how emitted files are reported - it should be fixed there.) As a result, an async issue arise between snapshot generation and gradle build and the following error is thrown: ``` Warning: The static binding generator will generate extend from:vendor.js implementation Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior. Please change the name of one of the extended classes. File: ./platforms/android/app/src/main/java/com/tns/FragmentClass.java Class: com.tns.FragmentClass at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:112) at org.nativescript.staticbindinggenerator.Main.main(Main.java:48) ```
1 parent ac38f16 commit 896f959

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/helpers/livesync-command-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
175175
sdk: this.$options.sdk
176176
});
177177

178-
const buildData = this.$buildDataService.getBuildData(liveSyncInfo.projectDir, platform, { ...this.$options.argv, clean: true, skipWatcher: true });
178+
const buildData = this.$buildDataService.getBuildData(liveSyncInfo.projectDir, platform, { ...this.$options.argv, clean: true, watch: false });
179179

180180
await this.$deployController.deploy({
181181
buildData,

0 commit comments

Comments
 (0)