On 12/12/2017 20:42, Gunnar Morling wrote:
Finally got to write about my explorations of the jlink plug-in API:
http://in.relation.to/2017/12/12/exploring-jlink-plugin-api-in-java-9/.
I found the API good to work with overall, implementing my use case
(adding an annotation index for given modules) was straight-forward.
Thanks for the forwarding the link to the blog. It's not clear to me why
the jlink wrapper is needed, I would expect `jlink
-J-javaagent:agent.jar` should work.
For the use-case then another approach would be create/replace the index
when creating or updating a modular JAR with the `jar` tool. That would
help for the case that the module is on the module path (in addition to
helping the case where the module is linked into the run-time image).
One useful change could be to splitĀ up
ResourcePoolEntry$Type#CLASS_OR_RESOURCE into two separate enum
members. I think it's a common requirement to perform some action
*only* for class files, I found myself checking the entry path for the
"class" suffix to do so.
I think it may stem from the JMOD format where classes and resources are
the same section. I agree it should be re-examined.
-Alan.