Skip to content

Commit d540abc

Browse files
authored
Example of disabling analyzing with build property
1 parent 502d5c9 commit d540abc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ analyzeTestClassesDependencies {
7070
}
7171
```
7272

73+
## Disabling/enabling the plugin
74+
In addition to using the `justWarn`-property, many cases want the build to fail only under given conditions (i.e nightly builds or integration builds). This can be achieved by disabling and enabling dependency analyzing in the following manner.
75+
76+
```gradle
77+
if (!project.hasProperty('analyzeDependencies')) {
78+
tasks.analyzeClassesDependencies.enabled = false
79+
tasks.analyzeTestClassesDependencies.enabled = false
80+
tasks.analyzeDependencies.enabled = false
81+
}
82+
```
83+
7384
## Custom task instances
7485
Applying the plugin creates and configures two instances of the `AnalyzeDependenciesPlugin` task. These two instances, `analyzeClassesDependencies` and `analyzeTestClassesDependencies`, are configured to verify the main and test source set dependencies respectively. Additional instances of this task type can be created and configured in addition to, or instead of, the instances created by the plugin. This may be appropriate when setting up more complex project configurations, or using other plugins which introduce their own configurations.
7586

0 commit comments

Comments
 (0)