https://kotlinlang.org logo
Title
p

Peter

06/04/2020, 9:15 PM
does anyone have a good example of a multi module gradle project, with a separate module for
integration test
that depends on another module eg
service
? iow, in
integration test
build.gradle.kts i have
implementation(project(":service"))
when building the
integration test
module it fails to find the service.jar - looks like there’s a race condition as every time i check the jar did get created right around the same time
d

Dariusz Kuc

06/04/2020, 9:19 PM
but it really depends on the type of tests you are trying to write
p

Peter

06/04/2020, 9:21 PM
not sure that composite builds are relevant here? https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:depending_on_output_of_another_project looked closer to my situation but as it’s a java project (java gradle plugin), the output should already contain the jar and the dependency as i quoted above should just work alas…
most examples i find online just include the integration tests inside the same project, this is really no different just that it’s in it’s own project
d

Dariusz Kuc

06/04/2020, 9:28 PM
so i needed to use composite build in order to apply my plugin against a test project
if it is just running some tests against other project then I’d assume it should work
p

Peter

06/04/2020, 9:34 PM
yea it’s really just the classes i need .. which i see defined in the output of
:service
and in my
:it-test:integrationTestCompileClasspath
configuration … looks like kotlin kapt plugin is the culprit, the moment i enable that it looks for the
service.jar
too for some reason
d

Dariusz Kuc

06/04/2020, 10:06 PM
well if kapt is looking for the jar then you might have to go with composite build route
👍 1