Don't change build.gradle when running the SAST find-sec-bugs-gradle tool

Problem to solve

Running find-sec-bug-gradle modifies the project's build.gradle file. This leads to complications in tests for example where tools are run multiple times, leading to this error:

 FAILURE: Build failed with an exception.

* Where:
Build file '/tmp/app/groovy/build.gradle' line: 67

* What went wrong:
A problem occurred evaluating root project 'sample-project-gradle'.
> Cannot add task 'findSecurityBugs' as a task with that name already exists.

Proposal

Make find-sec-bugs-gradle build a new build file instead of modifying it. The graddle command has a parameter to specify which build file to use. find-sec-bugs-groovy uses such an approach.

What does success look like, and how can we measure that?

Simplification of test.sh in SAST

Assignee Loading
Time tracking Loading