In a multi-project configuration using Gradle, it's common to encounter situations where a project requires access to test code from another project. To establish this dependency, Gradle 1.7 provides a straightforward solution.
To ensure that Project B can access the test code of Project A, the build.gradle file for Project B should include the following dependency:
dependencies { ... testCompile project(':A').sourceSets.test.output }
This dependency specifies that Project B should include the output of the test source set from Project A in its test compilation process.
By incorporating this dependency, Project B gains access to the test code from Project A, allowing the seamless compilation of test files.
The above is the detailed content of How do I set up test dependencies between projects in a multi-project Gradle configuration?. For more information, please follow other related articles on the PHP Chinese website!