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
+42-6Lines changed: 42 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,15 +90,14 @@ affectedModuleDetector {
90
90
-`excludedModules`: A list of modules that will be excluded from the build process
91
91
-`includeUncommitted`: If uncommitted files should be considered affected
92
92
-`top`: The top of the git log to use. Must be used in combination with configuration `includeUncommitted = false`
93
-
94
-
93
+
-`customTasks`: set of enum fields which implemented [AffectedModuleTaskType]()
95
94
96
95
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.
157
155
156
+
## Custom tasks
157
+
158
+
If you want to add a custom gradle command to execute with impact analysis
159
+
you must create enum which implementing [AffectedModuleTaskType]().
160
+
161
+
Example:
162
+
```kotlin
163
+
164
+
enumclassCustomImpactAnalysisTaskType(
165
+
overridevalcommandByImpact:String,
166
+
overridevaloriginalGradleCommand:String,
167
+
overridevaltaskDescription:String
168
+
): AffectedModuleTaskType {
169
+
170
+
DETEKT_TASK(
171
+
commandByImpact ="runDetektByImpact",
172
+
originalGradleCommand ="detekt",
173
+
taskDescription ="Run static analysis tool without auto-correction by Impact analysis"
174
+
)
175
+
}
176
+
```
177
+
178
+
And then you must add your custom enum fields to configuration in `build.gradle` of your project:
179
+
180
+
```groovy
181
+
affectedModuleDetector {
182
+
baseDir = "${project.rootDir}"
183
+
pathsAffectingAllModules = ["buildSrc/"]
184
+
specifiedBranch = "dev"
185
+
customTasks = [CustomImpactAnalysisTaskType.DETEKT_TASK] // <- list of enum fields
186
+
compareFrom = "SpecifiedBranchCommit"
187
+
includeUncommitted = false
188
+
}
189
+
```
190
+
191
+
**NOTE:** Your task might be complex and doesn't work correctly, if it is true
192
+
you must create `buildSrc` module and write custom plugin manually like [AffectedModuleDetectorPlugin](https://github.com/RomanAimaletdinov/TestImpactAnalysisLib/blob/dev/buildSrc/src/main/java/AffectedModuleDetectorPlugin.kt)
193
+
158
194
## Notes
159
195
160
196
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