Kotlin language version in build scripts (not app source)

I’m trying to use some Kotlin std-lib features (marked experimental, admittedly) from Kotlin 1.9 in my build scripts. I’m getting ‘Unresolved reference’ errors, and I’m wondering if there’s a possibility that my build scripts (I’m using the kotlin-dsl plugin version 2.1.20) are using an older kotlin language version?

The methods in question are the UByteArray.toHexString() documented here: toHexString

I’m getting Unresolved reference: toHexString from my code, which looks more or less like this:

  @OptIn(kotlin.ExperimentalUnsignedTypes::class)
  val bytes: UByteArray = Random.nextBytes(8).toUByteArray()
  @OptIn(kotlin.ExperimentalUnsignedTypes::class , kotlin.ExperimentalStdlibApi::class)
  val id: String = bytes.toHexString()

The UByteArray stuff is compiling fine, FWIW.

I have seen, but don’t entirely understand, the chart at Compatibility Matrix, but that doesn’t cover Gradle 8.13/8.14, and it’s not clear to me if it’s even relevant here.

Thanks for any pointers…

It does cover 8.13 and 8.14.
The middle column is Minimum Gradle version.
As there is no explicit line for those versions, there was no change.

And yes, that table shows the language version for the build scripts.
I think you also cannot change it, unless you are talking about some build logic build.
There the kotlin-dsl plugin configures like in that table I think but you should be able to change that by configuration.