Requirements
JDK 17
Note that the JRE is insufficient; the full JDK is required.- Ubuntu: Run
sudo apt install openjdk-17-jdk - Windows: Install the JDK 17 .msi from Adoptium
- macOS: Install the JDK 17 .pkg from Adoptium
C++ Compiler
- Linux: Install GCC 11 or greater
- Windows: Install Visual Studio Community 2022 and select the C++ programming language during installation
- Note: Gradle can’t use the build tools for Visual Studio - you need the full IDE
- macOS: Install the Xcode command-line build tools via
xcode-select --install- Xcode 14 or later is required
ARM Compiler Toolchain
Run the following command after cloning the repository:Raspberry Pi Toolchain (Optional)
For Raspberry Pi development:macOS ARM Additional Requirement
On macOS ARM, run:Setup
Clone the Repository
Clone the WPILib repository and follow the instructions above for installing any required tooling.
Install wpiformat (Optional)
For code formatting, see the styleguide README for wpiformat setup instructions.
Building
All build steps are executed using the Gradle wrapper,gradlew. Each target that Gradle can build is referred to as a task.
Build Everything
The most common Gradle task isbuild. This will build all the outputs created by WPILib:
Build a Specific Subproject
To build a specific subproject, such as WPILibC, use:subproject_name:task_name:
./gradlew :wpilibc:build, the HAL will be rebuilt, then WPILibC.
Using Build Cache
Run with--build-cache on the command-line to use the shared build cache artifacts generated by the continuous integration server:
Faster Builds
./gradlew build builds everything, which includes debug and release builds for desktop and all installed cross compilers. For common development and testing tasks, use these shortcuts:
Test Desktop C++
Test Desktop Java
Test Both
Test Specific Projects
The following projects also supporttestDesktopCpp, testDesktopJava, and testDesktop tasks:
- apriltag
- cameraserver
- cscore
- hal
- ntcore
- wpilibNewCommands
- wpimath
- wpinet
- wpiunits
- wpiutil
- romiVendordep
- xrpVendordep
Build Examples
Compile examples without running them:Custom Toolchain Location
If you have installed the FRC Toolchain to a directory other than the default, or if the Toolchain location is not on your System PATH, you can pass thetoolChainPath property:
Available Tasks
To see all available tasks, run the meta-task:Running Examples in Simulation
Examples can be run in simulation with the following commands:Example with the example’s folder name.