Code Monkey home page Code Monkey logo

Comments (4)

JaciBrunning avatar JaciBrunning commented on August 15, 2024 2

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.

JaciBrunning avatar JaciBrunning commented on August 15, 2024

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.

JaciBrunning avatar JaciBrunning commented on August 15, 2024

As a guide, your build.gradle should look a little something like this

from gradlerio.

JaciBrunning avatar JaciBrunning commented on August 15, 2024

Closed for #17

from gradlerio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.