What's the minimum required for Gradle TestKit? <...
# community-support
i
What's the minimum required for Gradle TestKit? https://docs.gradle.org/current/userguide/test_kit.html says to just call the method
gradleTestKit()
but… I don't have it. I assume there's a specific plugin that adds it?
m
IIRC you need to call it from your
dependencies{}
block
I'd love this to be published to maven central, like
gradle-api
now.
Yup, no plugin needed at all
👆 1
You need to add it to your
testImplementation
configuration
i
Ah so that's why, I'm using the
kotlin("multiplatform")
plugin and the
sourceSets.jvmTest
isn't really a
dependencies {}
block
is that expected?
Does that even work transitively?
m
Yea, it's not a "regular" published dependency and I don't think it'll be listed in your published dependencies if that's what you're trying to do
i
what's the license on testkit?
Gradle is Apache 2.0, so I could republish it to Central myself
The Nokee team has been republishing the
gradle-api
artifacts for a while so that's an option
Actually maybe Nokee has TestKit as well
Only goes up to 8.11.1 but maybe @daniel will have more insights
i
That's what I was using until now, yeah
a
Here's the issue about
gradle :dependencies
not supporting the 'built in' Gradle deps https://github.com/gradle/gradle/issues/34600
🙏 2
👍 1
m
Ah yes I linked twice the same issue 🤦 This is what I aimed to paste
TBH I believe the issue is 'built in' Gradle deps in the first place
1
There's no little reason to bind your runtime usage of testKit to the Gradle version you're using
i
There's no little reason to bind your runtime usage of testKit to the Gradle version you're using
Even then, Gradle's entire thing is to be a dependency resolution engine, there is
dependencies.constraint
for that.
1
m
Yea, I think you're right. And testKit can actually download different versions of Gradle anyways so it's not bound to the one your build runs in