Implement TeaVM debugger in IDEA

This commit is contained in:
Alexey Andreev 2016-06-25 23:43:29 +03:00
parent bad97d70de
commit a2e1fbdeb8
19 changed files with 65 additions and 10 deletions

View File

@ -11,6 +11,7 @@
<module fileurl="file://$PROJECT_DIR$/extras-slf4j/teavm-extras-slf4j.iml" filepath="$PROJECT_DIR$/extras-slf4j/teavm-extras-slf4j.iml" /> <module fileurl="file://$PROJECT_DIR$/extras-slf4j/teavm-extras-slf4j.iml" filepath="$PROJECT_DIR$/extras-slf4j/teavm-extras-slf4j.iml" />
<module fileurl="file://$PROJECT_DIR$/html4j/teavm-html4j.iml" filepath="$PROJECT_DIR$/html4j/teavm-html4j.iml" /> <module fileurl="file://$PROJECT_DIR$/html4j/teavm-html4j.iml" filepath="$PROJECT_DIR$/html4j/teavm-html4j.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/idea/teavm-idea-plugin.iml" filepath="$PROJECT_DIR$/tools/idea/teavm-idea-plugin.iml" /> <module fileurl="file://$PROJECT_DIR$/tools/idea/teavm-idea-plugin.iml" filepath="$PROJECT_DIR$/tools/idea/teavm-idea-plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/idea/jps-common/teavm-jps-common.iml" filepath="$PROJECT_DIR$/tools/idea/jps-common/teavm-jps-common.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/idea/jps-plugin/teavm-jps-plugin.iml" filepath="$PROJECT_DIR$/tools/idea/jps-plugin/teavm-jps-plugin.iml" /> <module fileurl="file://$PROJECT_DIR$/tools/idea/jps-plugin/teavm-jps-plugin.iml" filepath="$PROJECT_DIR$/tools/idea/jps-plugin/teavm-jps-plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/jso/core/teavm-jso.iml" filepath="$PROJECT_DIR$/jso/core/teavm-jso.iml" /> <module fileurl="file://$PROJECT_DIR$/jso/core/teavm-jso.iml" filepath="$PROJECT_DIR$/jso/core/teavm-jso.iml" />
<module fileurl="file://$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" filepath="$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" /> <module fileurl="file://$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" filepath="$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" />

View File

@ -38,4 +38,9 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: com.jcraft:jzlib:1.1.3" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: com.jcraft:jzlib:1.1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: joda-time:joda-time:2.7" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: joda-time:joda-time:2.7" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.async.AsyncProgram" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -63,4 +63,9 @@
<orderEntry type="library" name="Maven: org.netbeans.html:net.java.html.boot:1.2.3" level="project" /> <orderEntry type="library" name="Maven: org.netbeans.html:net.java.html.boot:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.netbeans.html:net.java.html:1.2.3" level="project" /> <orderEntry type="library" name="Maven: org.netbeans.html:net.java.html:1.2.3" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.benchmark.teavm.BenchmarkStarter" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -39,4 +39,9 @@
<orderEntry type="module" module-name="teavm-jso" scope="PROVIDED" /> <orderEntry type="module" module-name="teavm-jso" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.hello.Client" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -42,4 +42,9 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: joda-time:joda-time:2.7" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: joda-time:joda-time:2.7" level="project" />
<orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" /> <orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.kotlin.HelloKt" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -39,4 +39,9 @@
<orderEntry type="module" module-name="teavm-jso" /> <orderEntry type="module" module-name="teavm-jso" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.11.7" level="project" /> <orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.11.7" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.scala.Client" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -39,4 +39,9 @@
<orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" /> <orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.storage.Application" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -39,4 +39,9 @@
<orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" /> <orderEntry type="module" module-name="teavm-jso-apis" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
</component> </component>
<component name="teavm">
<option name="enabled" value="true" />
<option name="mainClass" value="org.teavm.samples.video.Player" />
<option name="targetDirectory" value="$MODULE_DIR$/target/generated/js/teavm" />
</component>
</module> </module>

View File

@ -14,7 +14,7 @@
<excludeFolder url="file://$MODULE_DIR$/classlib" /> <excludeFolder url="file://$MODULE_DIR$/classlib" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

View File

@ -19,6 +19,7 @@ import java.rmi.Remote;
import java.rmi.RemoteException; import java.rmi.RemoteException;
public interface TeaVMBuilderAssistant extends Remote { public interface TeaVMBuilderAssistant extends Remote {
String REMOTE_PORT = "teavm.jps.remote-port";
String ID = "TeaVM-JPS-Assistant"; String ID = "TeaVM-JPS-Assistant";
TeaVMElementLocation getMethodLocation(String className, String methodName, String methodDesc) TeaVMElementLocation getMethodLocation(String className, String methodName, String methodDesc)

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../jps-plugin/lib/teavm-all.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View File

@ -15,6 +15,7 @@
*/ */
package org.teavm.idea.jps; package org.teavm.idea.jps;
import static org.teavm.idea.jps.remote.TeaVMBuilderAssistant.REMOTE_PORT;
import java.io.IOException; import java.io.IOException;
import java.rmi.NotBoundException; import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
@ -35,7 +36,6 @@ import org.jetbrains.jps.model.module.JpsModule;
import org.teavm.idea.jps.remote.TeaVMBuilderAssistant; import org.teavm.idea.jps.remote.TeaVMBuilderAssistant;
public class TeaVMBuilder extends ModuleLevelBuilder { public class TeaVMBuilder extends ModuleLevelBuilder {
public static final String REMOTE_PORT = "teavm.jps.remote-port";
private static TeaVMBuilderAssistant assistant; private static TeaVMBuilderAssistant assistant;
public TeaVMBuilder() { public TeaVMBuilder() {

View File

@ -11,8 +11,6 @@
</content> </content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" /> <orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-debug-all:5.0.4" level="project" /> <orderEntry type="module" module-name="teavm-jps-common" />
<orderEntry type="library" name="teavm-all" level="project" />
<orderEntry type="library" name="teavm-all" level="project" />
</component> </component>
</module> </module>

View File

@ -15,11 +15,11 @@
*/ */
package org.teavm.idea; package org.teavm.idea;
import static org.teavm.idea.jps.remote.TeaVMBuilderAssistant.REMOTE_PORT;
import com.intellij.compiler.server.BuildProcessParametersProvider; import com.intellij.compiler.server.BuildProcessParametersProvider;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.teavm.idea.jps.TeaVMBuilder;
public class TeaVMJPSConfigurator extends BuildProcessParametersProvider { public class TeaVMJPSConfigurator extends BuildProcessParametersProvider {
private TeaVMJPSRemoteService remoteService; private TeaVMJPSRemoteService remoteService;
@ -31,6 +31,6 @@ public class TeaVMJPSConfigurator extends BuildProcessParametersProvider {
@NotNull @NotNull
@Override @Override
public List<String> getVMArguments() { public List<String> getVMArguments() {
return Collections.singletonList("-D" + TeaVMBuilder.REMOTE_PORT + "=" + remoteService.getPort()); return Collections.singletonList("-D" + REMOTE_PORT + "=" + remoteService.getPort());
} }
} }

View File

@ -29,7 +29,7 @@
<moduleConfigurable instance="org.teavm.idea.ui.TeaVMConfigurable"/> <moduleConfigurable instance="org.teavm.idea.ui.TeaVMConfigurable"/>
<moduleService serviceInterface="org.teavm.idea.TeaVMConfigurationStorage" <moduleService serviceInterface="org.teavm.idea.TeaVMConfigurationStorage"
serviceImplementation="org.teavm.idea.TeaVMConfigurationStorage"/> serviceImplementation="org.teavm.idea.TeaVMConfigurationStorage"/>
<compileServer.plugin classpath="jps/teavm-jps-plugin.jar;teavm-all.jar"/> <compileServer.plugin classpath="jps/teavm-jps-plugin.jar;teavm-all.jar;teavm-jps-common.jar"/>
<buildProcess.parametersProvider implementation="org.teavm.idea.TeaVMJPSConfigurator"/> <buildProcess.parametersProvider implementation="org.teavm.idea.TeaVMJPSConfigurator"/>
<configurationType implementation="org.teavm.idea.debug.TeaVMDebugConfigurationType"/> <configurationType implementation="org.teavm.idea.debug.TeaVMDebugConfigurationType"/>
<programRunner implementation="org.teavm.idea.debug.TeaVMDebugRunner"/> <programRunner implementation="org.teavm.idea.debug.TeaVMDebugRunner"/>

View File

@ -12,7 +12,7 @@
</content> </content>
<orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" /> <orderEntry type="jdk" jdkName="IntelliJ IDEA" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="teavm-jps-plugin" /> <orderEntry type="module" module-name="teavm-jps-common" exported="" />
<orderEntry type="library" name="teavm-all" level="project" /> <orderEntry type="module" module-name="teavm-jps-plugin" exported="" />
</component> </component>
</module> </module>