Skip to content

Commit 4c6e793

Browse files
authored
Add an article describing deploy directory (#3030)
Fixes #2971 Moves the deleting items from deploy directory to this article
1 parent 22617aa commit 4c6e793

File tree

4 files changed

+40
-14
lines changed

4 files changed

+40
-14
lines changed

source/docs/software/advanced-gradlerio/compiler-args.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,3 @@ frcJava(getArtifactClass('FRCJavaArtifact')) {
4040
jvmArgs.add("-XX:+DisableExplicitGC")
4141
}
4242
```
43-
44-
## Deleting Unused Deploy Files
45-
46-
By default the `src/main/deploy` directory in your project is transferred to the roboRIO when code is deployed. It is initiated by this section of the `build.gradle` file.
47-
48-
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/refs/tags/v2025.1.1-beta-3/vscode-wpilib/resources/gradle/java/build.gradle
49-
:language: groovy
50-
:lines: 32-38
51-
:lineno-match:
52-
53-
This will overwrite any duplicate files found in the `/home/lvuser/deploy` directory on the RIO and copy over any additional not present there. If `deleteOldFiles` is false it will not remove any files no longer present in the project deploy directory. Changing it to `true` helps prevent programs like :doc:`Choreo </docs/software/pathplanning/choreo/index>` and [PathPlanner](https://github.com/mjansen4857/pathplanner) from getting confused by files that were deleted locally but still exist on the roboRIO.
54-
55-
If you want to manage the roboRIO files directly, the :doc:`FTP documentation </docs/software/roborio-info/roborio-ftp>` provides one method to do so.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Robot Project Deploy Directory
2+
3+
The deploy directory is a part of an FRC project, used to store files that are transferred to the roboRIO during the deployment process. This directory allows teams to include additional resources, such as configuration files, scripts, or other assets, that their robot code may need at runtime.
4+
5+
## Location of the Deploy Directory
6+
7+
In a standard GradleRIO project, the deploy directory is located under the ``src/main`` folder. Any files placed in this directory will automatically be copied to the roboRIO when the code is deployed.
8+
9+
## How the Deploy Directory Works
10+
11+
When you run the ``deploy`` task, GradleRIO packages the contents of the deploy directory and transfers them to the roboRIO. By default, these files are placed in the ``/home/lvuser/deploy`` directory on the roboRIO. This ensures that your robot code can access these files during runtime.
12+
13+
### Example Use Cases
14+
15+
Here are some common examples of how teams use the ``deploy`` directory:
16+
17+
1. **Configuration Files**
18+
Teams may include configuration files (e.g., JSON, YAML, or XML) that define robot-specific settings, such as PID constants, swerve configuration, or autonomous routines. The :doc:`Preferences class <robot-preferences>` provides another method to store configuration on the roboRIO.
19+
20+
2. **Path Planning Files**
21+
For teams using path planning libraries, trajectory files such as those from :doc:`Choreo </docs/software/pathplanning/choreo/index>` and [PathPlanner](https://github.com/mjansen4857/pathplanner) can be stored in the deploy directory and loaded by the robot code.
22+
23+
### Accessing Deploy Files in Code
24+
25+
To access files from the deploy directory in your robot code, use the ``Filesystem`` class ([Java](https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/Filesystem.html), [C++](https://github.wpilib.org/allwpilib/docs/release/cpp/_filesystem_8h.html)). The ``getDeployDirectory`` method returns the path to the deploy directory. This ensures that your code can locate the files regardless of whether the code is running on the roboRIO or in simulation on your computer.
26+
27+
## Deleting Unused Deploy Files
28+
29+
By default the deploy directory in your project is transferred to the roboRIO when code is deployed. It is initiated by this section of the ``build.gradle`` file.
30+
31+
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/refs/tags/v2025.3.2/vscode-wpilib/resources/gradle/java/build.gradle
32+
:language: groovy
33+
:lines: 32-38
34+
:lineno-match:
35+
36+
This will overwrite any duplicate files found in the ``/home/lvuser/deploy`` directory on the RIO and copy over any additional not present there. If ``deleteOldFiles`` is false it will not remove any files no longer present in the project deploy directory. Changing it to `true` helps prevent programs like :doc:`Choreo </docs/software/pathplanning/choreo/index>` and [PathPlanner](https://github.com/mjansen4857/pathplanner) from getting confused by files that were deleted locally but still exist on the roboRIO.
37+
38+
If you want to manage the roboRIO files directly, the :doc:`FTP documentation </docs/software/roborio-info/roborio-ftp>` provides one method to do so.

source/docs/software/basic-programming/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
joystick
1010
coordinate-system
1111
robot-preferences
12+
deploy-directory
1213
using-test-mode
1314
reading-stacktraces
1415
functions-as-data

source/docs/yearly-overview/yearly-changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Supported Operating Systems and Architectures:
222222

223223
- Use Gradle 8.11
224224
- Use shell scripts for launching tools on Linux / macOS, since macOS doesn't ship Python any more
225-
- Add method to delete files on roboRIO that have been deleted in the deploy directory. :ref:`Set deleteOldFiles to true <docs/software/advanced-gradlerio/compiler-args:Deleting Unused Deploy Files>` in the frcStaticFileDeploy block
225+
- Add method to delete files on roboRIO that have been deleted in the deploy directory. :ref:`Set deleteOldFiles to true <docs/software/basic-programming/deploy-directory:Deleting Unused Deploy Files>` in the frcStaticFileDeploy block
226226
- Gradle now consolidates Java compile errors at the bottom of the terminal to aid discoverability https://docs.gradle.org/8.11/release-notes.html#error-warning
227227
- 2025.3.1: Warn if multiple versions of the same vendordep is found
228228
- 2025.3.2: Disable code reboot while killing robot process, which was causing high CPU usage every other code reboot for some teams

0 commit comments

Comments
 (0)