Created
March 25, 2019 09:46
-
-
Save roschlau/c9c8ddd08270787f17631ed30b75eb5b to your computer and use it in GitHub Desktop.
Sharing test sources in gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
// Creating testOutput configuration to bundle test dependencies and sources so other projects can depend on them | |
testOutput.extendsFrom(testCompile) | |
} | |
dependencies { | |
testOutput sourceSets.test.output | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
// Equivalent to maven type 'test-jar': | |
testCompile group: '', name: '', version: '', classifier: 'tests' | |
// In multi-module build: | |
testCompile project(path: ':dependency', configuration: 'testOutput') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment