Class ProjectSourceRule
-
- All Implemented Interfaces:
public class ProjectSourceRule extends OrtResultRule
An OrtResultRule which allows downloading the project's source code if needed.
-
-
Field Summary
Fields Modifier and Type Field Description private final FileprojectSourcesDirprivate final OrtResultortResultprivate final Stringdescriptionprivate final List<RuleMatcher>matchersprivate final List<RuleViolation>violationsprivate final RuleSetruleSetprivate final Stringname
-
Constructor Summary
Constructors Constructor Description ProjectSourceRule(RuleSet ruleSet, String name)
-
Method Summary
Modifier and Type Method Description final FilegetProjectSourcesDir()The directory containing the source code of the project. final List<File>projectSourceFindDirectories(String patterns)Return all directories from the project's source tree which match any of the provided glob expressions. final List<File>projectSourceFindFiles(String patterns)Return all files from the project's source tree which match any of the provided glob expressions. final Map<String, Set<String>>projectSourceGetDetectedLicensesByFilePath(String patterns)Return the detected licenses for any file matching the given glob expressions. final VcsTypeprojectSourceGetVcsType()Return the VcsType of the project's code repository. final List<File>projectSourceFindFilesWithContent(String contentPattern, String patterns)Return the file paths matching any of the given glob expressions with its file content matching contentPattern. final RuleMatcherprojectSourceHasDirectory(String patterns)A RuleMatcher that checks whether the project's source tree contains at least one directory matching any of the provided glob expressions. final RuleMatcherprojectSourceHasFile(String patterns)A RuleMatcher that checks whether the project's source tree contains at least one file matching any of the provided glob expressions. final RuleMatcherprojectSourceHasFileWithContent(String contentPattern, String patterns)A RuleMatcher that checks whether the project's source tree contains at least one file matching any of the given glob expressions with its file content matching contentPattern. final RuleMatcherprojectSourceHasVcsType(VcsType vcsTypes)A RuleMatcher that checks whether the VcsType of the project's code repository is contained in the given vcsTypes. -
Methods inherited from class org.ossreviewtoolkit.evaluator.OrtResultRule
error, getDescription, getOrtResult, hint, issue, issueSource, warning -
Methods inherited from class org.ossreviewtoolkit.evaluator.Rule
error, evaluate, getMatchers, getName, getRuleSet, getViolations, hasLabel, hint, issue, require, runInternal, warning -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getProjectSourcesDir
final File getProjectSourcesDir()
The directory containing the source code of the project. Accessing the property for the first time triggers a clone and may take a while.
-
projectSourceFindDirectories
final List<File> projectSourceFindDirectories(String patterns)
Return all directories from the project's source tree which match any of the provided glob expressions.
-
projectSourceFindFiles
final List<File> projectSourceFindFiles(String patterns)
Return all files from the project's source tree which match any of the provided glob expressions.
-
projectSourceGetDetectedLicensesByFilePath
final Map<String, Set<String>> projectSourceGetDetectedLicensesByFilePath(String patterns)
Return the detected licenses for any file matching the given glob expressions.
-
projectSourceGetVcsType
final VcsType projectSourceGetVcsType()
Return the VcsType of the project's code repository.
-
projectSourceFindFilesWithContent
final List<File> projectSourceFindFilesWithContent(String contentPattern, String patterns)
Return the file paths matching any of the given glob expressions with its file content matching contentPattern.
-
projectSourceHasDirectory
final RuleMatcher projectSourceHasDirectory(String patterns)
A RuleMatcher that checks whether the project's source tree contains at least one directory matching any of the provided glob expressions.
-
projectSourceHasFile
final RuleMatcher projectSourceHasFile(String patterns)
A RuleMatcher that checks whether the project's source tree contains at least one file matching any of the provided glob expressions.
-
projectSourceHasFileWithContent
final RuleMatcher projectSourceHasFileWithContent(String contentPattern, String patterns)
A RuleMatcher that checks whether the project's source tree contains at least one file matching any of the given glob expressions with its file content matching contentPattern.
-
projectSourceHasVcsType
final RuleMatcher projectSourceHasVcsType(VcsType vcsTypes)
A RuleMatcher that checks whether the VcsType of the project's code repository is contained in the given vcsTypes.
-
-
-
-