Deprecated – For Gradle 5.6 and above use this answer.
In Project B, you just need to add a testCompile
dependency:
dependencies {
...
testCompile project(':A').sourceSets.test.output
}
Tested with Gradle 1.7.
More Related Contents:
- Maven: add a dependency to a jar by relative path
- Adding external library to artifact jar in IntelliJ IDEA
- Gradle does not find tools.jar
- Ionic build Android error when downloading Gradle
- How do I add a new sourceset to Gradle?
- What does ‘->’ (arrow) mean in gradle’s dependency graph?
- How can I force Gradle to set the same version for two dependencies?
- Gradle – getting the latest release version of a dependency
- Gradle “Entry .classpath is a duplicate but no duplicate handling strategy has been set”
- Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler
- What is pluginManagement in Maven’s pom.xml?
- com.android.build.transform.api.TransformException
- NoClassDefFoundError – Eclipse and Android
- How to read an external properties file in Maven
- How do I exclude all instances of a transitive dependency when using Gradle?
- Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
- Maven: Failed to read artifact descriptor
- Gradle to execute Java class (without modifying build.gradle)
- java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;) with Selenium, gradle and ChromeDriver
- What is the difference between “pom” type dependency with scope “import” and without “import”?
- Conflicting library version in a Java Maven project
- How to use POMs as a dependency in Maven?
- Add classpath in manifest using Gradle
- Gradle task replace string in .java file
- is it possible to disable javac’s inlining of static final variables?
- How to run bootRun with spring profile via gradle task
- IntelliJ gradle add module dependency
- Error:Timeout waiting to lock buildscript class cache for build file when change minSdkVersion
- How to build JARs from IntelliJ IDEA properly?
- Where do resource files go in a Gradle project that builds a Java 9 module?