eclipse-aspectj / aspectj

Other
299 stars 86 forks source link

Implement '-m, --module' options from Javac #119

Open kriegaex opened 2 years ago

kriegaex commented 2 years ago

AJC has the very comfortable -sourceroots option, but no counterpart for (multi) modules, such as -modulesourceroots or --module-source-roots. It would be great for users to have an option which unburdens them from having to specify each single file to be compiled, but let the compiler find the files, just like we do it for normal source directories.

Actually, Javac has this option:

--module <module>(,<module>)*, -m <module>(,<module>)*
      Compile only the specified module(s), check timestamps

It works like this (added line breaks for readability):

javac
  --release 11
  -d bin
  --module-path "c:\Program Files\Java\AspectJ\lib\aspectjrt.jar"
  --module-source-path "modules/*/src"
  --module org.acme.first,org.acme.second

But the --module, -m options do not exist in ECJ and therefore AJC cannot utilise them either. I have just created JDT Core bug #578320, which we can track.

kriegaex commented 2 years ago

See https://github.com/eclipse/org.aspectj/issues/118#issuecomment-1019051812 and the linked ZIP archive, if you need an example project with two modules to play with.