Skip to content

Instantly share code, notes, and snippets.

@roschlau
Created March 25, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roschlau/c9c8ddd08270787f17631ed30b75eb5b to your computer and use it in GitHub Desktop.
Save roschlau/c9c8ddd08270787f17631ed30b75eb5b to your computer and use it in GitHub Desktop.
Sharing test sources in gradle
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
}
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