1

I have a multiproject build with domain, service and so on projets.

I defined a configuration in my domain project that supposed to use a support class stored in test path (it would be better to reference a single class though as I need only single BaseTestClass from tests).

configurations {
    testSupport
}

dependencies {
    testSupport sourceSets.test.output
}

Then I use it in my another project like this

testCompile project(path: ":domain", configuration: 'testSupport')

Is there a way to use it like this?

testSupport project(":domain")
lapots
  • 12,553
  • 32
  • 121
  • 242

1 Answers1

0
testCompile project(":domain")

Is equivalent to

testCompile project(path: ":domain", configuration: 'default')

So, I suggest you add to the 'default' configuration rather than creating a 'testSupport' configuration. Note that 'default' is a reserved word in java/groovy so you might need quotes/brackets. Eg:

dependencies {
    'default'(sourceSets.test.output) 
}

Or perhaps this is nicer

dependencies.add('default', sourceSets.test.output)

More information here

lance-java
  • 25,497
  • 4
  • 59
  • 101