So we need to be mindful of what is the context and grab the relevant project name that we just scanned.
There are two potentials:
extract the project name in the already used init.gradle, there is most likely a way to get that there and return it back for processing in the TypeScript lib wrapper / child process wrapper
To get the correct project names for testing purposes you can run gradle projects which will list the root project and any sub-projects from that directory
if that is not possible we can use gradle to get the names in the relevant context 🐌 this may be too slow, as we already execute gradle when getting the deps, so this would be a second call.
If applicable, please append the --debug flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.
Expected behaviour
After doing a little digging realised we are not grabbing the actual project names when returning back results, here is the PR with some tests that shows the desired outcome https://github.com/snyk/snyk-gradle-plugin/tree/feat/get-correct-project-names
Users can scan a project with:
snyk test --all-sub-projects
snyk test --file=path/to/build.sbt
snyk test --gradle-sub-project=path/to/build.sbt
So we need to be mindful of what is the context and grab the relevant project name that we just scanned.
There are two potentials:
extract the project name in the already used
init.gradle
, there is most likely a way to get that there and return it back for processing in the TypeScript lib wrapper / child process wrapper To get the correct project names for testing purposes you can rungradle projects
which will list the root project and any sub-projects from that directoryif that is not possible we can use
gradle
to get the names in the relevant context 🐌 this may be too slow, as we already execute gradle when getting the deps, so this would be a second call.Actual behaviour
The tests in this branch fail https://github.com/snyk/snyk-gradle-plugin/tree/feat/get-correct-project-names
Steps to reproduce
Run the tests on the branch above
If applicable, please append the
--debug
flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.