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

Original commit: aba6ab1299
This commit is contained in:
Alexander Udalov
2015-08-11 19:13:28 -07:00
parent 83f9db33ce
commit 2ea65e1cbc
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
import org.jetbrains.kotlin.preloading.ClassPreloadingUtils;
import org.jetbrains.kotlin.preloading.Preloader;
import org.jetbrains.kotlin.utils.KotlinPaths;
import java.io.File;
@@ -45,7 +46,7 @@ public class CompilerRunnerUtil {
if (classLoader == null) {
classLoader = ClassPreloadingUtils.preloadClasses(
Collections.singletonList(new File(libPath, "kotlin-compiler.jar")),
/* estimatedClassNumber = */ 4096,
Preloader.DEFAULT_CLASS_NUMBER_ESTIMATE,
CompilerRunnerUtil.class.getClassLoader(),
environment.getClassesToLoadByParent()
);