snobotsim / SnobotSim

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

Having problems while download with Gradle #54

Closed katzuv closed 4 years ago

katzuv commented 5 years ago

Hey, while trying to run SnobotSim with Gradle in IntelliJ IDEA with .\gradlew runSnobotSim, I get this error:

Could not get unknown property 'snobotSimJ' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

This is our build.gradle file:

plugins {
    id 'java'
    id "edu.wpi.first.GradleRIO" version "2018.06.21"
    id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2018-1.0.0"
}

group 'Robot'
version '1.0'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile wpilib()
    compile ctre()
    compile navx()
    testCompile snobotSimCompile()
    testCompile snobotSimJ avaCompile()
}

def ROBOT_CLASS = "robot.Robot"

deploy {
    targets {
        target("roborio", edu.wpi.first.gradlerio.frc.RoboRIO) {
            // Team can be overridden by command line, for use with VSCode
            team = getTeamOrDefault(5987)
        }
    }
    artifacts {
        artifact('frcJava', edu.wpi.first.gradlerio.frc.FRCJavaArtifact) {
            targets << "roborio"
            // Debug can be overridden by command line, for use with VSCode
            debug = getDebugOrDefault(false)
        }
    }
}

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

compileJava {
    classpath = sourceSets.main.compileClasspath
    options.encoding = 'UTF-8'
}

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

jar {
    from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_CLASS)
}

If I change the version to the latest one, I get the following error:

Could not find edu.wpi.first.wpiutil:wpiutil-cpp:2019.1.1-beta-1.
Searched in the following locations:
  - http://raw.githubusercontent.com/pjreiniger/maven_repo/master/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1.pom
  - http://raw.githubusercontent.com/pjreiniger/maven_repo/master/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1-windowsx86-64.zip
  - file:/C:/Users/user/.m2/repository/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1.pom
  - file:/C:/Users/user/.m2/repository/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1-windowsx86-64.zip
  - https://repo.maven.apache.org/maven2/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1.pom
  - https://repo.maven.apache.org/maven2/edu/wpi/first/wpiutil/wpiutil-cpp/2019.1.1-beta-1/wpiutil-cpp-2019.1.1-beta-1-windowsx86-64.zip
Required by:
    project :  // I don't know why there is nothing here after the colon

What am I doing wrong? Thank you!

pjreiniger commented 5 years ago

typo in testCompile snobotSimJ avaCompile()

If you update to the latest plugin you need to update your gradlerio version as well.

You can also take a look at the examples

pjreiniger commented 5 years ago

Try the latest version. This is a good example to base your build file on

pjreiniger commented 4 years ago

See new documentation for 2020

https://snobotsimdocs.readthedocs.io/en/latest/index.html