Build kotlin-reflect.jar in build.xml and for Maven
Reflection will be distributed in a separate jar and not in kotlin-runtime.jar for two primary reasons: - Reflection implementation at the moment takes almost 2Mb - Separate libraries for separate features is a technique encouraged by Maven, and it's inconvenient to make it different in the compiler distribution
This commit is contained in:
@@ -15,7 +15,13 @@
|
|||||||
<property name="bootstrap.home" value="dependencies/bootstrap-compiler"/>
|
<property name="bootstrap.home" value="dependencies/bootstrap-compiler"/>
|
||||||
<property name="bootstrap.compiler.home" value="${bootstrap.home}/Kotlin/kotlinc"/>
|
<property name="bootstrap.compiler.home" value="${bootstrap.home}/Kotlin/kotlinc"/>
|
||||||
<property name="bootstrap.runtime" value="${bootstrap.compiler.home}/lib/kotlin-runtime.jar"/>
|
<property name="bootstrap.runtime" value="${bootstrap.compiler.home}/lib/kotlin-runtime.jar"/>
|
||||||
<property name="bootstrap.runtime.minimal" value="${bootstrap.compiler.home}/lib/kotlin-runtime-minimal.jar"/>
|
|
||||||
|
<!-- TODO: temporary, remove "else" after bootstrap -->
|
||||||
|
<condition property="bootstrap.reflect"
|
||||||
|
value="${bootstrap.compiler.home}/lib/kotlin-reflect.jar"
|
||||||
|
else="${bootstrap.runtime}">
|
||||||
|
<available file="${bootstrap.compiler.home}/lib/kotlin-reflect.jar"/>
|
||||||
|
</condition>
|
||||||
|
|
||||||
<property name="output" value="${basedir}/dist"/>
|
<property name="output" value="${basedir}/dist"/>
|
||||||
<property name="kotlin-home" value="${output}/kotlinc"/>
|
<property name="kotlin-home" value="${output}/kotlinc"/>
|
||||||
@@ -23,6 +29,7 @@
|
|||||||
<property name="bootstrap.build.no.tests" value="false"/>
|
<property name="bootstrap.build.no.tests" value="false"/>
|
||||||
<property name="idea.sdk" value="${basedir}/ideaSDK"/>
|
<property name="idea.sdk" value="${basedir}/ideaSDK"/>
|
||||||
<property name="protobuf.jar" value="${idea.sdk}/lib/protobuf-2.5.0.jar"/>
|
<property name="protobuf.jar" value="${idea.sdk}/lib/protobuf-2.5.0.jar"/>
|
||||||
|
<property name="protobuf-lite.jar" value="${basedir}/dependencies/protobuf-2.5.0-lite.jar"/>
|
||||||
<property name="javax.inject.jar" value="${basedir}/lib/javax.inject.jar"/>
|
<property name="javax.inject.jar" value="${basedir}/lib/javax.inject.jar"/>
|
||||||
|
|
||||||
<property name="java.target" value="1.6"/>
|
<property name="java.target" value="1.6"/>
|
||||||
@@ -50,8 +57,8 @@
|
|||||||
little to no differences between the new and the newest runtime.
|
little to no differences between the new and the newest runtime.
|
||||||
-->
|
-->
|
||||||
<condition property="compiler.manifest.class.path"
|
<condition property="compiler.manifest.class.path"
|
||||||
value="kotlin-runtime-internal-bootstrap.jar"
|
value="kotlin-runtime-internal-bootstrap.jar kotlin-reflect-internal-bootstrap.jar"
|
||||||
else="kotlin-runtime.jar">
|
else="kotlin-runtime.jar kotlin-reflect.jar">
|
||||||
<istrue value="${bootstrap.or.local.build}"/>
|
<istrue value="${bootstrap.or.local.build}"/>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
@@ -541,7 +548,7 @@
|
|||||||
|
|
||||||
-libraryjars '${rtjar}'
|
-libraryjars '${rtjar}'
|
||||||
-libraryjars '${jssejar}'
|
-libraryjars '${jssejar}'
|
||||||
-libraryjars '${bootstrap.runtime.minimal}'
|
-libraryjars '${bootstrap.runtime}'
|
||||||
|
|
||||||
-target 1.6
|
-target 1.6
|
||||||
-dontoptimize
|
-dontoptimize
|
||||||
@@ -625,6 +632,7 @@
|
|||||||
<istrue value="${bootstrap.or.local.build}"/>
|
<istrue value="${bootstrap.or.local.build}"/>
|
||||||
<then>
|
<then>
|
||||||
<copy file="${bootstrap.runtime}" tofile="${kotlin-home}/lib/kotlin-runtime-internal-bootstrap.jar"/>
|
<copy file="${bootstrap.runtime}" tofile="${kotlin-home}/lib/kotlin-runtime-internal-bootstrap.jar"/>
|
||||||
|
<copy file="${bootstrap.reflect}" tofile="${kotlin-home}/lib/kotlin-reflect-internal-bootstrap.jar"/>
|
||||||
</then>
|
</then>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
@@ -783,6 +791,25 @@
|
|||||||
</new-kotlinc>
|
</new-kotlinc>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="core">
|
||||||
|
<new-kotlinc output="${output}/classes/core">
|
||||||
|
<src>
|
||||||
|
<include name="core/descriptor.loader.java/src"/>
|
||||||
|
<include name="core/descriptors/src"/>
|
||||||
|
<include name="core/descriptors.runtime/src"/>
|
||||||
|
<include name="core/serialization/src"/>
|
||||||
|
<include name="core/serialization.jvm/src"/>
|
||||||
|
<include name="core/util.runtime/src"/>
|
||||||
|
</src>
|
||||||
|
<class-path>
|
||||||
|
<pathelement path="${output}/classes/builtins"/>
|
||||||
|
<pathelement path="${output}/classes/stdlib"/>
|
||||||
|
<pathelement path="${protobuf-lite.jar}"/>
|
||||||
|
<pathelement path="${javax.inject.jar}"/>
|
||||||
|
</class-path>
|
||||||
|
</new-kotlinc>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="reflection">
|
<target name="reflection">
|
||||||
<new-kotlinc output="${output}/classes/reflection">
|
<new-kotlinc output="${output}/classes/reflection">
|
||||||
<src>
|
<src>
|
||||||
@@ -791,81 +818,78 @@
|
|||||||
<class-path>
|
<class-path>
|
||||||
<pathelement path="${output}/classes/builtins"/>
|
<pathelement path="${output}/classes/builtins"/>
|
||||||
<pathelement path="${output}/classes/stdlib"/>
|
<pathelement path="${output}/classes/stdlib"/>
|
||||||
|
<pathelement path="${output}/classes/core"/>
|
||||||
|
<pathelement path="${protobuf-lite.jar}"/>
|
||||||
</class-path>
|
</class-path>
|
||||||
</new-kotlinc>
|
</new-kotlinc>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<macrodef name="pack-runtime-jar">
|
||||||
|
<attribute name="jar-name"/>
|
||||||
|
<attribute name="implementation-title"/>
|
||||||
|
<element name="jar-content"/>
|
||||||
|
|
||||||
|
<sequential>
|
||||||
|
<jar destfile="${kotlin-home}/lib/@{jar-name}" duplicate="fail">
|
||||||
|
<jar-content/>
|
||||||
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
||||||
|
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
||||||
|
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
||||||
|
<attribute name="Implementation-Title" value="@{implementation-title}"/>
|
||||||
|
<attribute name="Implementation-Version" value="${build.number}"/>
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
<target name="pack-runtime">
|
<target name="pack-runtime">
|
||||||
<macrodef name="do-pack-runtime">
|
<pack-runtime-jar jar-name="kotlin-runtime.jar" implementation-title="${manifest.impl.title.kotlin.jvm.runtime}">
|
||||||
<attribute name="jar-name"/>
|
<jar-content>
|
||||||
<attribute name="implementation-title"/>
|
<fileset dir="${output}/classes/builtins"/>
|
||||||
<element name="reflection-classes" optional="true"/>
|
<fileset dir="${output}/classes/stdlib"/>
|
||||||
|
<zipfileset dir="${output}/builtins"/>
|
||||||
|
</jar-content>
|
||||||
|
</pack-runtime-jar>
|
||||||
|
|
||||||
<sequential>
|
<pack-runtime-jar jar-name="kotlin-reflect.jar" implementation-title="${manifest.impl.title.kotlin.jvm.reflect}">
|
||||||
<jar destfile="${kotlin-home}/lib/@{jar-name}" duplicate="fail">
|
<jar-content>
|
||||||
<fileset dir="${output}/classes/builtins"/>
|
|
||||||
<fileset dir="${output}/classes/stdlib"/>
|
|
||||||
<reflection-classes/>
|
|
||||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
||||||
|
|
||||||
<manifest>
|
|
||||||
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
||||||
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
||||||
<attribute name="Implementation-Title" value="@{implementation-title}"/>
|
|
||||||
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
||||||
</manifest>
|
|
||||||
</jar>
|
|
||||||
</sequential>
|
|
||||||
</macrodef>
|
|
||||||
|
|
||||||
<do-pack-runtime jar-name="kotlin-runtime.jar" implementation-title="${manifest.impl.title.kotlin.jvm.runtime}">
|
|
||||||
<reflection-classes>
|
|
||||||
<fileset dir="${output}/classes/reflection"/>
|
<fileset dir="${output}/classes/reflection"/>
|
||||||
</reflection-classes>
|
<fileset dir="${output}/classes/core"/>
|
||||||
</do-pack-runtime>
|
<zipfileset src="${protobuf-lite.jar}"/>
|
||||||
|
<zipfileset src="${javax.inject.jar}"/>
|
||||||
|
</jar-content>
|
||||||
|
</pack-runtime-jar>
|
||||||
|
|
||||||
<do-pack-runtime jar-name="kotlin-runtime-minimal.jar" implementation-title="${manifest.impl.title.kotlin.jvm.runtime.minimal}"/>
|
<jar destfile="${kotlin-home}/lib/kotlin-reflect.jar" update="true">
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Class-Path" value="kotlin-runtime.jar"/>
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="pack-runtime-sources">
|
<target name="pack-runtime-sources">
|
||||||
<macrodef name="do-pack-runtime-sources">
|
<pack-runtime-jar jar-name="kotlin-runtime-sources.jar" implementation-title="${manifest.impl.title.kotlin.jvm.runtime.sources}">
|
||||||
<attribute name="jar-name"/>
|
<jar-content>
|
||||||
<attribute name="implementation-title"/>
|
<fileset dir="${basedir}/core/builtins/native" includes="**/*"/>
|
||||||
<element name="reflection-sources" optional="true"/>
|
<fileset dir="${basedir}/core/builtins/src" includes="**/*"/>
|
||||||
|
<fileset dir="${basedir}/core/descriptor.loader.java/src" includes="**/*"/>
|
||||||
<sequential>
|
<fileset dir="${basedir}/core/descriptors/src" includes="**/*"/>
|
||||||
<jar destfile="${kotlin-home}/lib/@{jar-name}" duplicate="fail">
|
<fileset dir="${basedir}/core/descriptors.runtime/src" includes="**/*"/>
|
||||||
<fileset dir="${basedir}/core/builtins/native" includes="**/*"/>
|
<fileset dir="${basedir}/core/reflection/src" includes="**/*"/>
|
||||||
<fileset dir="${basedir}/core/builtins/src" includes="**/*"/>
|
|
||||||
<fileset dir="${basedir}/core/runtime.jvm/src" includes="**/*"/>
|
|
||||||
<fileset dir="${basedir}/core/reflection/src" includes="**/*"/>
|
|
||||||
<reflection-sources/>
|
|
||||||
<fileset dir="${basedir}/libraries/stdlib/src" includes="**/*"/>
|
|
||||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
|
||||||
|
|
||||||
<manifest>
|
|
||||||
<attribute name="Built-By" value="${manifest.impl.vendor}"/>
|
|
||||||
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
|
|
||||||
<attribute name="Implementation-Title" value="@{implementation-title}"/>
|
|
||||||
<attribute name="Implementation-Version" value="${build.number}"/>
|
|
||||||
</manifest>
|
|
||||||
</jar>
|
|
||||||
</sequential>
|
|
||||||
</macrodef>
|
|
||||||
|
|
||||||
<do-pack-runtime-sources jar-name="kotlin-runtime-sources.jar"
|
|
||||||
implementation-title="${manifest.impl.title.kotlin.jvm.runtime.sources}">
|
|
||||||
<reflection-sources>
|
|
||||||
<fileset dir="${basedir}/core/reflection.jvm/src" includes="**/*"/>
|
<fileset dir="${basedir}/core/reflection.jvm/src" includes="**/*"/>
|
||||||
</reflection-sources>
|
<fileset dir="${basedir}/core/runtime.jvm/src" includes="**/*"/>
|
||||||
</do-pack-runtime-sources>
|
<fileset dir="${basedir}/core/serialization/src" includes="**/*"/>
|
||||||
|
<fileset dir="${basedir}/core/serialization.jvm/src" includes="**/*"/>
|
||||||
<do-pack-runtime-sources jar-name="kotlin-runtime-minimal-sources.jar"
|
<fileset dir="${basedir}/core/util.runtime/src" includes="**/*"/>
|
||||||
implementation-title="${manifest.impl.title.kotlin.jvm.runtime.minimal.sources}"/>
|
<fileset dir="${basedir}/libraries/stdlib/src" includes="**/*"/>
|
||||||
|
</jar-content>
|
||||||
|
</pack-runtime-jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="runtime"
|
<target name="runtime"
|
||||||
depends="builtins,stdlib,reflection,pack-runtime,pack-runtime-sources"/>
|
depends="builtins,stdlib,core,reflection,pack-runtime,pack-runtime-sources"/>
|
||||||
|
|
||||||
<target name="dist"
|
<target name="dist"
|
||||||
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler,compiler-sources,ant-tools,jdk-annotations,android-sdk-annotations,runtime,kotlin-js-stdlib,android-compiler-plugin"
|
depends="clean,init,prepare-dist,preloader,serialize-builtins,compiler,compiler-sources,ant-tools,jdk-annotations,android-sdk-annotations,runtime,kotlin-js-stdlib,android-compiler-plugin"
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ public class CodegenTestUtil {
|
|||||||
File javaClassesTempDirectory = JetTestUtils.tmpDir("java-classes");
|
File javaClassesTempDirectory = JetTestUtils.tmpDir("java-classes");
|
||||||
List<String> classpath = new ArrayList<String>();
|
List<String> classpath = new ArrayList<String>();
|
||||||
classpath.add(ForTestCompileRuntime.runtimeJarForTests().getPath());
|
classpath.add(ForTestCompileRuntime.runtimeJarForTests().getPath());
|
||||||
|
classpath.add(ForTestCompileRuntime.reflectJarForTests().getPath());
|
||||||
classpath.add(JetTestUtils.getAnnotationsJar().getPath());
|
classpath.add(JetTestUtils.getAnnotationsJar().getPath());
|
||||||
classpath.addAll(Arrays.asList(additionalClasspath));
|
classpath.addAll(Arrays.asList(additionalClasspath));
|
||||||
List<String> options = Arrays.asList(
|
List<String> options = Arrays.asList(
|
||||||
|
|||||||
+17
-5
@@ -31,11 +31,20 @@ public class ForTestCompileRuntime {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static File runtimeJarForTests() {
|
public static File runtimeJarForTests() {
|
||||||
File runtime = new File("dist/kotlinc/lib/kotlin-runtime.jar");
|
return assertExists(new File("dist/kotlinc/lib/kotlin-runtime.jar"));
|
||||||
if (!runtime.exists()) {
|
}
|
||||||
throw new IllegalStateException("kotlin-runtime.jar in dist/kotlinc/lib does not exist. Run 'ant dist'");
|
|
||||||
|
@NotNull
|
||||||
|
public static File reflectJarForTests() {
|
||||||
|
return assertExists(new File("dist/kotlinc/lib/kotlin-reflect.jar"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static File assertExists(@NotNull File file) {
|
||||||
|
if (!file.exists()) {
|
||||||
|
throw new IllegalStateException(file + " does not exist. Run 'ant dist'");
|
||||||
}
|
}
|
||||||
return runtime;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -43,7 +52,10 @@ public class ForTestCompileRuntime {
|
|||||||
ClassLoader loader = runtimeJarClassLoader.get();
|
ClassLoader loader = runtimeJarClassLoader.get();
|
||||||
if (loader == null) {
|
if (loader == null) {
|
||||||
try {
|
try {
|
||||||
loader = new URLClassLoader(new URL[] {runtimeJarForTests().toURI().toURL()}, null);
|
loader = new URLClassLoader(new URL[] {
|
||||||
|
runtimeJarForTests().toURI().toURL(),
|
||||||
|
reflectJarForTests().toURI().toURL()
|
||||||
|
}, null);
|
||||||
}
|
}
|
||||||
catch (MalformedURLException e) {
|
catch (MalformedURLException e) {
|
||||||
throw rethrow(e);
|
throw rethrow(e);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.integration;
|
package org.jetbrains.kotlin.integration;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
|
||||||
import org.jetbrains.kotlin.utils.UtilsPackage;
|
import org.jetbrains.kotlin.utils.UtilsPackage;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -40,16 +41,20 @@ public class AntTaskJvmTest extends AntTaskBaseTest {
|
|||||||
private void doJvmAntTest(String... extraJavaArgs) throws Exception {
|
private void doJvmAntTest(String... extraJavaArgs) throws Exception {
|
||||||
doAntTest(SUCCESSFUL, extraJavaArgs);
|
doAntTest(SUCCESSFUL, extraJavaArgs);
|
||||||
|
|
||||||
String jar = getOutputFileByName(JVM_OUT_FILE).getAbsolutePath();
|
String classpath = UtilsPackage.join(Arrays.asList(
|
||||||
|
getOutputFileByName(JVM_OUT_FILE).getAbsolutePath(),
|
||||||
|
ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath(),
|
||||||
|
ForTestCompileRuntime.reflectJarForTests().getAbsolutePath()
|
||||||
|
), File.pathSeparator);
|
||||||
|
|
||||||
runJava("hello.run", "-cp", jar + File.pathSeparator + getKotlinRuntimePath(), "hello.HelloPackage");
|
runJava("hello.run", "-cp", classpath, "hello.HelloPackage");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getClassPathForAnt() {
|
private static String getClassPathForAnt() {
|
||||||
return UtilsPackage.join(Arrays.asList(
|
return UtilsPackage.join(Arrays.asList(
|
||||||
getCompilerLib() + File.separator + "kotlin-ant.jar",
|
getCompilerLib() + File.separator + "kotlin-ant.jar",
|
||||||
getCompilerLib() + File.separator + "kotlin-compiler.jar",
|
getCompilerLib() + File.separator + "kotlin-compiler.jar",
|
||||||
getKotlinRuntimePath()
|
ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath()
|
||||||
), File.pathSeparator);
|
), File.pathSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,15 @@ package org.jetbrains.kotlin.integration;
|
|||||||
|
|
||||||
import com.intellij.util.ArrayUtil;
|
import com.intellij.util.ArrayUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
|
||||||
|
import org.jetbrains.kotlin.utils.UtilsPackage;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.TestName;
|
import org.junit.rules.TestName;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
@@ -40,13 +43,16 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int runCompiler(String logName, String... arguments) throws Exception {
|
private int runCompiler(String logName, String... arguments) throws Exception {
|
||||||
String classpath = getCompilerLib().getAbsolutePath() + File.separator + "kotlin-compiler.jar" + File.pathSeparator +
|
|
||||||
getKotlinRuntimePath();
|
|
||||||
|
|
||||||
Collection<String> javaArgs = new ArrayList<String>();
|
Collection<String> javaArgs = new ArrayList<String>();
|
||||||
|
|
||||||
javaArgs.add("-cp");
|
javaArgs.add("-cp");
|
||||||
javaArgs.add(classpath);
|
javaArgs.add(UtilsPackage.join(Arrays.asList(
|
||||||
|
getCompilerLib().getAbsolutePath() + File.separator + "kotlin-compiler.jar",
|
||||||
|
ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath(),
|
||||||
|
ForTestCompileRuntime.reflectJarForTests().getAbsolutePath()
|
||||||
|
), File.pathSeparator));
|
||||||
javaArgs.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler");
|
javaArgs.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler");
|
||||||
|
|
||||||
Collections.addAll(javaArgs, arguments);
|
Collections.addAll(javaArgs, arguments);
|
||||||
|
|
||||||
return runJava(logName, ArrayUtil.toStringArray(javaArgs));
|
return runJava(logName, ArrayUtil.toStringArray(javaArgs));
|
||||||
@@ -81,7 +87,8 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase {
|
|||||||
String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "smoke.jar";
|
String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "smoke.jar";
|
||||||
|
|
||||||
assertEquals("compilation failed", 0, runCompiler("Smoke.compile", "-module", "Smoke.ktm", "-d", jar));
|
assertEquals("compilation failed", 0, runCompiler("Smoke.compile", "-module", "Smoke.ktm", "-d", jar));
|
||||||
runJava("Smoke.run", "-cp", jar + File.pathSeparator + getKotlinRuntimePath(), "Smoke.SmokePackage", "1", "2", "3");
|
String classpath = jar + File.pathSeparator + ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath();
|
||||||
|
runJava("Smoke.run", "-cp", classpath, "Smoke.SmokePackage", "1", "2", "3");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import kotlin.KotlinPackage;
|
|||||||
import org.intellij.lang.annotations.Language;
|
import org.intellij.lang.annotations.Language;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.KotlinVersion;
|
import org.jetbrains.kotlin.cli.common.KotlinVersion;
|
||||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
|
|
||||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||||
import org.jetbrains.kotlin.test.Tmpdir;
|
import org.jetbrains.kotlin.test.Tmpdir;
|
||||||
import org.jetbrains.kotlin.utils.PathUtil;
|
import org.jetbrains.kotlin.utils.PathUtil;
|
||||||
@@ -166,10 +165,6 @@ public abstract class KotlinIntegrationTestBase {
|
|||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String getKotlinRuntimePath() {
|
|
||||||
return ForTestCompileRuntime.runtimeJarForTests().getAbsolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static File getKotlinProjectHome() {
|
protected static File getKotlinProjectHome() {
|
||||||
return new File(PathManager.getHomePath()).getParentFile();
|
return new File(PathManager.getHomePath()).getParentFile();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,14 +385,21 @@ public class JetTestUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static CompilerConfiguration compilerConfigurationForTests(@NotNull ConfigurationKind configurationKind,
|
public static CompilerConfiguration compilerConfigurationForTests(
|
||||||
@NotNull TestJdkKind jdkKind, File... extraClasspath) {
|
@NotNull ConfigurationKind configurationKind,
|
||||||
|
@NotNull TestJdkKind jdkKind,
|
||||||
|
@NotNull File... extraClasspath
|
||||||
|
) {
|
||||||
return compilerConfigurationForTests(configurationKind, jdkKind, Arrays.asList(extraClasspath), Collections.<File>emptyList());
|
return compilerConfigurationForTests(configurationKind, jdkKind, Arrays.asList(extraClasspath), Collections.<File>emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static CompilerConfiguration compilerConfigurationForTests(@NotNull ConfigurationKind configurationKind,
|
public static CompilerConfiguration compilerConfigurationForTests(
|
||||||
@NotNull TestJdkKind jdkKind, @NotNull Collection<File> extraClasspath, @NotNull Collection<File> priorityClasspath) {
|
@NotNull ConfigurationKind configurationKind,
|
||||||
|
@NotNull TestJdkKind jdkKind,
|
||||||
|
@NotNull Collection<File> extraClasspath,
|
||||||
|
@NotNull Collection<File> priorityClasspath
|
||||||
|
) {
|
||||||
CompilerConfiguration configuration = new CompilerConfiguration();
|
CompilerConfiguration configuration = new CompilerConfiguration();
|
||||||
configuration.addAll(CLASSPATH_KEY, priorityClasspath);
|
configuration.addAll(CLASSPATH_KEY, priorityClasspath);
|
||||||
if (jdkKind == TestJdkKind.MOCK_JDK) {
|
if (jdkKind == TestJdkKind.MOCK_JDK) {
|
||||||
@@ -406,13 +413,15 @@ public class JetTestUtils {
|
|||||||
}
|
}
|
||||||
if (configurationKind == ALL) {
|
if (configurationKind == ALL) {
|
||||||
configuration.add(CLASSPATH_KEY, ForTestCompileRuntime.runtimeJarForTests());
|
configuration.add(CLASSPATH_KEY, ForTestCompileRuntime.runtimeJarForTests());
|
||||||
|
configuration.add(CLASSPATH_KEY, ForTestCompileRuntime.reflectJarForTests());
|
||||||
}
|
}
|
||||||
configuration.addAll(CLASSPATH_KEY, extraClasspath);
|
configuration.addAll(CLASSPATH_KEY, extraClasspath);
|
||||||
|
|
||||||
if (configurationKind == ALL || configurationKind == JDK_AND_ANNOTATIONS) {
|
if (configurationKind == ALL || configurationKind == JDK_AND_ANNOTATIONS) {
|
||||||
if (jdkKind == TestJdkKind.ANDROID_API) {
|
if (jdkKind == TestJdkKind.ANDROID_API) {
|
||||||
configuration.add(ANNOTATIONS_PATH_KEY, getAndroidSdkAnnotationsJar());
|
configuration.add(ANNOTATIONS_PATH_KEY, getAndroidSdkAnnotationsJar());
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
configuration.add(ANNOTATIONS_PATH_KEY, getJdkAnnotationsJar());
|
configuration.add(ANNOTATIONS_PATH_KEY, getJdkAnnotationsJar());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package kotlin.jvm;
|
|||||||
|
|
||||||
public class KotlinReflectionNotSupportedError extends Error {
|
public class KotlinReflectionNotSupportedError extends Error {
|
||||||
public KotlinReflectionNotSupportedError() {
|
public KotlinReflectionNotSupportedError() {
|
||||||
super("Kotlin reflection implementation is not found at runtime. " +
|
super("Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath");
|
||||||
"Make sure you do have kotlin-runtime.jar and do not have kotlin-runtime-minimal.jar in the classpath");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
<asm.version>3.3.1</asm.version>
|
<asm.version>3.3.1</asm.version>
|
||||||
<dart.name>dart-r3300</dart.name>
|
<dart.name>dart-r3300</dart.name>
|
||||||
<guava.version>11.0.2</guava.version>
|
<guava.version>11.0.2</guava.version>
|
||||||
|
<protobuf.version>2.5.0</protobuf.version>
|
||||||
<junit-version>4.11</junit-version>
|
<junit-version>4.11</junit-version>
|
||||||
<kotlin-maven-plugin.version>0.2.3.8</kotlin-maven-plugin.version>
|
<kotlin-maven-plugin.version>0.2.3.8</kotlin-maven-plugin.version>
|
||||||
<kotlin-dist>${project-root}/dist</kotlin-dist>
|
<kotlin-dist>${project-root}/dist</kotlin-dist>
|
||||||
|
|||||||
@@ -21,6 +21,16 @@
|
|||||||
<artifactId>kotlin-stdlib</artifactId>
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
<version>${protobuf.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.inject</groupId>
|
||||||
|
<artifactId>javax.inject</artifactId>
|
||||||
|
<version>1</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -40,7 +50,13 @@
|
|||||||
<target>
|
<target>
|
||||||
<delete dir="${basedir}/target/copied-sources" failonerror="false" />
|
<delete dir="${basedir}/target/copied-sources" failonerror="false" />
|
||||||
<copy todir="${basedir}/target/copied-sources">
|
<copy todir="${basedir}/target/copied-sources">
|
||||||
|
<fileset dir="${basedir}/../../../core/descriptor.loader.java/src"/>
|
||||||
|
<fileset dir="${basedir}/../../../core/descriptors/src"/>
|
||||||
|
<fileset dir="${basedir}/../../../core/descriptors.runtime/src"/>
|
||||||
<fileset dir="${basedir}/../../../core/reflection.jvm/src"/>
|
<fileset dir="${basedir}/../../../core/reflection.jvm/src"/>
|
||||||
|
<fileset dir="${basedir}/../../../core/serialization/src"/>
|
||||||
|
<fileset dir="${basedir}/../../../core/serialization.jvm/src"/>
|
||||||
|
<fileset dir="${basedir}/../../../core/util.runtime/src"/>
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ manifest.impl.title.kotlin.compiler.sources=Kotlin Compiler Sources
|
|||||||
manifest.impl.title.kotlin.compiler.ant.task=Kotlin Compiler Ant Tasks
|
manifest.impl.title.kotlin.compiler.ant.task=Kotlin Compiler Ant Tasks
|
||||||
|
|
||||||
manifest.impl.title.kotlin.jvm.runtime=Kotlin Runtime
|
manifest.impl.title.kotlin.jvm.runtime=Kotlin Runtime
|
||||||
manifest.impl.title.kotlin.jvm.runtime.minimal=Kotlin Runtime Minimal
|
manifest.impl.title.kotlin.jvm.reflect=Kotlin Reflect
|
||||||
manifest.impl.title.kotlin.jvm.runtime.sources=Kotlin Runtime Sources
|
manifest.impl.title.kotlin.jvm.runtime.sources=Kotlin Runtime Sources
|
||||||
manifest.impl.title.kotlin.jvm.runtime.minimal.sources=Kotlin Runtime Minimal Sources
|
|
||||||
|
|
||||||
manifest.impl.title.kotlin.javascript.stdlib=Kotlin JavaScript StdLib
|
manifest.impl.title.kotlin.javascript.stdlib=Kotlin JavaScript StdLib
|
||||||
manifest.spec.title.kotlin.javascript.lib=Kotlin JavaScript Lib
|
manifest.spec.title.kotlin.javascript.lib=Kotlin JavaScript Lib
|
||||||
|
|||||||
Reference in New Issue
Block a user