snobotsim / SnobotSim

Simulator For FRC Java and C++ Robots
MIT License
57 stars 11 forks source link

GradleRIO install failing #1

Closed joshuaferrara closed 6 years ago

joshuaferrara commented 6 years ago

Hello,

I'm running into some issues with the GradleRIO install of SnobotSim.

I've followed the install instructions on the wiki, mainly, adding the line to the plugins block, as well as the testCompile lines to my build.gradle file.

When running ./gradlew build initially, I get the output below:

./gradlew build                                                                                                           
Download https://plugins.gradle.org/m2/com/snobot/simulator/plugin/SnobotSimulatorPlugin/com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin/2018.01.01/com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin-2018.01.01.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/snobot/simulator/plugin/SnobotSimulatorPlugin/2018.01.01/SnobotSimulatorPlugin-2018.01.01.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/snobot/simulator/plugin/SnobotSimulatorPlugin/2018.01.01/SnobotSimulatorPlugin-2018.01.01.jar
Download https://plugins.gradle.org/m2/net/java/jinput/jinput/2.0.7/jinput-2.0.7.pom
Download https://plugins.gradle.org/m2/net/java/jutils/jutils/1.0.0/jutils-1.0.0.pom
Download https://plugins.gradle.org/m2/net/java/jinput/jinput-platform/2.0.7/jinput-platform-2.0.7.pom
Download https://plugins.gradle.org/m2/net/java/jinput/jinput-platform/2.0.7/jinput-platform-2.0.7-natives-linux.jar
Download https://plugins.gradle.org/m2/net/java/jinput/jinput-platform/2.0.7/jinput-platform-2.0.7-natives-osx.jar
Download https://plugins.gradle.org/m2/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar
Download https://plugins.gradle.org/m2/net/java/jinput/jinput-platform/2.0.7/jinput-platform-2.0.7-natives-windows.jar
Download https://plugins.gradle.org/m2/net/java/jinput/jinput/2.0.7/jinput-2.0.7.jar

> Configure project : 
Eclipse not configured, will not update classpath

Following that, I ran ./gradlew eclipse to generate the eclipse project. Output is below:

./gradlew eclipse                                                                                                       

> Configure project : 
Eclipse not configured, will not update classpath

Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-jni/maven-metadata.xml
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/ntcore/ntcore-jni/maven-metadata.xml
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/ntcore/ntcore-jni/4.0.0/ntcore-jni-4.0.0.pom
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/cscore/cscore-jni/maven-metadata.xml
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/cscore/cscore-jni/1.1.0/cscore-jni-1.1.0.pom
Download https://plugins.gradle.org/m2/jfree/jfreechart/1.0.13/jfreechart-1.0.13.pom
Download https://plugins.gradle.org/m2/log4j/log4j/1.2.16/log4j-1.2.16.pom
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-swing/4.2/miglayout-swing-4.2.pom
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-core/4.2/miglayout-core-4.2.pom
Download https://plugins.gradle.org/m2/jfree/jcommon/1.0.16/jcommon-1.0.16.pom
Download https://plugins.gradle.org/m2/org/yaml/snakeyaml/1.18/snakeyaml-1.18.pom
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-parent/4.2/miglayout-parent-4.2.pom
Download https://plugins.gradle.org/m2/jfree/jfreechart/1.0.13/jfreechart-1.0.13.jar
Download https://plugins.gradle.org/m2/jfree/jcommon/1.0.16/jcommon-1.0.16.jar
Download https://plugins.gradle.org/m2/log4j/log4j/1.2.16/log4j-1.2.16.jar
Download https://plugins.gradle.org/m2/org/yaml/snakeyaml/1.18/snakeyaml-1.18.jar
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-swing/4.2/miglayout-swing-4.2.jar
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-core/4.2/miglayout-core-4.2.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-jni/3.2.0/opencv-jni-3.2.0-all.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/ntcore/ntcore-jni/4.0.0/ntcore-jni-4.0.0-all.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/cscore/cscore-jni/1.1.0/cscore-jni-1.1.0-all.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilibj/wpilibj-java/2018.1.1/wpilibj-java-2018.1.1-sources.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/ntcore/ntcore-java/4.0.0/ntcore-java-4.0.0-sources.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpiutil/wpiutil-java/3.0.0/wpiutil-java-3.0.0-sources.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-java/3.2.0/opencv-java-3.2.0-sources.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/cscore/cscore-java/1.1.0/cscore-java-1.1.0-sources.jar
Download https://raw.githubusercontent.com/Open-RIO/Maven-Mirror/master/m2/openrio/mirror/third/ctre/CTRE-phoenix-java/5.1.2.1/CTRE-phoenix-java-5.1.2.1-sources.jar
Download https://raw.githubusercontent.com/Open-RIO/Maven-Mirror/master/m2/openrio/mirror/third/kauailabs/navx-java/3.0.342/navx-java-3.0.342-sources.jar
Download http://dev.imjac.in/maven/openrio/powerup/MatchData/2018.01.07/MatchData-2018.01.07-sources.jar
Download https://plugins.gradle.org/m2/jfree/jcommon/1.0.16/jcommon-1.0.16-sources.jar
Download https://plugins.gradle.org/m2/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar
Download https://plugins.gradle.org/m2/org/yaml/snakeyaml/1.18/snakeyaml-1.18-sources.jar
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-swing/4.2/miglayout-swing-4.2-sources.jar
Download https://plugins.gradle.org/m2/com/miglayout/miglayout-core/4.2/miglayout-core-4.2-sources.jar
Download https://plugins.gradle.org/m2/net/java/jinput/jinput/2.0.7/jinput-2.0.7-sources.jar
Download https://plugins.gradle.org/m2/net/java/jutils/jutils/1.0.0/jutils-1.0.0-sources.jar

> Task :eclipseClasspath 
Could not resolve: com.snobot.simulator:snobot_sim_gui:0.6.0
Could not resolve: com.snobot.simulator:ctre_override:0.6.0
Could not resolve: com.snobot.simulator:snobot_sim_java:0.6.0

Now, the eclipse project opens fine, though I can't get the simulator started while following the Run As instructions for Eclipse; the package for SnobotSim does not show up in the search box for Java Applications in Eclipse.

I've duplicated this on both Windows 10 and Ubuntu 16.04.3. I'd love to get the programmers on my team using this sim before our drive base is built - it looks really well put together.

Thanks for your help! I've included my build.gradle file below.

plugins {
    id "java"
    id "eclipse"
    id "idea"
    id "jaci.openrio.gradle.GradleRIO" version "2018.01.07"
    id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2018.01.01"
}

def TEAM = 5805
def ROBOT_CLASS = "frc.team5805.robot.Robot"

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project EmbeddedTools.
deploy {
    targets {
        target("roborio", jaci.openrio.gradle.frc.RoboRIO) {
            team = TEAM
        }
    }
    artifacts {
        artifact('frcJava', jaci.openrio.gradle.frc.FRCJavaArtifact) {
            targets << "roborio"
        }
    }
}

// Defining my dependencies. In this case, WPILib (+ friends), CTRE Toolsuite (Talon SRX)
// and NavX.
dependencies {
    compile wpilib()
    compile ctre()
    compile navx()
    compile openrio.powerup.matchData()

    testCompile snobotSimCompile()
    testCompile snobotSimJavaCompile()
}

// 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 jaci.openrio.gradle.GradleRIOPlugin.javaManifest(ROBOT_CLASS)
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
}

build.dependsOn snobotSimUnzipNativeTools
pjreiniger commented 6 years ago

Thanks for the interest, I think you are the first person I don't know trying to use this, so you may be in a little bit of a guinea pig situation for a couple days.

It looks like when I was writing the docs I was using a local maven repo, and those intermediate versions didn't get published. I'll update the plugin to point to the release I made last night which includes game data, and update the documentation.

In the meantime, you can add a line like this to your build script

snobotSimVersions {
    snobotSimVersion = "0.7.0"
}

You can use ours as an example https://github.com/ArcticWarriors/snobot-2018/blob/master/RobotCode/snobot2018/build.gradle

joshuaferrara commented 6 years ago

Awesome, thank you so much! After looking at your build.gradle I created a new GradleRIO workspace and used the build.gradle below. After running gradlew build and gradlew eclipse, I was in working order. Thanks again and good luck this season!

buildscript {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
}

plugins {
    id "java"
    id "eclipse"
    id "idea"
    id "jaci.openrio.gradle.GradleRIO" version "2018.01.07"
    id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2018.01.01"
}

apply plugin: com.snobot.simulator.plugin.SnobotSimulatorPlugin
snobotSimVersions {
    snobotSimVersion = "0.7.0"
}

def TEAM = 5805
def ROBOT_CLASS = "com.smblyrequired.SMbly2018.Robot"

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project EmbeddedTools.
deploy {
    targets {
        target("roborio", jaci.openrio.gradle.frc.RoboRIO) {
            team = TEAM
        }
    }
    artifacts {
        artifact('frcJava', jaci.openrio.gradle.frc.FRCJavaArtifact) {
            targets << "roborio"
        }
    }
}

// Defining my dependencies. In this case, WPILib (+ friends), CTRE Toolsuite (Talon SRX)
// and NavX.
dependencies {
    compile wpilib()
    compile ctre()
    compile navx()
    compile openrio.powerup.matchData()

    testCompile snobotSimCompile()
    testCompile snobotSimJavaCompile()
}

// 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 jaci.openrio.gradle.GradleRIOPlugin.javaManifest(ROBOT_CLASS)
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
}

repositories {
    mavenLocal()
    mavenCentral()
}