You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-6Lines changed: 38 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,13 @@ affectedModuleDetector {
94
94
]
95
95
includeUncommitted = true
96
96
top = "HEAD"
97
+
customTasks = [
98
+
new AffectedModuleConfiguration.CustomTask(
99
+
"runDetektByImpact",
100
+
"detekt",
101
+
"Run static analysis tool without auto-correction by Impact analysis"
102
+
)
103
+
]
97
104
}
98
105
```
99
106
@@ -109,15 +116,14 @@ affectedModuleDetector {
109
116
-`excludedModules`: A list of modules that will be excluded from the build process
110
117
-`includeUncommitted`: If uncommitted files should be considered affected
111
118
-`top`: The top of the git log to use. Must be used in combination with configuration `includeUncommitted = false`
112
-
113
-
119
+
-`customTasks`: set of [CustomTask](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)
114
120
115
121
By default, the Detector will look for `assembleAndroidDebugTest`, `connectedAndroidDebugTest`, and `testDebug`. Modules can specify a configuration block to specify which variant tests to run:
You should see zero tests run. Make a change within one of the modules and commit it. Rerunning the command should execute tests in that module and its dependent modules.
176
181
182
+
## Custom tasks
183
+
184
+
If you want to add a custom gradle command to execute with impact analysis
185
+
you must declare [AffectedModuleConfiguration.CustomTask](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)
186
+
which is implementing [AffectedModuleTaskType]() in the configuration in `build.gradle` of your project:
187
+
188
+
```groovy
189
+
// ...
190
+
191
+
affectedModuleDetector {
192
+
// ...
193
+
customTasks = [
194
+
new AffectedModuleConfiguration.CustomTask(
195
+
"runDetektByImpact",
196
+
"detekt",
197
+
"Run static analysis tool without auto-correction by Impact analysis"
198
+
)
199
+
]
200
+
// ...
201
+
}
202
+
```
203
+
204
+
**NOTE:** Please, test all your custom commands.
205
+
If your custom task doesn't work correctly after testing, might be your task quite complex
206
+
and for correct working must using more gradle's api.
207
+
Hence, you must create `buildSrc` module and write custom plugin manually like [AffectedModuleDetectorPlugin](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt)
208
+
177
209
## Notes
178
210
179
211
Special thanks to the AndroidX for originally developing this project at https://android.googlesource.com/platform/frameworks/support/+/androidx-main/buildSrc/src/main/kotlin/androidx/build/dependencyTracker
0 commit comments