Fix gradle build issue during spotlessCheck (#1521)

This commit is contained in:
Islon Scherer
2026-04-15 16:06:14 +02:00
committed by GitHub
parent 1ba54f11a9
commit 2e0b4a3a97
@@ -42,7 +42,8 @@ class PklFormatterFunc(@Transient private val configuration: Configuration) :
private val classLoader by lazy { private val classLoader by lazy {
val urls = configuration.files.map { it.toURI().toURL() } val urls = configuration.files.map { it.toURI().toURL() }
URLClassLoader(urls.toTypedArray()) // Use the platform classloader as parent to isolate from Gradle's classloader
URLClassLoader(urls.toTypedArray(), ClassLoader.getPlatformClassLoader())
} }
private val formatterClass by lazy { classLoader.loadClass("org.pkl.formatter.Formatter") } private val formatterClass by lazy { classLoader.loadClass("org.pkl.formatter.Formatter") }