@@ -39,7 +39,17 @@ In the example below, we're showing a hypothetical project graph and what projec
3939
4040Apply the project to the root ` build.gradle ` :
4141```
42- apply plugin: "com.dropbox.detector.AffectedModuleDetector"
42+ buildscript {
43+ repositories {
44+ maven {
45+ url "https://plugins.gradle.org/m2/"
46+ }
47+ }
48+ dependencies {
49+ classpath "com.dropbox.affectedmoduledetector:affectedmoduledetector:0.1.0"
50+ }
51+ }
52+ apply plugin: "com.dropbox.affectedmoduledetector"
4353```
4454
4555Optionally, you can specify the configuration block for the detector:
@@ -51,19 +61,27 @@ Optionally, you can specify the configuration block for the detector:
5161 ]
5262 logFilename = "output.log"
5363 logFolder = "${project.rootDir}/output"
64+ variantToTest = "debug"
5465 }
5566```
5667
5768 - ` baseDir ` : The root directory for all of the ` pathsAffectingAllModules ` . Used to validate the paths exist.
5869 - ` pathsAffectingAllModules ` : Paths to files or folders which if changed will trigger all modules to be considered affected
5970 - ` logFilename ` : A filename for the output detector to use
6071 - ` logFolder ` : A folder to output the log file in
72+ - ` variantToTest ` : which variant to use for newly registered task
73+
74+ The plugin will create a few top level tasks that will assemble or run tests for only affected modules:
75+ * gradlew runAffectedUnitTests - runs jvm tests
76+ * gradlew runAffectedAndroidTests - runs connected tests
77+ * gradlew assembleAffectedAndroidTests - assembles but does not run on device tests, useful when working with device labs
78+
6179
6280## Sample Usage
6381
6482To run this on the sample app, try running the following command:
6583```
66- ./gradlew test -Paffected_module_detector.enable
84+ ./gradlew runAffectedUnitTests -Paffected_module_detector.enable
6785```
6886
6987You 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 it's dependent modules.
0 commit comments