Skip to content

Build System

Dominik Winecki edited this page Sep 16, 2016 · 1 revision

The FRC plugin provides the athena build system. Athena is a script uses Apache ANT to compile and deploy code to a roboRio.

The build.xml in each project serves as a pointer to the main build.xml installed with wpilib. Copy of build.xml.

Config

Along with the build.xml there is also a build.properties file in the same directory. This file defines team spesific and OS spesific properties to be accessed by the build script.

These properties are refferenced with a special syntax where ${prop-name} will be replaced with the value of property defined as prop-name.

Targets

ANT uses targets with branching dependencies to build the program.

There are 4-5 targets not mentioned here but they are not very important to the build process.

get-target-ip

get-target-ip trys to get the IP of the roboRio. It uses multiple steps in failover mode to get the highest chance of a connection.

  1. Try to reach roboRIO-${team-number}-FRC.local
  2. Try to reach 172.22.11.2, static USB
  3. Try to reach 10.${ip.upper}.${ip.lower}.2

Upon failure of all three opeion an assertion command fails an displays roboRIO not found message.

compile

compile will compile the java source code and has no dependencies.

Files from ${src.dir} will generate binary class files in ${build.dir}.

The javac command is used to compile Java.

jar

jar depends on compile.

jar will create a Java runnable jar file from the compiled source code and the provided librarys.

The output will be the ${dist.jar}.

deploy

deploy depends on clean,jar,get-target-ip.

  1. Use scp to transfer the ${dist.jar} to the rio
  2. Use ssh to run a killall command on process netconsole-host
  3. Use scp to transfer robotCommand file to the rio (file sets up enviorment variables for java)
  4. Use ssh to run the ${deploy.kill.command}
  5. Use ssh to run the sync command

The sync command is a UNIX command that forces the OS to write all data to disk that is scheduled to be written. After sync returns it is garanteed that everything at that point has been written to storage.

Clone this wiki locally