Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can some buddy help me run this as gradle build is failing for me with different error every time? I want to contribute to this game and extend this further. #1

Open
neelgo opened this issue Jan 15, 2022 · 2 comments

Comments

@neelgo
Copy link

neelgo commented Jan 15, 2022

Can some buddy help me run this as gradle build is failing for me with different error every time? I want to contribute to this game and extend this further, otherwise this game is dead.

@cpv
Copy link

cpv commented Jan 17, 2022

Just a heads up this project has been untouched for 6 or so years. I think its safe to say its dead.

@Remosy
Copy link

Remosy commented Jan 17, 2022

I can't believe that I just downloaded and tried a project from 6 years ago 😂 miss my university life
I commented unfound packages and changed compile to implementation it can build successfully.

But when I run ./gradlew run, terminal gives me error msg like:

JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-17.0.1\bin
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

My "build" Results:
BUILD SUCCESSFUL in 4s
1 actionable task: 1 executed

You can copy and paste to try:

build.gradle(farmism)
location: D:\XXX\farmsim

allprojects {
  group = 'deco2800-2015-farm'
  version = '0.3142'
}

repositories {
  mavenLocal()
  mavenCentral()
}

subprojects {
  apply plugin: 'java';
  apply plugin: 'eclipse';
  apply plugin: 'idea';
  apply plugin: 'jacoco';
  apply plugin: 'application';

  mainClassName = "farmsim.FarmSimLauncher"

  repositories {
    mavenLocal()
    mavenCentral()
  }

  tasks.withType(Javadoc) {
    options.addStringOption('Xdoclint:none', '-quiet')
  }
  javadoc {
    options.tags = ['require', 'ensure']
  }

  sourceSets {
      uiTest {
          java {
              compileClasspath += main.output
              runtimeClasspath += main.output
              srcDir 'src/uiTest/java'
          }
      }
  }

  configurations {
      uiTestCompile.extendsFrom testCompile
  }

  task uiTest(type: Test) {
//      testClassesDir = sourceSets.uiTest.output.classesDir
      classpath = sourceSets.uiTest.runtimeClasspath

      jacoco {
          destinationFile = file("$buildDir/jacoco/uiTest.exec")
      }
  }

  test.dependsOn uiTest

  //options to force software rendering headlessly
  test {
      jvmArgs = [
              // Headless Monocle implementation
              "-Dglass.platform=Monocle",
              "-Dmonocle.platform=Headless",
              "-Dprism.order=sw",
              "-Dprism.verbose=true",
              "-Dprism.debugFonts=true",
              // TestFX specific options
              "-Dtestfx.robot=glass",
              "-Dtestfx.headless=true"
      ]
      jacoco {
          destinationFile = file("$buildDir/jacoco/test.exec")
      }

  }

  uiTest {
      jvmArgs = [
              // Headless Monocle implementation
              "-Dglass.platform=Monocle",
              "-Dmonocle.platform=Headless",
              "-Dprism.order=sw",
              "-Dprism.verbose=true",
              "-Dprism.debugFonts=true",
              // TestFX specific options
              "-Dtestfx.robot=glass",
              "-Dtestfx.headless=true"
      ]
  }

}

build.gradle(:farmsim)
location: D:\XXX\farmsim\farmsim

dependencies {
//    compile (
//        [group: 'org.slf4j', name:'slf4j-api', version: '1.7.12'],
//        [group: 'org.slf4j', name:'slf4j-log4j12', version: '1.7.12'],
//        [group: 'org.apache.derby', name: 'derby', version: '10.11.1.1'],
//        [group: 'org.testfx', name: 'openjfx-monocle', version: '1.8.0_20'],
//        [group: 'de.jensd', name: 'fontawesomefx', version: '8.6']
//    )
//    compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.12'
    implementation group: 'org.slf4j', name:'slf4j-log4j12', version: '1.7.12'
    implementation group: 'org.apache.derby', name: 'derby', version: '10.11.1.1'
    implementation group: 'org.testfx', name: 'openjfx-monocle', version: '1.8.0_20'
    implementation group: 'de.jensd', name: 'fontawesomefx', version: '8.6'
    implementation group: 'org.glassfish.jersey.core', name:'jersey-client', version: '2.19'
    implementation group: 'org.glassfish.jersey.media', name:'jersey-media-json-jackson', version: '2.19'

    implementation fileTree(dir: 'src/main/libs', include: "**/*.jar")

    testCompile (
        [group: 'org.mockito', name: 'mockito-all', version: '1.10.19'],
        [group: 'org.dbunit', name: 'dbunit', version: '2.5.1'],
        [group: 'junit', name: 'junit', version: '4.11'],
        [group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.2'],
        [group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.2'],
        [group: 'org.testfx', name: 'openjfx-monocle', version: '1.8.0_20'],
        [group: 'org.testfx', name: 'testfx-core', version: '4.0.+'],
        [group: 'org.testfx', name: 'testfx-junit', version: '4.0.+']
    )
    testCompile fileTree(dir: 'src/main/libs', include: "**/*.jar")

    //Requires exclusion, let's not add this to the block build
    testCompile "org.testfx:testfx-legacy:4.0.+", {
        exclude group: "junit", module: "junit"
    }

    uiTestCompile sourceSets.test.output
    uiTestCompile sourceSets.main.output
    uiTestCompile configurations.testCompile
//    uiTestRuntime configurations.testRuntime//    uiTestRuntime configurations.testRuntime
}

apply plugin: 'org.flywaydb.flyway'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.flywaydb', name: 'flyway-gradle-plugin', version: '3.2.1'
    }
}

task(run2, dependsOn: "classes", type: JavaExec) {
   main = "farmsim.FarmSimLauncher"
   classpath = sourceSets.main.runtimeClasspath
}

flyway {
    url = 'jdbc:derby:' + project.projectDir + '/decoFarmDB;user=decofarm;password=decofarm;create=true'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants