Ok, ran into one more issue when trying build tool plugins - any hints on how to work around this issue cleanly is much appreciated.
Basically I have a simple prebuild tool that should generate source code using sourcery
. As part of that, a .stencil template is defined in the package defining the plugin.
Now, when executing the plugin, I want to consume that resource - but all the directory accessor in the build tool plugin context references the current build target - there doesn't seem to be any way to get at resources/files from the checked out version that was used to build my build tool?!
I can see it is checked out in .build:
hassila@max ~/G/package-plugin-manager (feature/sc-376/autogenerate-all-boilerplate-code-for-apps) [1]> find . -name "*.stencil" -ls
50926654 8 -r--r--r-- 1 hassila staff 471 Jun 29 22:50 ./.build/checkouts/package-plugin/Sources/PluginResources/PluginFactory.stencil
50902553 8 -rw-r--r-- 1 hassila staff 196 Jun 29 17:38 ./Templates/PluginManagerLoader.stencil
hassila@max ~/G/package-plugin-manager (feature/sc-376/autogenerate-all-boilerplate-code-for-apps)>
So there seems to be no way to defined resources for a plugin that will be copied with it - perhaps that's simply a missing feature?
Or is there some way to access resources from the package that defines the build tool?
For tools that are small in nature and just operates on the same package where they are defined, this is not a problem of course, but that is less useful.
I don't want to add the stencil to the end-consumer package, the best approach I've come up with so far is to embed the stencil in the plugin source code as a string literal and to write it out to disk in the temporary work directory for the plugin so I can consume it, but that is not very nice indeed.
Am I missing something, or are there simply a gap here?