Cpd configuration helper utils.
| Type Params | Return Type | Name and description |
|---|---|---|
|
static void |
findAndConfigurePlugin(org.gradle.api.Project project, groovy.lang.Closure configuration)In case of multi-module projects cpd most likely will be applied in the root project, but quality plugin is applied on subproject level. |
|
static org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.SourceTask> |
findCpdTask(org.gradle.api.Project project)@param project cpd plugin declaration project |
|
static boolean |
isCpdAlreadyConfigured(org.gradle.api.Project project)In case of multi-module projects, many sub modules may be declared with quality plugin. |
|
static void |
unifyCpdSources(org.gradle.api.Project project, org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.SourceTask> cpdCheck, java.util.Collection<org.gradle.api.tasks.SourceSet> qualitySets)By default, cpd lookup all project source sets. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
In case of multi-module projects cpd most likely will be applied in the root project, but quality plugin is applied on subproject level. In such case we can't attach cpd task into checkMain task and can't apply enabled state control (because it's not normal when submodule configures root project). Still, it is ok to configure pmd version to be in sync and remove restricted source.
Checking all parent modules in case if cpd declared in some middle parent module.
project - project where quality plugin declaredconfiguration - cpd plugin configuration closure (accept cpd declaration project and plugin instance)
project - cpd plugin declaration projectIn case of multi-module projects, many sub modules may be declared with quality plugin. Some configuration must be applied only once for cpd plugin (assuming declared in root module).
project - project where cpd plugin is declaredBy default, cpd lookup all project source sets. To unify behaviour with other quality plugins, source sets, not configured for quality checks, should be also excluded from cpd check.
In case of multi-module project, most likley cpd will be configred in root project and quality plugin for all subprojects. So by default cpdCheck task (in root project) will scan all sourceSets in submodules. Each sub project, containing qulaity plugin will exclude not needed sources from root task and so for each sub project everything would be correct (and so correct overall).
project - quality plugin declaration projectcpdCheck - cpdCheck task (probably from parent project)qualitySets - configured source sets for quality tasks