in internal/platform/effectiveconfig/config.go [149:222]
func configurationLoaderCliArgs(
jrePath string,
configLoaderCliJarPath string,
localQodanaYamlPath string,
globalConfigurationsFile string,
globalConfigId string,
effectiveConfigDir string,
) ([]string, error) {
if jrePath == "" {
return nil, fmt.Errorf(
"JRE not found. Required for effective configuration creation. " +
"See requirements in our documentation: https://www.jetbrains.com/help/qodana/deploy-qodana.html",
)
}
if configLoaderCliJarPath == "" {
return nil, fmt.Errorf("config-loader-cli.jar not found. Required for effective configuration creation")
}
var err error
args := []string{
strutil.QuoteIfSpace(strutil.QuoteForWindows(jrePath)),
"-jar",
strutil.QuoteForWindows(configLoaderCliJarPath),
}
effectiveConfigDirAbs, err := filepath.Abs(effectiveConfigDir)
if err != nil {
err := fmt.Errorf(
"failed to compute absolute path of effective configuration directory %s: %v",
effectiveConfigDir,
err,
)
return nil, err
}
args = append(args, "--effective-config-out-dir", strutil.QuoteForWindows(effectiveConfigDirAbs))
if localQodanaYamlPath != "" {
localQodanaYamlPathAbs, err := filepath.Abs(localQodanaYamlPath)
if err != nil {
err := fmt.Errorf(
"failed to compute absolute path of local qodana.yaml file %s: %v",
localQodanaYamlPath,
err,
)
return nil, err
}
args = append(
args,
"--local-qodana-yaml",
strutil.QuoteIfSpace(strutil.QuoteForWindows(localQodanaYamlPathAbs)),
)
}
if globalConfigurationsFile != "" {
globalConfigurationsFileAbs, err := filepath.Abs(globalConfigurationsFile)
if err != nil {
err := fmt.Errorf(
"failed to compute absolute path of global configurations file %s: %v",
globalConfigurationsFile,
err,
)
return nil, err
}
args = append(
args,
"--global-configs-file",
strutil.QuoteIfSpace(strutil.QuoteForWindows(globalConfigurationsFileAbs)),
)
}
if globalConfigId != "" {
args = append(args, "--global-config-id", strutil.QuoteIfSpace(strutil.QuoteForWindows(globalConfigId)))
}
return args, nil
}