Comments (4)
By taking a quick look at the CTRE libraries, they are available in two forms, as an exe installer, and as a zip archive. It is currently possible to use both of these to install 3rd party libs to GradleRIO. Until I push an update out which will make this more streamlined, you can use the following methods to link the 3rd party libs.
On the CTRE Tools Website, choose either the CTRE Toolsuite Installer
, or the CTRE Toolsuite (no installer) package
. Either will do, but for now I would recommend the installer one.
Add the following line to your build.gradle
's dependencies { }
block.
compile fileTree(dir: "<tooldir>", include: '**/*.jar')
Depending on which binary you downloaded, you will substitute <tooldir>
with a different string.
If you downloaded the installer, replace <tooldir>
with ${new File(System.getProperty("user.home"), "wpilib/user/java/lib").absolutePath}
If you downloaded the non-installer package, replace <tooldir>
with <extraction_path>/java/lib
, where <extraction_path>
is where you extracted the zip archive to.
This will compile against the CTRE Jar for your robot program. If you're using stock-standard GradleRIO, this will build into your final .jar. If you're using Toast, it will require a little bit of extra setup to include it in your binary (since toast doesn't build fat jars). I will discuss this in a followup comment.
The problem now is that CTRE actually doesn't link their .so
file (their native code for the roborio) into the .jar, so you'll have to install that, too. Add the following lines to the bottom of your build.gradle
, it's best if you don't ask how this part works. Substitute <tooldir>
with whatever you substituted it with before.
fileTree(dir: "<tooldir>", include: '**/*.so').each { File f ->
gradlerio.deployers += [ to: "/usr/local/frc/lib/${f.name}.jar", from: f.file ]
}
from gradlerio.
If you ARE using TOAST, you will need to follow all the steps above with some extra setup:
In your dependencies {}
block, add the following line, substituting <tooldir>
for whatever you substituted it with above.
toastLibrary fileTree(dir: "<tooldir>", include: '**/*.jar')
from gradlerio.
As a guide, your build.gradle
should look a little something like this
from gradlerio.
Closed for #17
from gradlerio.
Related Issues (20)
- DefaultHeaderDependenciesCollector issue with wpilib/opencv headers HOT 2
- Investigate alternate GC settings HOT 1
- Support wpiunits project
- GradleRIO doesn't install vendordeps for C++ projects on Linux HOT 3
- Error out early if building on OneDrive HOT 5
- _localtest, current usage and should it be removed
- Inconsistent simulation builds HOT 4
- robotpy parity: write deploy.json to rio on deploy?
- Compiler args caching on Windows HOT 6
- ./gradlew generateCompileCommands outputs no compile_command.json HOT 4
- Build doesn't grab C++ sources by itself
- Glass and SysId not installed via installAllTools HOT 4
- Remove RobotPy when deploying Java on a RoboRIO I HOT 1
- Feature request: Add build.gradle and vendordeps to generated jar HOT 1
- Add Beta JDK 21 for roborio.
- Onedrive error message should have an action item HOT 1
- description of steps to use alternate GC is incorrect.
- Vendordeps glob should skip hidden files
- Error `> Failed to apply plugin class 'edu.wpi.first.gradlerio.wpi.WPIPlugin'.` HOT 7
- Check hostname when connected over USB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradlerio.