jrubyfx icon indicating copy to clipboard operation
jrubyfx copied to clipboard

jarify with fxml: no .jrubyfx_cache in the jarfile

Open brucetesar opened this issue 8 years ago • 1 comments

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

brucetesar avatar Jul 15 '17 22:07 brucetesar

Just stumbled upon the same issue, a fix would be great.

bolandross avatar Apr 21 '18 20:04 bolandross