Skip to content

Commit a8b47ce

Browse files
cmagliefacchinm
authored andcommitted
Calling arduino builder with GPRC API [experimental]
1 parent 395449e commit a8b47ce

24 files changed

+3099
-1
lines changed

app/src/processing/app/SketchController.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import cc.arduino.Compiler;
2727
import cc.arduino.CompilerProgressListener;
2828
import cc.arduino.UploaderUtils;
29+
import cc.arduino.builder.ArduinoBuilder;
2930
import cc.arduino.packages.Uploader;
3031
import processing.app.debug.RunnerException;
3132
import processing.app.forms.PasswordAuthorizationDialog;
@@ -58,10 +59,18 @@
5859
public class SketchController {
5960
private final Editor editor;
6061
private final Sketch sketch;
62+
private final ArduinoBuilder builder;
6163

6264
public SketchController(Editor _editor, Sketch _sketch) {
65+
ArduinoBuilder _builder = null;
66+
try {
67+
_builder = new ArduinoBuilder();
68+
} catch (IOException e) {
69+
e.printStackTrace();
70+
}
6371
editor = _editor;
6472
sketch = _sketch;
73+
builder = _builder;
6574
}
6675

6776
private boolean renamingCode;
@@ -706,7 +715,8 @@ public String codeComplete(SketchFile file, int line, int col) throws RunnerExce
706715
}
707716

708717
try {
709-
return new Compiler(pathToSketch, sketch).codeComplete(editor.status.getCompilerProgressListeners(), requestedFile, line, col);
718+
return builder.codeComplete(BaseNoGui.getTargetBoard(), pathToSketch, requestedFile, line, col);
719+
//return new Compiler(pathToSketch, sketch).codeComplete(editor.status.getCompilerProgressListeners(), requestedFile, line, col);
710720
} finally {
711721
// Make sure we clean up any temporary sketch copy
712722
if (deleteTemp)

arduino-core/.classpath

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,21 @@
2424
<classpathentry kind="lib" path="lib/jna-4.2.2.jar"/>
2525
<classpathentry kind="lib" path="lib/jna-platform-4.2.2.jar"/>
2626
<classpathentry kind="lib" path="lib/commons-lang3-3.8.1.jar"/>
27+
<classpathentry kind="lib" path="lib/grpc-netty-1.6.1.jar"/>
28+
<classpathentry kind="lib" path="lib/grpc-protobuf-1.6.1.jar"/>
29+
<classpathentry kind="lib" path="lib/grpc-stub-1.6.1.jar"/>
30+
<classpathentry kind="lib" path="lib/grpc-core-1.6.1.jar"/>
31+
<classpathentry kind="lib" path="lib/guava-19.0.jar"/>
32+
<classpathentry kind="lib" path="lib/grpc-context-1.6.1.jar"/>
33+
<classpathentry kind="lib" path="lib/protobuf-java-3.4.0.jar"/>
34+
<classpathentry kind="lib" path="lib/grpc-services-1.6.1.jar"/>
35+
<classpathentry kind="lib" path="lib/grpc-grpclb-1.6.1.jar"/>
36+
<classpathentry kind="lib" path="lib/grpc-auth-1.6.1.jar"/>
37+
<classpathentry kind="lib" path="lib/grpc-okhttp-1.6.1.jar"/>
38+
<classpathentry kind="lib" path="lib/grpc-protobuf-nano-1.6.1.jar"/>
39+
<classpathentry kind="lib" path="lib/netty-all-4.1.15.Final.jar"/>
40+
<classpathentry kind="lib" path="lib/instrumentation-api-0.4.3.jar"/>
41+
<classpathentry kind="lib" path="lib/grpc-protobuf-lite-1.6.1.jar"/>
42+
>>>>>>> Calling arduino builder with GPRC API [experimental]
2743
<classpathentry kind="output" path="bin"/>
2844
</classpath>

arduino-core/lib/grpc-auth-1.6.1.jar

12.1 KB
Binary file not shown.
20.1 KB
Binary file not shown.

arduino-core/lib/grpc-core-1.6.1.jar

471 KB
Binary file not shown.
131 KB
Binary file not shown.

arduino-core/lib/grpc-netty-1.6.1.jar

173 KB
Binary file not shown.
144 KB
Binary file not shown.
5.76 KB
Binary file not shown.
7.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)