Copy and pasting from multiplatform channel as I f...
# touchlab-tools
a
Copy and pasting from multiplatform channel as I forgot this was a channel: Hey small question, I am looking at KampKit currently for examples of how to do the build.gradle file in a cleaner way. So far its working great, the only issue I'm having is with tests. I see in Kamp Kit they are making use of import kotlin.test.Test in testing classes, however, when I build, this test package is not found. I'm wondering what its geting included as from the libs file If I include
Copy code
implementation(kotlin("test"))
In the commonTest in build.gradle, it works, but I don't see something like this being declared in kampkit
m
Took a look and it appears we’re getting
kotlin-test
as a transitive dependency from
koin-test
, since that module declares it as an
api
(see here) dependency its available to us without explicitly declaring the dependency. That being said we should probably add it explicitly to avoid this confusion
a
Thanks Michael! So for me its best to just declare it as
Copy code
implementation(kotlin("test"))
in commonTest? I was doing everything out of libs.versions.toml as per KampKit, but in this case I'm guessing its fine to directly reference it in the build.gradle in the way i posted
m
Declaring it that way is fine imo, if you want to keep it in libs then youve gotta declare these two individually to get the annotations and assertions. Thats what i did for the PR i opened into KaMPKit
Copy code
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" }
kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" }
a
Thanks Michael! That helped!