Skip to content

Use fork instead of spawn for tns command #21

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

Merged
merged 2 commits into from
Nov 18, 2015

Conversation

rosen-vladimirov
Copy link
Contributor

When using spawn we communicate to the tns process through stdin. This is causing exception in buildMetadata step when gradle wrapper is used.
For some reason it throws error in java code.
Replace the spawn with fork. Fork requires JavaScript module, so use the nativescript-cli.js from bin folder in case the provided options do not send path to tns.
The child process will send "ready" to the parent, when it is ready to read data. In this moment the parent will send the configuration and the unit testing will start.

When using spawn we communicate to the tns process through stdin. This is causing exception in buildMetadata step when gradle wrapper is used.
For some reason it throws error in java code.
Replace the spawn with fork. Fork requires JavaScript module, so use the nativescript-cli.js from bin folder in case the provided options do not send path to tns.
The child process will send "ready" to the parent, when it is ready to read data. In this moment the parent will send the configuration and the unit testing will start.
@rosen-vladimirov
Copy link
Contributor Author

ping @ligaz, @tailsu , @teobugslayer , @Fatme

@Fatme
Copy link

Fatme commented Nov 18, 2015

👍

@teobugslayer
Copy link

Should we bump the version in package.json too?

Set version to 0.3.0 (not to 0.2.1) as the change in communication with nativescript-cli is breaking.
@rosen-vladimirov
Copy link
Contributor Author

@teobugslayer - done, I've set it to 0.3.0 :)

rosen-vladimirov added a commit that referenced this pull request Nov 18, 2015
@rosen-vladimirov rosen-vladimirov merged commit 9f6f263 into master Nov 18, 2015
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fork-instead-spawn branch November 18, 2015 09:13
runner.on('message', function(data) {
if (data === "ready") {
// Child process is ready to read the data
var optionsStr = JSON.stringify(launcherConfig.options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.send already does that for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants