CLI: improve behavior of -include-runtime

1.fix KT-17344: Include kotlin-reflect to resulting jar if "-include-runtime" is specified, unless the -no-reflect option is specified.
2.fix KT-43220: -include-runtime should add .kotlin_builtins to the output
This commit is contained in:
scaventz
2021-01-14 14:49:03 +08:00
committed by Alexander Udalov
parent 496d857db1
commit bd205317aa
11 changed files with 63 additions and 4 deletions
@@ -187,4 +187,18 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
);
run("buildFile.run", "-cp", tmpdir.getAbsolutePath(), "MainKt");
}
public void testReflect() throws Exception {
String jar = tmpdir.getAbsolutePath() + File.separator + "reflect.jar";
assertEquals("compilation failed", 0,
runCompiler("reflect.compile", "-include-runtime", "reflect.kt", "-d", jar));
run("reflect.run", "-cp", jar, "reflect.ReflectKt");
}
public void testNoReflect() throws Exception {
String jar = tmpdir.getAbsolutePath() + File.separator + "noReflect.jar";
assertEquals("compilation failed", 0,
runCompiler("noReflect.compile", "-include-runtime", "-no-reflect", "noReflect.kt", "-d", jar));
run("noReflect.run", "-cp", jar, "noReflect.NoReflectKt");
}
}