To get started with Command-base, start with What Is “Command-Based” Programming?
Our repository attempts to follow the best practices listed in the document Structuring a Command-Based Robot Project.
For organization guidelines read: Organizing Command-Based Robot Projects.
This commandline commands can make it easier to work with our system. For instance, you can apply spotless and build at the same time by doing:
./gradlew spotlessApply build
This article aims to highlight the gradle commands supported by the WPILib team for user use. These commands can be viewed by typing ./gradlew tasks at the root of your robot project. Not all commands shown in ./gradlew tasks and unsupported commands will not be documented here.
Spotless can be ran using ./gradlew spotlessApply which will apply all formatting options. You can also specify a specific task by just adding the name of formatter. An example is ./gradlew spotlessmiscApply
.
Spotless can also be used as a CI check. The check is ran with ./gradlew spotlessCheck
.
./gradlew build
- Assembles and tests this project. Useful for prebuilding your project without deploying to the roboRIO. ./gradlew clean - Deletes the build directory.
./gradlew generateCompileCommands
- Generate compile_commands.json. This is a configuration file that is supported by many Integrated Development Environments.
./gradlew deploy
- Deploy all artifacts on all targets. This will deploy your robot project to the available targets (IE, roboRIO).
./gradlew discoverRoborio
- Determine the address(es) of target roboRIO. This will print out the IP address of a connected roboRIO.
./gradlew downloadAll
- Download all dependencies that may be used by this project
./gradlew $TOOL$
- Runs the tool $TOOL$ (Replace $TOOL$ with the name of the tool. IE, Glass, Shuffleboard, etc)
./gradlew $TOOL$Install
- Installs the tool $TOOL$ (Replace $TOOL$ with the name of the tool. IE, Glass, Shuffleboard, etc)
./gradlew InstallAllTools
- Installs all available tools. This excludes the development environment such as Visual Studio Code. It’s the users requirement to ensure the required dependencies (Java) is installed. Only recommended for advanced users!
./gradlew simulateExternalCpp
- Simulate External Task for native executable. Exports a JSON file for use by editors / tools
./gradlew simulateExternalJava
- Simulate External Task for Java/Kotlin/JVM. Exports a JSON file for use by editors / tools
./gradlew simulateJava
- Launches simulation for the Java projects
./gradlew simulateNative
- Launches simulation for C++ projects
./gradlew vendordep
- Install vendordep JSON file from URL or local installation. See 3rd Party Libraries