GradleRIO For Not-The-Robot-Code?

I’m working on a project that involves building several binaries (from C++) and placing them on the RoboRIO to run as daemons. I’d like to use GradleRIO, since all of the cross-compilation toolchains, WPIlib dependencies, etc. are built in. I can build and deploy successfully with GradleRIO, but naturally it also sets robotCommand etc. Is there a way to modify the deploy sequence in FRCNativeArtifact.groovy from my project’s build.gradle, or will I need to roll my own extension to NativeArtifact?

Rolling your own extension to NativeArtifact is what you’ll need to do currently. If you create an issue on the GradleRIO repo, we can look into adding another artifact type to allow doing this easily from the DSL. It wouldn’t be too hard.

We do have some major changes to the internals of how NativeArtifacts and that works, so any custom extension you do will break for 2020, but if you create that issue we can easily add something that will make it trivial.

Will do. Thanks!

I’ve already replied on the github issue, but I’ll X-post here for anyone that’s googling.

GradleRIO (or, more accurately, EmbeddedTools), allows you to deploy custom binaries as you will (see the implementation details of FRCNativeArtifact and FRCJavaArtifact in this repo to see how we extend them).

If you still want to deploy a ‘robot binary’, but without the other logic (frckillrobot, robotcommand, etc), you can call a few configuration options inside of the artifact closure:

artifacts {
    artifact('frcJava', edu.wpi.first.gradlerio.frc.FRCJavaArtifact) {
        /* all the other stuff like normal */

        robotCommand = false    // Disable robotCommand
        predeploy.clear()              // Prevents frcKillRobot.sh and other predeploy tasks
        postdeploy.clear()            // Prevents frcKillRobot.sh (restart) and other postdeploy tasks (chmod, sync, ldconfig)
    }
}

Likewise for FRCNativeArtifact.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.