Gradle does not build but Eclipse does


(Kenzie Togami) #1

I recently added a new file to my project that contains many inner classes. Eclipse compiled it without complaints, and I made a commit to my git repo. Then Travis-CI triggered, and got an error. I thought it was Travis, but it turned out to be Gradle. It was erroring on some of the inner classes. Not sure why it’s doing it and not Eclipse.

Here’s the log, also since it’s Travis you can find the project linked as well: https://travis-ci.org/TechShroom/UnplannedDescent/jobs/29466023


(Kenzie Togami) #2

I just ran

gradle check --debug

for some more information, and the classpath is being passed fine. I checked the folders and everything is fine concerning the structure.


(Peter Niederwieser) #3

Eclipse is less strict than Gradle, hence it’s not uncommon for a problem to only surface in Gradle. Perhaps the build is missing a dependency declaration, or Gradle and Eclipse are using different Java versions, or something else is configured differently. It’s more likely a problem with the build than a problem with Gradle.


(Peter Niederwieser) #4

The Eclipse build (as set up by Gradle) is less strict than the Gradle build, hence it’s not uncommon for a problem to only surface in Gradle. Perhaps the build is missing a dependency declaration, or Gradle and Eclipse are using different Java versions, or something else is configured differently. It’s more likely a problem with the build than a problem with Gradle.


(Kenzie Togami) #5

If I’m missing a dependency then that’s very weird considering that the current code trying to compile has none except Java. Gradle + Eclipse are both compiling against 1.6. The problem seems to be that the main java classes aren’t being used with the test classes, for some unknown reason. They’re reported in the --debug area for being added to the javac command.


(Kenzie Togami) #6

If I’m missing a dependency then that’s very weird considering that the current code trying to compile has none except Java. Gradle + Eclipse are both compiling against 1.6. The problem seems to be that the main java classes aren’t being used with the test classes, for some unknown reason. They’re reported in the --debug area for being added to the javac command.


(Peter Niederwieser) #7

That’s some seriously complicated usage of nested classes. Could be a difference between OpenJDK and Eclipse compiler, or (less likely) a source encoding problem.


(Kenzie Togami) #8

I’m going to try de-nesting some of them to see if it goes okay.


(Kenzie Togami) #9

De-nesting the Step classes fixed it. This breaks part of the system I had in mind, but I guess it will work this way.