EmergentOrganization / cell-rpg

:black_square_button: connect to a universe where cellular automata have run rampant
http://emergentorganization.github.io/bridge/
Other
12 stars 1 forks source link

Cannot produce jar from Gradle due to media dependencies #84

Closed BrianErikson closed 8 years ago

BrianErikson commented 8 years ago

Due to the way JARs are structured, Gradle puts all of the ../android/assets folder contents into the root classpath of the JAR. This causes two issues:

7yl4r commented 8 years ago

This sounds kind of like the issue we had in TheOregonTraj, where we had to wrap file-references in a function getFileDir(). Do we need to set up a class for that in this project?

BrianErikson commented 8 years ago

So, the end result is that I had to copy the entire assets dir to the parent directory of the JAR, and then reference it through LIBGDX normally. Since gradle exports everything inside of the assets directory to the classpath of the JAR, I had to put everything inside of a subdirectory called resources.

When launching the JAR, the assets directory will be extracted to the working directory. This means that if your working directory parameter in IntelliJ is blank, it will attempt to copy the files to the root of the project I think. Below is an example of a working JAR configuration. screenshot from 2015-10-21 20 51 25

7yl4r commented 8 years ago

Nice work figuring this out. I'm so glad at least one of us can make some sense of gradle.

On Wed, Oct 21, 2015, 3:21 PM Brian Erikson notifications@github.com wrote:

Closed #84 https://github.com/EmergentOrganization/cell-rpg/issues/84.

— Reply to this email directly or view it on GitHub https://github.com/EmergentOrganization/cell-rpg/issues/84#event-441893429 .