Skip to content

jarify with fxml: no .jrubyfx_cache in the jarfile #115

@brucetesar

Description

@brucetesar

I set out to jarify the Demo.rb for jrubyfx, and I ended up dealing with 3 different issues. I'm posting the first here, and will put the other two in separate issue posts. I've found workarounds for each, but I don't know how general/good they are. However, they make it possible for me to sucessfully jarify Demo and run it from the jar. I'm on the Win10 x64 platform.

Issue
.jrubyfx_cache is referenced, but neither the folder nor its contents are included in the created jarfile, producing the exception <Errno::ENOTDIR: Not a directory - classpath:/.jrubyfx_cache>

The reason .jrubyfx_cache isn't included in the created jarfile is that it isn't copied into the temp directory of contents for the jar. It isn't copied into the contents directory because globs by default ignore file/folder names starting with a period '.'
Example: if src = "fxml/*", then FileList[src] will not include "fxml/.jrubyfx_cache" even though it exists.

Workaround
In the jrubyfx gem, modify the file lib/jrubyfx_tasks.rb:
After line 72, add the following 2 lines:
# copy the folder .jrubyfx_cache and contents to the target folder
cp_r src.sub(/\*$/, ".jrubyfx_cache"), target

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions