Tareas de Gradlew
Este artículo tiene como objetivo resaltar los comandos de gradle compatibles con el equipo de WPILib para el uso de los usuarios. Estos comandos se pueden ver escribiendo ./gradlew tasks
en la raíz de su proyecto de robot. No todos los comandos que se muestran en ```./gradlew tasks``y los comandos no compatibles no se documentarán aquí.
Build tasks
./gradlew build
- Assembles and tests this project. Useful for prebuilding your project without deploying to the roboRIO.
./gradlew clean
- Deletes the build directory.
CompileCommands tasks
./gradlew generateCompileCommands
- Generate compile_commands.json for C++ programs. This is a configuration file that is used by clangd, which is supported by many Integrated Development Environments and build tools. This file will be saved in build/TargetedCompileCommands/targetplatformandbuildtype
but needs to be moved to the root of your project. Many IDE’s will have a way to specify where this file is found, which you can use instead if you desire. Make sure you have gitignored this file.
Advertencia
Using compile commands isn’t recommended for most users and has a variety of pitfalls compared to the built-in intellisense.
DeployUtils tasks
./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.
GradleRIO tasks
./gradlew :math:`TOOL`
- Runs the tool $TOOL:math:`
(Replace `TOOL$
with the name of the tool. IE, Glass, Shuffleboard, etc)
./gradlew :math:`TOOL`Install
- Installs the java tool $TOOL:math:`
(Replace `TOOL$
with the name of the tool. IE, Shuffleboard, SmartDashboard, 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 simulateExternalNativeRelease
- Simulate External Task for native executable. Exports a JSON file for use by editors / tools
./gradlew simulateExternalJavaRelease
- 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 Bibliotecas de 3ros