So, I have a potentially tricky problem (with a probably easy solution!)
Alright, what the problem is, is i’m making a javafx application and attempting to build and compile it under gradle. Ok, seems easy enough, there’s even a wonderful plugin for it out there ( https://bintray.com/shemnon/javafx-gradle/gradle-javafx-plugin/0.3.0 ). The problem is, the way the javafx project is setup, the directory structure looks something like this >
Project -----
|
|–Package ‘Mark’
|
|
Package Mark.styles (which contains a lot of things like .png’s etc.etc.)
Now there’s more to the project, but those are the two pieces that i’m concerned with. If you can imagine, these two folders are nested, one with java classes on the top level, and then a sub-folder that is holding all of the resources. Ok, great, no big deal.
the ‘big deal’ comes from the fact that when I use gradle to package up my jar as such:
sourceSets {
main {
resources.srcDirs = ["src/main/resources"]
}
}
configurations {
bundle
compile.extendsFrom bundle
}
jar {
baseName = "IFRCalculator"
from configurations.bundle.collect { it.isDirectory() ? it : zipTree(it)}
manifest {
attributes("Main-Class": "Mark.mark");
}
}
If you can imagine, it makes a folder in my jar called “Mark” (fine, no big deal), and it makes a folder at the SAME LEVEL called “styles”. well ugh. I need styles to be inside the mark folder, I feel like I’m one line of code away from solving this extremely frustrating problem that has no clear googled answer. (Or I was too naive to see it fit into my context)
any help would be greatly appreciated!