Skip to content
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

Retrieving Node binary location #213

Closed
mleegwt opened this issue Feb 9, 2022 · 4 comments
Closed

Retrieving Node binary location #213

mleegwt opened this issue Feb 9, 2022 · 4 comments
Milestone

Comments

@mleegwt
Copy link

mleegwt commented Feb 9, 2022

To allow reporting code to Sonar we used:

    def nodeExt = project.extensions.getByType(com.github.gradle.node.NodeExtension)
    def variantComputer = new com.github.gradle.node.variant.VariantComputer()
    def nodeDirProvider = variantComputer.computeNodeDir(nodeExt)
    def nodeBinary = variantComputer.computeNodeExec(nodeExt, variantComputer.computeNodeBinDir(nodeDirProvider)).get()

to determine the Node binary.
Since version 3.2.0 of the plugin this no longer works (I think it stopped working due to 98f7bdc).

I'm aware that the code snippet above is using the plugin internals. So I'm wondering whether there is a better way to retrieve the Node binary so we can correctly inform Sonar.
Thanks in advance!

@deepy
Copy link
Member

deepy commented Feb 9, 2022

I currently got a high fever from the booster but I think if you just change to VariantComputer(PlatformHelper.INSTANCE) it should work

The current roadmap is pretty much merging the old PRs, fixing the old bugs, fixing some more critical bugs, opening up the internal classes, and then starting to look into the worker api / shared build services.
Which I'm hoping will lead to a nicer way of passing the node binary to sonarqube

@mleegwt
Copy link
Author

mleegwt commented Feb 10, 2022

Works like a charm! Take care! Should this issue remain open for the 'nicer way'? Or is closing more appropriate.

@deepy
Copy link
Member

deepy commented Feb 10, 2022

I'll fix this in 3.2.1 by adding a 0-argument constructor which does this, it's going to be released before the week is over so we can leave this open until then

@deepy deepy added this to the 3.2 milestone Mar 25, 2022
@deepy
Copy link
Member

deepy commented Mar 25, 2022

This was fixed in 3.2.1

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

No branches or pull requests

2 participants