Skip to content

Commit

Permalink
Revert "Dynamic compiler loading proof of concept"
Browse files Browse the repository at this point in the history
This reverts commit 8b8320b.
  • Loading branch information
zarechenskiy committed Mar 28, 2018
1 parent 3fe806d commit 726d8be
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 107 deletions.
6 changes: 2 additions & 4 deletions kotlin-bundled-compiler/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ bin.includes = META-INF/,\
lib/util-formatter.jar,\
lib/kotlin-formatter.jar,\
lib/idea-formatter.jar,\
lib/kotlin-script-runtime.jar,\
user-bundle/
src.includes = lib/,\
user-bundle/
lib/kotlin-script-runtime.jar
src.includes = lib/
bin.excludes = lib/kotlin-compiler-sources.jar,\
lib/downloads/
src.excludes = lib/downloads/,\
Expand Down
66 changes: 20 additions & 46 deletions kotlin-bundled-compiler/get_bundled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
<include name="com/intellij/formatting/**/*.class" />
<include name="com/intellij/application/options/**/*.class" />
<include name="com/intellij/openapi/options/**/*.class" />
<include name="com/intellij/configurationStore/*.class" />
<include name="com/intellij/openapi/progress/*.class" />
<include name="com/intellij/configurationStore/*.class" />
<include name="com/intellij/openapi/progress/*.class" />
</patternset>
</unzip>

Expand Down Expand Up @@ -195,7 +195,7 @@
<attribute name="Implementation-Version" value="1.0"/>
</manifest>
</jar>

<delete dir="${download.dir}/${openapi-formatter}"/>
<delete file="${target.dir}/openapi.jar"/>
<delete dir="${download.dir}/${util-formatter}"/>
Expand All @@ -204,22 +204,22 @@
<delete file="${target.dir}/idea.jar"/>
</sequential>

<unzip src="${download.dir}/${compiler-artifact-file}" dest="${target.dir}">
<patternset>
<include name="Kotlin/kotlinc/lib/kotlin-compiler.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-stdlib.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-reflect.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-script-runtime.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-jdk-annotations.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-stdlib-sources.jar" />
</patternset>
<mapper type="flatten"/>
</unzip>

<get
src="${teamcity-kotlin-url}/internal/kotlin-ide-common.jar${branch}"
dest="${target.dir}/kotlin-ide-common.jar"
usetimestamp="true" />
<unzip src="${download.dir}/${compiler-artifact-file}" dest="${target.dir}">
<patternset>
<include name="Kotlin/kotlinc/lib/kotlin-compiler.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-stdlib.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-reflect.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-script-runtime.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-jdk-annotations.jar" />
<include name="Kotlin/kotlinc/lib/kotlin-stdlib-sources.jar" />
</patternset>
<mapper type="flatten"/>
</unzip>
<get
src="${teamcity-kotlin-url}/internal/kotlin-ide-common.jar${branch}"
dest="${target.dir}/kotlin-ide-common.jar"
usetimestamp="true" />

<get
src="${teamcity-kotlin-url}/internal/kotlin-formatter.jar${branch}"
Expand Down Expand Up @@ -250,33 +250,7 @@
</zip>
</target>

<target name="download_user_bundle">
<delete dir = "user-bundle" />
<mkdir dir="user-bundle/lib"/>

<get
src="http://central.maven.org/maven2/org/jetbrains/kotlin/kotlin-compiler/1.2.30/kotlin-compiler-1.2.30.jar"
dest="user-bundle/lib/kotlin-compiler.jar"
usetimestamp="true" />
<get
src="http://central.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.2.30/kotlin-stdlib-1.2.30.jar"
dest="user-bundle/lib/kotlin-stdlib.jar"
usetimestamp="true" />
<get
src="http://central.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.2.30/kotlin-stdlib-1.2.30-sources.jar"
dest="user-bundle/lib/kotlin-stdlib-sources.jar"
usetimestamp="true" />
<get
src="http://central.maven.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.2.30/kotlin-reflect-1.2.30.jar"
dest="user-bundle/lib/kotlin-reflect.jar"
usetimestamp="true" />
<get
src="http://central.maven.org/maven2/org/jetbrains/kotlin/kotlin-script-runtime/1.2.30/kotlin-script-runtime-1.2.30.jar"
dest="user-bundle/lib/kotlin-script-runtime.jar"
usetimestamp="true" />
</target>

<target name="get_bundled" depends="download_bundled, download_user_bundle, download_test_data,
<target name="get_bundled" depends="download_bundled, download_test_data,
download_test_framework_dependencies, refresh_eclipse">
</target>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package org.jetbrains.kotlin.aspects.refactoring;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.WorkingCopyOwner;
import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringDescriptorUtil;
import org.jetbrains.kotlin.core.resolve.lang.java.structure.EclipseJavaElementUtil;
import org.jetbrains.kotlin.ui.refactorings.rename.KotlinLightElementsFactory;


public aspect KotlinJavaDescriptorAspect {
pointcut handleToElement(final WorkingCopyOwner owner, final String project, final String handle, final boolean check) :
args(owner, project, handle, check)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
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.jvm.K2JVMCompiler;
import org.jetbrains.kotlin.core.launch.CompilerOutputData;
import org.jetbrains.kotlin.core.launch.CompilerOutputParser;
import org.jetbrains.kotlin.core.launch.KotlinCLICompiler;
import org.jetbrains.kotlin.core.log.KotlinLogger;
import org.jetbrains.kotlin.core.utils.ProjectUtils;

Expand Down Expand Up @@ -61,7 +63,7 @@ public KotlinCompilerResult execKotlinCompiler(@NotNull String[] arguments) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outputStream);

UserBundleLoader.INSTANCE.invokeCompiler(out, arguments);
KotlinCLICompiler.doMain(new K2JVMCompiler(), out, arguments);

BufferedReader reader = new BufferedReader(new StringReader(outputStream.toString()));
return parseCompilerOutput(reader);
Expand Down Expand Up @@ -123,7 +125,7 @@ public void clear() {
}
},
reader);

boolean result = true;
for (CompilerMessageSeverity severity : severities) {
if (severity.equals(CompilerMessageSeverity.ERROR) || severity.equals(CompilerMessageSeverity.EXCEPTION)) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private static String buildLibName(String libName) {
private static String getKtHome() {
try {
Bundle compilerBundle = Platform.getBundle("org.jetbrains.kotlin.bundled-compiler");
return FileLocator.toFileURL(compilerBundle.getEntry("/user-bundle/")).getFile();
return FileLocator.toFileURL(compilerBundle.getEntry("/")).getFile();
} catch (IOException e) {
KotlinLogger.logAndThrow(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil


object KotlinToggleBreakpointAdapter : IToggleBreakpointsTarget {
override public fun toggleLineBreakpoints(part: IWorkbenchPart, selection: ISelection) {
val editor = getEditor(part)
Expand Down

0 comments on commit 726d8be

Please sign in to comment.