use of com.synopsys.integration.executable.ExecutableOutput in project synopsys-detect by blackducksoftware.
the class GoModDetectableUnusedTest method setup.
@Override
protected void setup() throws IOException {
addFile(Paths.get("go.mod"));
ExecutableOutput goListOutput = createStandardOutputFromResource("/go/go-list.xout");
addExecutableOutput(goListOutput, "go", "list", "-m", "-json");
ExecutableOutput goVersionOutput = createStandardOutput("go version go1.16.5 darwin/amd64");
addExecutableOutput(goVersionOutput, "go", "version");
ExecutableOutput goListUJsonOutput = createStandardOutputFromResource("/go/go-list-all.xout");
addExecutableOutput(goListUJsonOutput, "go", "list", "-mod=readonly", "-m", "-json", "all");
ExecutableOutput goModGraphOutput = createStandardOutput("github.com/gin-gonic/gin golang.org/x/text@v0.3.0", "github.com/gin-gonic/gin sigs.k8s.io/yaml@v1.2.0", "golang.org/x/text@v0.3.0 golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e", "gopkg.in/yaml.v2@v2.2.8 gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405", "sigs.k8s.io/yaml@v1.2.0 github.com/davecgh/go-spew@v1.1.1", "sigs.k8s.io/yaml@v1.2.0 gopkg.in/yaml.v2@v2.2.8");
addExecutableOutput(goModGraphOutput, "go", "mod", "graph");
ExecutableOutput goModWhyOutput = createStandardOutput("# github.com/gin-gonic/gin", "github.com/gin-gonic/gin", "", "# github.com/davecgh/go-spew", "(main module does not need module github.com/davecgh/go-spew)", "", "# golang.org/x/text", "github.com/gin-gonic/gin", "golang.org/x/text/language", "", "# golang.org/x/tools", "(main module does not need module golang.org/x/tools)", "", "# gopkg.in/check.v1", "(main module does not need module gopkg.in/check.v1)", "", "# gopkg.in/yaml.v2", "(main module does not need module gopkg.in/yaml.v2)", "", "# sigs.k8s.io/yaml", "(main module does not need module sigs.k8s.io/yaml)");
addExecutableOutput(goModWhyOutput, "go", "mod", "why", "-m", "all");
}
use of com.synopsys.integration.executable.ExecutableOutput in project synopsys-detect by blackducksoftware.
the class DotNetRuntimeFinder method listAvailableRuntimes.
public List<String> listAvailableRuntimes() throws DetectableException {
try {
ExecutableOutput runtimesOutput = dotnetListRuntimes();
List<String> foundRuntimes = runtimesOutput.getStandardOutputAsList().stream().map(StringUtils::trimToEmpty).filter(StringUtils::isNotBlank).collect(Collectors.toList());
logger.info("Found {} available dotnet runtimes", foundRuntimes.size());
if (foundRuntimes.isEmpty()) {
throw new DetectableException("No available dotnet runtimes");
}
return foundRuntimes;
} catch (ExecutableRunnerException e) {
throw new DetectableException("Could not determine available dotnet runtimes", e);
}
}
use of com.synopsys.integration.executable.ExecutableOutput in project blackduck-docker-inspector by blackducksoftware.
the class UpdateArtifactoryPropertiesTask method getArtifactoryItems.
private ArtifactSearchResult getArtifactoryItems(final String url, final List<String> defaultCurlArgs) throws ExecutableRunnerException {
final List<String> curlArgs = new ArrayList<>(Arrays.asList("--header", "X-Result-Detail: info", url));
curlArgs.addAll(defaultCurlArgs);
final ExecutableOutput executableOutput = curlResponse(curlArgs);
return gson.fromJson(executableOutput.getStandardOutput(), ArtifactSearchResult.class);
}
Aggregations