Skip to content

Commit 32cc42c

Browse files
cmagliefacchinm
authored andcommitted
Calling arduino builder with GPRC API [experimental]
1 parent ea9a5be commit 32cc42c

24 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;
@@ -698,7 +707,8 @@ public String codeComplete(SketchFile file, int line, int col) throws RunnerExce
698707
}
699708

700709
try {
701-
return new Compiler(pathToSketch, sketch).codeComplete(editor.status.getCompilerProgressListeners(), requestedFile, line, col);
710+
return builder.codeComplete(BaseNoGui.getTargetBoard(), pathToSketch, requestedFile, line, col);
711+
//return new Compiler(pathToSketch, sketch).codeComplete(editor.status.getCompilerProgressListeners(), requestedFile, line, col);
702712
} finally {
703713
// Make sure we clean up any temporary sketch copy
704714
if (deleteTemp)

arduino-core/.classpath

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,20 @@
3333
<classpathentry kind="lib" path="lib/java-semver-0.8.0.jar"/>
3434
<classpathentry kind="lib" path="lib/jna-4.2.2.jar"/>
3535
<classpathentry kind="lib" path="lib/jna-platform-4.2.2.jar"/>
36+
<classpathentry kind="lib" path="lib/grpc-netty-1.6.1.jar"/>
37+
<classpathentry kind="lib" path="lib/grpc-protobuf-1.6.1.jar"/>
38+
<classpathentry kind="lib" path="lib/grpc-stub-1.6.1.jar"/>
39+
<classpathentry kind="lib" path="lib/grpc-core-1.6.1.jar"/>
40+
<classpathentry kind="lib" path="lib/guava-19.0.jar"/>
41+
<classpathentry kind="lib" path="lib/grpc-context-1.6.1.jar"/>
42+
<classpathentry kind="lib" path="lib/protobuf-java-3.4.0.jar"/>
43+
<classpathentry kind="lib" path="lib/grpc-services-1.6.1.jar"/>
44+
<classpathentry kind="lib" path="lib/grpc-grpclb-1.6.1.jar"/>
45+
<classpathentry kind="lib" path="lib/grpc-auth-1.6.1.jar"/>
46+
<classpathentry kind="lib" path="lib/grpc-okhttp-1.6.1.jar"/>
47+
<classpathentry kind="lib" path="lib/grpc-protobuf-nano-1.6.1.jar"/>
48+
<classpathentry kind="lib" path="lib/netty-all-4.1.15.Final.jar"/>
49+
<classpathentry kind="lib" path="lib/instrumentation-api-0.4.3.jar"/>
50+
<classpathentry kind="lib" path="lib/grpc-protobuf-lite-1.6.1.jar"/>
3651
<classpathentry kind="output" path="bin"/>
3752
</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)