Switch to templates in the separate script runtime
This commit is contained in:
@@ -344,6 +344,7 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
}
|
||||
if (!arguments.noStdlib) {
|
||||
classpath.add(paths.runtimePath)
|
||||
classpath.add(paths.scriptRuntimePath)
|
||||
}
|
||||
// "-no-stdlib" implies "-no-reflect": otherwise we would be able to transitively read stdlib classes through kotlin-reflect,
|
||||
// which is likely not what user wants since s/he manually provided "-no-stdlib"
|
||||
|
||||
@@ -122,8 +122,16 @@ public class CompileEnvironmentUtil {
|
||||
if (!runtimePath.exists()) {
|
||||
throw new CompileEnvironmentException("Couldn't find runtime library");
|
||||
}
|
||||
File scriptRuntimePath = PathUtil.getKotlinPathsForCompiler().getScriptRuntimePath();
|
||||
if (!scriptRuntimePath.exists()) {
|
||||
throw new CompileEnvironmentException("Couldn't find script runtime library");
|
||||
}
|
||||
|
||||
JarInputStream jis = new JarInputStream(new FileInputStream(runtimePath));
|
||||
copyJarImpl(stream, runtimePath);
|
||||
}
|
||||
|
||||
private static void copyJarImpl(JarOutputStream stream, File jarPath) throws IOException {
|
||||
JarInputStream jis = new JarInputStream(new FileInputStream(jarPath));
|
||||
try {
|
||||
while (true) {
|
||||
JarEntry e = jis.getNextJarEntry();
|
||||
|
||||
Reference in New Issue
Block a user