In build task, pack all runtime resources under a folder

Issue #394 resolved
Desrever Nu created an issue

The bot needs resources in runtime : all the files that are in the resources/ folder.

The gradle task puts the files in the root of the project, at the same level of NuBot.jar.

I advocate that all files must be stored in a directory named resources/ instead that the root.

(including the folder containing the 'frozen' amounts)

Comments (4)

  1. Benjamin Cordes

    resources has a special meaning in gradle and java. it refers to loading files via classpath see [1]. but we're using relative paths. hence we copy resources into the distribution folder. it works the one way or the other. What was res/folder is now workingdir/folder. whatever the path name is, resources folder should be distinguished. I'm not sure about a weakness of current relative path approach. the workingdir is always uniquely identified.

    The difference between copying and resources folder is that files get packaged within the jar. Gradle recognizes the folder src/main/resources automatically, since this follows the standard layout [2]. Independent of that there could a folder "res" (or assets or whatever) in the distribution folder which can be referenced.

    further info

    [1] https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html

    default layout:

    [2] http://www.gradle.org/docs/current/userguide/java_plugin.html

  2. Log in to comment