protected open fun createCommandLine()

in plugin-dotnet-agent/src/main/kotlin/jetbrains/buildServer/inspect/InspectionWorkflowComposer.kt [63:107]


    protected open fun createCommandLine(
        toolStartInfo: ToolStartInfo,
        args: InspectionArguments,
        virtualOutputPath: Path,
        toolVersion: Version
    ): CommandLine {
        val cmdArgs = sequence {
            yieldAll(toolStartInfo.arguments)

            yield(CommandLineArgument("--config=${_virtualContext.resolvePath(args.configFile.absolutePath)}"))

            if (args.debug) {
                yield(CommandLineArgument("--logFile=${_virtualContext.resolvePath(args.logFile.absolutePath)}"))
            }

            args.extensions?.let {
                yield(CommandLineArgument("--eXtensions=$it"))
            }

            // since R# CLT 2024.1 the default format of output was changed from XML to SARIF, but here XML is required
            if (toolVersion >= InspectCodeWithDefaultSARIFOutput) {
                yield(CommandLineArgument("--format=Xml"))
            }

            yieldAll(args.customArguments)
        }

        _fileSystemService.write(args.configFile) {
            _configurationFile.create(
                it,
                virtualOutputPath,
                Path(_virtualContext.resolvePath(args.cachesHome.absolutePath)),
                args.debug
            )
        }

        return CommandLine(
            baseCommandLine = null,
            target = target,
            executableFile = toolStartInfo.executable,
            workingDirectory = Path(_pathsService.getPath(PathType.Checkout).path),
            arguments = cmdArgs.toList(),
            environmentVariables = _environmentProvider.getEnvironmentVariables(toolVersion, toolStartInfo.platform).toList()
        )
    }