Refactor command-line interface to kotlin-preloader.jar
Use reasonable defaults for the options: no time profiling, no instrumenters, empty classpath, 4096 as the class number estimate. Replace 4096 in the codebase with the constant field. Keep the old interface intact until the build is bootstrapped and the new one can be used in all compilation steps
This commit is contained in:
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ant
|
||||
|
||||
import org.apache.tools.ant.AntClassLoader
|
||||
import org.jetbrains.kotlin.preloading.ClassPreloadingUtils
|
||||
import org.jetbrains.kotlin.preloading.Preloader
|
||||
import java.io.File
|
||||
import java.lang.ref.SoftReference
|
||||
import java.net.JarURLConnection
|
||||
@@ -54,10 +55,10 @@ object KotlinAntTaskUtil {
|
||||
val cached = classLoaderRef.get()
|
||||
if (cached != null) return cached
|
||||
|
||||
val myLoader = javaClass.getClassLoader()
|
||||
val myLoader = javaClass.classLoader
|
||||
if (myLoader !is AntClassLoader) return myLoader
|
||||
|
||||
val classLoader = ClassPreloadingUtils.preloadClasses(listOf(compilerJar), 4096, myLoader, null)
|
||||
val classLoader = ClassPreloadingUtils.preloadClasses(listOf(compilerJar), Preloader.DEFAULT_CLASS_NUMBER_ESTIMATE, myLoader, null)
|
||||
classLoaderRef = SoftReference(classLoader)
|
||||
|
||||
return classLoader
|
||||
|
||||
Reference in New Issue
Block a user