First, I just want to say that Jaci’s GradleRIO is just awesome. Deploy time is incredibly fast and it just works so much better than deploying code via Eclipse.
After stumbling across GradleRIO a few weeks ago, I also came across Jaci’s EmbeddedTools. As I understand it, we should be able to use this gradle plugin to be able to deploy code to multiple targets at once (example: roborio and nvidia jetson).
I was able to get GradleRIO working, but I don’t think I understand gradle or this EmbeddedTools plugin well enough to be able make it work and the documentation is a little bit overwhelming to me.
What should the build.gradle and settings.gradle look like in order to properly deploy code to an nvidia jetson (or really any other device)?
Let’s assume that this is a sub-project in my overall root project.
Let’s assume the ip address of the jetson is 10.xx.yy.31.
And let’s also assume the user and pass for the jetson is the default ‘ubuntu’.
EmbeddedTools is a generalized version of GradleRIO without the FRC-specific components, it contains all the deploy and native platform building logic.
To get started, you need a cross-compiler for your target. I’m uncertain if one exists for the Jetson, but I’m sure you can find one somewhere.
This assumes using C++, but if you’re using java you can ignore the toolchains bit.
From there, you can link the cross compiler as a normal toolchain (this will have to be done the same way as with normal gradle, here). This document will also show you how to make a new platform and native component for your actual device.
The EmbeddedTools specific components are fairly simple. You can setup your remote target settings as shown at the bottom of the readme, which also shows how to setup your artifacts.
There’s a pretty solid example for C++ here and Java here.
NOTE: If you’re not using C++ or Java, or if a cross compiler isn’t available, you can actually just use EmbeddedTools’ fileCollectionArtifact to deploy a set of source files and a commandArtifact to compile/run them locally.
Your settings.gradle file is the same as almost any other project. If you’re not doing multiproject builds, you don’t need a settings.gradle file. The coprocessor examples linked above are written for a raspberry pi, but they can be generalized to any coprocessor given a toolchain.
There’s more documentation planned to be written for the new GradleRIO/EmbeddedTools model in the coming weeks, now that it’s largely finalized.