CLI: use JDK 1.6 to compile the "kotlin" launcher script
"kotlin" is used to run programs compiled by "kotlinc" which supports emitting JVM bytecode 1.6, so it should also be runnable on JDK 1.6
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
<property name="tools.jar" value="${env.JDK_18}/lib/tools.jar"/>
|
||||
|
||||
<property name="java.target" value="1.8"/>
|
||||
<property name="java.target.1.6" value="1.6"/>
|
||||
|
||||
<condition property="bootstrap.or.local.build" value="true" else="false">
|
||||
<or>
|
||||
@@ -306,6 +305,8 @@
|
||||
<cleandir dir="${output}/classes/runner"/>
|
||||
<kotlinc output="${output}/classes/runner">
|
||||
<src location="${basedir}/compiler/cli/cli-runner/src"/>
|
||||
<compilerarg line="-jvm-target 1.6"/>
|
||||
<compilerarg line="-jdk-home ${env.JDK_16}"/>
|
||||
</kotlinc>
|
||||
|
||||
<local name="runtime.jar"/>
|
||||
@@ -863,7 +864,7 @@
|
||||
</java>
|
||||
|
||||
<javac2 srcdir="${toString:src.dirset}" destdir="@{output}" debug="true" debuglevel="lines,vars,source"
|
||||
includeAntRuntime="false" source="${java.target.1.6}" target="${java.target.1.6}">
|
||||
includeAntRuntime="false" source="1.6" target="1.6">
|
||||
<skip pattern="kotlin/Metadata"/>
|
||||
<classpath>
|
||||
<path refid="classpath.path"/>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="kotlin-runtime" level="project" />
|
||||
</component>
|
||||
|
||||
@@ -77,9 +77,13 @@ class MainClassRunner(override val className: String) : AbstractRunner() {
|
||||
class JarRunner(private val path: String) : AbstractRunner() {
|
||||
override val className: String =
|
||||
try {
|
||||
JarFile(path).use { jar ->
|
||||
val jar = JarFile(path)
|
||||
try {
|
||||
jar.manifest.mainAttributes.getValue(Attributes.Name.MAIN_CLASS)
|
||||
}
|
||||
finally {
|
||||
jar.close()
|
||||
}
|
||||
}
|
||||
catch (e: IOException) {
|
||||
throw RunnerException("could not read manifest from " + path + ": " + e.message)
|
||||
|
||||
Reference in New Issue
Block a user