Package org.sonarqube.gradle
Class SonarUtils
java.lang.Object
org.sonarqube.gradle.SonarUtils
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncomputeReportPaths(Map<String, Object> properties) Computes the absolute paths for the report paths extracted from the properties.static StringconstructPrefixedProjectName(String projectPath) Produces a prefix for property keys that is appropriate and consumable by the scanner-engineextractReportPaths(Map<String, Object> properties) Returns the paths listed under the external or coverage report path parameters found in the properties.static SonarUtils.InputFileTypefindProjectFileType(Path projectDir, Path filePath) static org.gradle.api.file.FileCollectiongetClassPath(org.gradle.api.Project project, String sourceSetName) static org.gradle.api.file.FileCollectiongetClassPathFromSourceSets(String sourceSetName, org.gradle.api.tasks.SourceSetContainer sourceSets) static org.gradle.api.file.FileCollectiongetMainClassPath(org.gradle.api.Project project) static org.gradle.api.file.FileCollectiongetTestClassPath(org.gradle.api.Project project) static StringJoins a list of strings that may contain commas by wrapping those strings in double quotes, like in CSV format.static StringjoinCsvStringsWithoutDuplicates(String csv1, String csv2) static <T> List<T>nonEmptyOrNull(Collection<T> collection) splitAsCsv(String joined)
-
Method Details
-
getMainClassPath
@Nullable public static org.gradle.api.file.FileCollection getMainClassPath(org.gradle.api.Project project) -
getTestClassPath
@Nullable public static org.gradle.api.file.FileCollection getTestClassPath(org.gradle.api.Project project) -
getClassPath
@Nullable public static org.gradle.api.file.FileCollection getClassPath(org.gradle.api.Project project, String sourceSetName) -
getClassPathFromSourceSets
@Nullable public static org.gradle.api.file.FileCollection getClassPathFromSourceSets(String sourceSetName, @Nullable org.gradle.api.tasks.SourceSetContainer sourceSets) -
nonEmptyOrNull
-
joinCsvStringsWithoutDuplicates
-
joinAsCsv
Joins a list of strings that may contain commas by wrapping those strings in double quotes, like in CSV format.For example: values = { "/home/users/me/artifact-123,456.jar", "/opt/lib" } return is the string: "\"/home/users/me/artifact-123,456.jar\",/opt/lib"
- Parameters:
values-- Returns:
- a string having all the values separated by commas and each single value that contains a comma wrapped in double quotes
-
splitAsCsv
-
extractReportPaths
Returns the paths listed under the external or coverage report path parameters found in the properties.- Parameters:
properties- Properties to explore- Returns:
- The set of paths that point to external reports
-
computeReportPaths
Computes the absolute paths for the report paths extracted from the properties.- Returns:
- The set of absolute paths to external and coverage reports
- Throws:
IllegalStateException- if the property "sonar.projectBaseDir" is not defined in the properties argument
-
findProjectFileType
-
constructPrefixedProjectName
Produces a prefix for property keys that is appropriate and consumable by the scanner-engine
-