Skip to content

Commit 1aacb39

Browse files
cmagliefacchinm
authored andcommitted
Calling arduino builder with GPRC API [experimental]
1 parent 598f912 commit 1aacb39

25 files changed

+3098
-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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,20 @@
2727
<classpathentry kind="lib" path="lib/commons-lang3-3.8.1.jar"/>
2828
<classpathentry kind="lib" path="lib/jssc-2.8.0-arduino4.jar"/>
2929
<classpathentry kind="lib" path="lib/commons-io-2.6.jar"/>
30+
<classpathentry kind="lib" path="lib/grpc-netty-1.6.1.jar"/>
31+
<classpathentry kind="lib" path="lib/grpc-protobuf-1.6.1.jar"/>
32+
<classpathentry kind="lib" path="lib/grpc-stub-1.6.1.jar"/>
33+
<classpathentry kind="lib" path="lib/grpc-core-1.6.1.jar"/>
34+
<classpathentry kind="lib" path="lib/guava-19.0.jar"/>
35+
<classpathentry kind="lib" path="lib/grpc-context-1.6.1.jar"/>
36+
<classpathentry kind="lib" path="lib/protobuf-java-3.4.0.jar"/>
37+
<classpathentry kind="lib" path="lib/grpc-services-1.6.1.jar"/>
38+
<classpathentry kind="lib" path="lib/grpc-grpclb-1.6.1.jar"/>
39+
<classpathentry kind="lib" path="lib/grpc-auth-1.6.1.jar"/>
40+
<classpathentry kind="lib" path="lib/grpc-okhttp-1.6.1.jar"/>
41+
<classpathentry kind="lib" path="lib/grpc-protobuf-nano-1.6.1.jar"/>
42+
<classpathentry kind="lib" path="lib/netty-all-4.1.15.Final.jar"/>
43+
<classpathentry kind="lib" path="lib/instrumentation-api-0.4.3.jar"/>
44+
<classpathentry kind="lib" path="lib/grpc-protobuf-lite-1.6.1.jar"/>
3045
<classpathentry kind="output" path="bin"/>
3146
</classpath>
12.1 KB
Binary file not shown.
20.1 KB
Binary file not shown.
471 KB
Binary file not shown.
131 KB
Binary file not shown.
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)