1

I would like to deploy my Spoon code as an AnnotationProcessor in order to ease deployment into arbitrary build environments. Has somebody tried to wrap the existing SpoonLoader to act like an annotation processor already?

I'm thinking an extension of this could exist but I don't know how to start: http://mir.cs.illinois.edu/~bdaniel3/spoonloader/

This question is related: How to obtain the right JavaFileManager in a Java annotation processor?

Community
  • 1
  • 1
Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26
  • Do you mean an APT AnnotationProcessor? – Martin Monperrus Dec 14 '15 at 13:16
  • Brett Daniel's SpoonLoader is not maintained anymore, but for on the fly transformation and loading see recent attempts at https://github.com/SpoonLabs/spoon-examples/blob/master/src/test/java/fr/inria/gforge/spoon/transformation/OnTheFlyTransfoTest.java – Martin Monperrus Dec 14 '15 at 13:19
  • what I'm looking for is an inference of the --sourcePath parameter from the context of the Java compiler... – Jurgen Vinju Dec 14 '15 at 16:39
  • Interesting idea. Spoon's authors mention in their paper that its created to be used by regular developers in their day to day work, but tooling doesn't seem to live up to that promise. In my mind, in order for tool to be usable it should be pretty easy to hook it in into your project regardless of build system (gradle, maven, etc). Lombok, for example delivers just that - you just hook it as regular annotation processor, no custom plugin or other stuff. With spoon it's a bit more complicated. I wonder if you found some clever way to overcome this yet? – Volodymyr Masliy Dec 20 '20 at 16:21
  • Nope. Still stuck on that. And I gave up on studying lombok's code. – Jurgen Vinju Dec 20 '20 at 16:27
  • In the maven context I pass the compilers classpath as a -D java VM option; in eclipse I query the respective bundles and projects to build a list of jars, etc. – Jurgen Vinju Dec 20 '20 at 17:29

0 Answers0