Fix compilation of IDEA plugin

This commit is contained in:
Alexey Andreev 2019-03-11 12:32:15 +03:00
parent 3acf1f9538
commit f08faba3d2
3 changed files with 28 additions and 19 deletions

View File

@ -9,14 +9,15 @@
</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" scope="PROVIDED" name="Maven: org.teavm.idea:openapi:2017.3.5" level="project" /> <orderEntry type="module-library">
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:annotations:2017.3.5" level="project" /> <library>
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jdom:2017.3.5" level="project" /> <CLASSES>
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:util:2017.3.5" level="project" /> <root url="jar://$MODULE_DIR$/../idea-artifacts/dependencies/teavm.jar!/" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-model:2017.3.5" level="project" /> </CLASSES>
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders:2017.3.5" level="project" /> <JAVADOC />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders-6:2017.3.5" level="project" /> <SOURCES />
<orderEntry type="library" name="Maven: org.teavm.idea:teavm:0.6.0-SNAPSHOT" level="project" /> </library>
</orderEntry>
</component> </component>
<component name="teavm"> <component name="teavm">
<option name="mainClass" value="" /> <option name="mainClass" value="" />

View File

@ -26,6 +26,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@ -267,9 +268,11 @@ class TeaVMBuild {
problemsToReport.add(result); problemsToReport.add(result);
} else { } else {
for (CallSite callSite : node.getCallerCallSites()) { for (CallSite callSite : node.getCallerCallSites()) {
CallLocation nextLocation = new CallLocation(callSite.getCaller().getMethod(), for (CallGraphNode caller : callSite.getCallers()) {
callSite.getLocation()); CallLocation nextLocation = new CallLocation(caller.getMethod(),
workList.add(new Step(new CallLocationList(step.location, step.locationList), nextLocation)); getLocation(callSite.getLocations(caller)));
workList.add(new Step(new CallLocationList(step.location, step.locationList), nextLocation));
}
} }
} }
} }
@ -277,6 +280,10 @@ class TeaVMBuild {
return problemsToReport; return problemsToReport;
} }
private TextLocation getLocation(Collection<? extends TextLocation> location) {
return location.isEmpty() ? null : location.iterator().next();
}
private boolean isValid(ProblemToReport problemToReport) { private boolean isValid(ProblemToReport problemToReport) {
return problemToReport.path != null && (problemToReport.line >= 0 || problemToReport.startOffset >= 0); return problemToReport.path != null && (problemToReport.line >= 0 || problemToReport.startOffset >= 0);
} }

View File

@ -10,14 +10,15 @@
</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" scope="PROVIDED" name="Maven: org.teavm.idea:openapi:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:annotations:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:util:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jdom:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-model:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders:2017.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.teavm.idea:jps-builders-6:2017.3.5" level="project" />
<orderEntry type="module" module-name="teavm-jps-common" /> <orderEntry type="module" module-name="teavm-jps-common" />
<orderEntry type="library" name="Maven: org.teavm.idea:teavm:0.6.0-SNAPSHOT" level="project" /> <orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../idea-artifacts/dependencies/teavm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>