Dears, I'm using JVM test suites and would like to...
# community-support
j
Dears, I'm using JVM test suites and would like to add functional test that need to depend on the implementation of the project. I can see here : https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#sec:declare_an_additional_test_suite bullet point #2
This suite is the only suite that will automatically have access to the production source’s
implementation
dependencies, all other suites must explicitly declare these.
How do I do that? I thought it was with
implementation(project())
but later on the same page https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#configure_dependencies_of_a_test_suite_to_reference_project_outputs bullet point #3
Configure a new test suite which adds a
project()
dependency to the suite’s compile and runtime classpaths. This dependency provides access to the project’s outputs as well as any dependencies declared on its
api
and
compileOnlyApi
configurations.
It gives access to the
api
scope of dependencies only. Thanks!
v
Sure, non-api dependencies are implementation details, so consumers - including that other source set - do not see them. If you really need them, you can for example make
functionalTestCompileClasspath
extend from
compileClasspath
, so that everything that is in
compileClasspath
will also be in
functionalTestCompileClasspath
, or some similar setup.