Search in sources :

Example 21 with Executable

use of com.blackducksoftware.integration.hub.detect.util.executable.Executable in project hub-detect by blackducksoftware.

the class DotNetCoreNugetInspector method execute.

@Override
public ExecutableOutput execute(File workingDirectory, List<String> arguments) throws ExecutableRunnerException {
    List<String> dotnetArguments = new ArrayList<String>();
    dotnetArguments.add(inspectorDll);
    dotnetArguments.addAll(arguments);
    final Executable hubNugetInspectorExecutable = new Executable(workingDirectory, dotnetExe, dotnetArguments);
    final ExecutableOutput executableOutput = executableRunner.execute(hubNugetInspectorExecutable);
    return executableOutput;
}
Also used : ExecutableOutput(com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput) ArrayList(java.util.ArrayList) Executable(com.blackducksoftware.integration.hub.detect.util.executable.Executable)

Example 22 with Executable

use of com.blackducksoftware.integration.hub.detect.util.executable.Executable in project hub-detect by blackducksoftware.

the class PipInspectorExtractor method runInspector.

private List<String> runInspector(final File sourceDirectory, final String pythonPath, final File inspectorScript, final String projectName, final String requirementsFilePath) throws ExecutableRunnerException {
    final List<String> inspectorArguments = new ArrayList<>();
    inspectorArguments.add(inspectorScript.getAbsolutePath());
    if (StringUtils.isNotBlank(requirementsFilePath)) {
        final File requirementsFile = new File(requirementsFilePath);
        inspectorArguments.add(String.format("--requirements=%s", requirementsFile.getAbsolutePath()));
    }
    if (StringUtils.isNotBlank(projectName)) {
        inspectorArguments.add(String.format("--projectname=%s", projectName));
    }
    final Executable pipInspector = new Executable(sourceDirectory, pythonPath, inspectorArguments);
    return executableRunner.execute(pipInspector).getStandardOutputAsList();
}
Also used : ArrayList(java.util.ArrayList) Executable(com.blackducksoftware.integration.hub.detect.util.executable.Executable) File(java.io.File)

Aggregations

Executable (com.blackducksoftware.integration.hub.detect.util.executable.Executable)22 ArrayList (java.util.ArrayList)13 File (java.io.File)11 ExecutableOutput (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput)10 Extraction (com.blackducksoftware.integration.hub.detect.workflow.extraction.Extraction)8 ExecutableRunnerException (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException)6 DetectCodeLocation (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation)5 HashMap (java.util.HashMap)4 IOException (java.io.IOException)3 DetectConfiguration (com.blackducksoftware.integration.hub.detect.configuration.DetectConfiguration)2 DetectProperty (com.blackducksoftware.integration.hub.detect.configuration.DetectProperty)2 PropertyAuthority (com.blackducksoftware.integration.hub.detect.configuration.PropertyAuthority)2 ExecutableRunner (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunner)2 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)2 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)2 Arrays (java.util.Arrays)2 List (java.util.List)2 Optional (java.util.Optional)2 StringUtils (org.apache.commons.lang3.StringUtils)2 DetectFileFinder (com.blackducksoftware.integration.hub.detect.workflow.file.DetectFileFinder)1