Announcement

Collapse
No announcement yet.

Adding third-party dependencies to gradle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding third-party dependencies to gradle

    I am working on a vision processing system with a Jetson TX2. To do this, I am using RESTEasy to query the Jetson over HTTP in a separate thread. However, I can't seem to add the RESTEasy dependency correctly to the gradle build project.

    I added the library's locations to the dependencies list in build.gradle:

    dependencies {
    compile wpi.deps.wpilib()
    compile wpi.deps.vendor.java()
    compile 'javax.json:javax.json-api:1.0'
    compile 'javax.json.bind:javax.json.bind-api:1.0'
    compile 'javax.ws.rs:javax.ws.rs-api:2.0'
    compile 'org.glassfish.jersey.core:jersey-client:2.0-m04'
    compile 'org.jboss.resteasy:resteasy-client:3.0.14.Final'
    compile 'org.jboss.resteasy:resteasy-jackson-provider:2.3.4.Final'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.6'
    nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
    nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
    testCompile 'junit:junit:4.12'
    }

    I've tried building the robot code when I was still connected to the internet before deploying it in the hope that it would download the needed jar files, but I've had no luck.

    In addition, to verify that this was in fact a dependency problem with the RoboRio, I wrote a gradle script for a test build and ran it in a local Linux VM while I was connected to the TX2:

    task query_jetson(type:JavaExec) {
    dependsOn ':build'
    main="frc.robot.lib.trajectory.jetsoninterface.Que ryJetsonTest"
    classpath = sourceSets.main.runtimeClasspath
    }

    The code worked perfectly, indicating that there is some dependency issue specific to WPILib or problem with how gradle is pushing my code to the RoboRio.

    Any suggestions for what my next step should be?
    Last edited by waltmck; 03-05-2019, 12:52 PM.
Working...
X