I’m developing extensions for a commercial app.
These extensions run within the main app when I place a jar file in the apps special ‘extensions’ folder.
So, this is like library development as there is no ‘main’ class, and no exectuable application.
If my extensions require dependent libraries, the app also has a special ‘ext’ folder to place them in. So far, I’ve had no problems placing my extensions and having them use the dependent libraries.
But, I’m wanting to share my extensions with others without having them need to mess with external libs, so want to create fat jars with embedded libs.
Unfortunately, the usual suspects in gradle to create fat jars, all fail to load properly into the app. So far I’ve tried the Shadow plugin, and the standard ‘fatJar’ gradle task everyone uses, which includes the code:
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
While they both successfully create fat jars, I get many errors on loading, including ‘no class definition found’ errors.
The one thing I found that did the job was using Idea’s ‘Artifacts’ tool, accessed via the ‘Project Structure’ dialog. Found instructions here, under Variant #2
Building my artifact manually this way loads without error into my app.
So, the question from my post subject: does anyone have a gradle task, that in part, or fully duplicates how Idea is doing this?