FRC5190 / FalconLibrary

Feature-rich Kotlin JVM based robotics library, primarily for use in the FIRST Robotics Competition.
Mozilla Public License 2.0
26 stars 12 forks source link

Gradle Dependency Broken for 2019 Kickoff Release #9

Closed ShaylanDias closed 5 years ago

ShaylanDias commented 5 years ago

Received this error code when running ./gradlew build It seems like the CTRE dependency is not currently working.

Redrield commented 5 years ago

You need to have the Phoenix vendor JSON in your robot project for it to resolve correctly. It tells gradleRIO where to find the libraries

ShaylanDias commented 5 years ago

I have added in the vendordeps folder with the JSON in my robot project folder. Do I need to put it in a certain place or put something in build.gradle? The same error is still occurring. I'm sorry if this should be obvious, I don't know how gradle works very well.

Redrield commented 5 years ago

Could I see the build.gradle you're trying to use? I'll try to figure out what's up from that

ShaylanDias commented 5 years ago

Here's a copy-paste of my build.gradle

plugins { id "java" id "edu.wpi.first.GradleRIO" version "2019.1.1" }

allprojects{ repositories { jcenter() maven { url "https://jitpack.io" } } }

def ROBOT_MAIN_CLASS = "frc.robot.Main"

// Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project EmbeddedTools. deploy { targets { roboRIO("roborio") { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. team = frc.getTeamNumber() } } artifacts { frcJavaArtifact('frcJava') { targets << "roborio" // Debug can be overridden by command line, for use with VSCode debug = frc.getDebugOrDefault(false) } // Built in artifact to deploy arbitrary files to the roboRIO. fileTreeArtifact('frcStaticFileDeploy') { // The directory below is the local directory to deploy files = fileTree(dir: 'src/main/deploy') // Deploy to RoboRIO target, into /home/lvuser/deploy targets << "roborio" directory = '/home/lvuser/deploy' } } }

// Set this to true to enable desktop support. def includeDesktopSupport = false

// Maven central needed for JUnit repositories { mavenCentral() }

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 4. dependencies { compile wpi.deps.wpilib() compile wpi.deps.vendor.java() nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) compile 'org.ghrobotics:FalconLibrary:2019.1.5' testCompile 'junit:junit:4.12' }

// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar') // in order to make them all available at runtime. Also adding the manifest so WPILib // knows where to look for our Robot Class. jar { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) }

ThePrimedTNT commented 5 years ago

I have used the build.gradle locally and I got it to reproduce the error when the Pheonix.json in the vendordeps folder was missing.

Project structure should be as follows:

project/

Try adding the Pheonix.json and see that resolves the issue.

ShaylanDias commented 5 years ago

Ignore this whole issue, I fixed it. It was on my end with installing WPI-related stuff.