Drop module "ktm" scripts and support java source roots in "xml" modules
Drop kotlin.modules package from runtime Move adapted classes into compiler Unsupport files with "ktm" extension Delete code for loading module scripts Drop tests for module scripts Separate section for java source roots in xml script generator/parser
This commit is contained in:
@@ -82,15 +82,6 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase {
|
||||
runJava("hello.run", "-cp", jar, "Hello.HelloPackage");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compileAndRunModule() throws Exception {
|
||||
String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "smoke.jar";
|
||||
|
||||
assertEquals("compilation failed", 0, runCompiler("Smoke.compile", "-module", "Smoke.ktm", "-d", jar));
|
||||
String classpath = jar + File.pathSeparator + ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath();
|
||||
runJava("Smoke.run", "-cp", classpath, "Smoke.SmokePackage", "1", "2", "3");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compilationFailed() throws Exception {
|
||||
String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "smoke.jar";
|
||||
|
||||
@@ -35,43 +35,6 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarInputStream;
|
||||
|
||||
public class CompileEnvironmentTest extends TestCase {
|
||||
public void testSmokeWithCompilerJar() throws IOException {
|
||||
File tempDir = FileUtil.createTempDirectory("compilerTest", "compilerTest");
|
||||
|
||||
try {
|
||||
File stdlib = ForTestCompileRuntime.runtimeJarForTests();
|
||||
File jdkAnnotations = JetTestUtils.getJdkAnnotationsJar();
|
||||
File resultJar = new File(tempDir, "result.jar");
|
||||
ExitCode rv = new K2JVMCompiler().exec(
|
||||
System.out,
|
||||
"-module", JetTestUtils.getTestDataPathBase() + "/compiler/smoke/Smoke.ktm",
|
||||
"-d", resultJar.getAbsolutePath(),
|
||||
"-no-stdlib",
|
||||
"-classpath", stdlib.getAbsolutePath(),
|
||||
"-no-jdk-annotations",
|
||||
"-annotations", jdkAnnotations.getAbsolutePath()
|
||||
);
|
||||
Assert.assertEquals("compilation completed with non-zero code", ExitCode.OK, rv);
|
||||
FileInputStream fileInputStream = new FileInputStream(resultJar);
|
||||
try {
|
||||
JarInputStream is = new JarInputStream(fileInputStream);
|
||||
try {
|
||||
List<String> entries = listEntries(is);
|
||||
assertTrue(entries.contains("Smoke/" + PackageClassUtils.getPackageClassName(new FqName("Smoke")) + ".class"));
|
||||
assertEquals(2, entries.size());
|
||||
}
|
||||
finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
fileInputStream.close();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
FileUtil.delete(tempDir);
|
||||
}
|
||||
}
|
||||
|
||||
public void testSmokeWithCompilerOutput() throws IOException {
|
||||
File tempDir = FileUtil.createTempDirectory("compilerTest", "compilerTest");
|
||||
@@ -96,16 +59,4 @@ public class CompileEnvironmentTest extends TestCase {
|
||||
FileUtil.delete(tempDir);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> listEntries(JarInputStream is) throws IOException {
|
||||
List<String> entries = new ArrayList<String>();
|
||||
while (true) {
|
||||
JarEntry jarEntry = is.getNextJarEntry();
|
||||
if (jarEntry == null) {
|
||||
break;
|
||||
}
|
||||
entries.add(jarEntry.getName());
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ package org.jetbrains.kotlin.modules.xml;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import junit.framework.TestCase;
|
||||
import kotlin.modules.Module;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation;
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity;
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer;
|
||||
import org.jetbrains.kotlin.cli.common.modules.Module;
|
||||
import org.jetbrains.kotlin.cli.common.modules.ModuleScriptData;
|
||||
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser;
|
||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||
|
||||
Reference in New Issue
Block a user