Are official <docs> for creating a custom compilation out of date, or am I doing something wrong? I’...
k
Are official docs for creating a custom compilation out of date, or am I doing something wrong? I’m following this configuration exactly but running into problem where my custom configuration
jvmIntegrationTest
is failing to resolve references from
commonMain
.
Untitled.kt
In my
jvmIntegrationTest
code getting a bunch of
Cannot access class foo
where `foo`s are references from
commonMain
of this exact same module.
Am I missing configuration somewhere to link main compilation to the integration test compilation, or how does this work?
Adding
associateWith(main)
to compilation doesn’t seem to help
Looks like what I was missing is
associateWith(test)
, wouldn’t that make
integrationTest
depend on
test
? - I don’t really want that
Looks like it does compile
jvmTest
when running
jvmIntegrationTest
which is not ideal
associateWith(main)
might be what I want here actually
But that gets me back to “unresolved reference” issues.
Still having “unresolved reference” issues with
associateWith(main)
. So
associateWith
ain’t it? Wish
associateWith
had some docs on it 🙃
Okay… So what I was actually missing is
implementation(kotlin("test-junit"))
on the `integrationTest`’s default source set… How does this work?
e
Kotlin Gradle Plugin automatically adds the dependency to
test
depending whether the test task uses JUnit 4, JUnit Jupiter, etc.
doesn't work for other source sets so you get to add it manually
k
That makes sense… But it’s not clear to me why not having test dependency causes issues where
jvmIntegrationTest
source set is unable to resolve references from
jvmMain
source set of that same module 🤔