On 10.06.25 15:15, Saravanan Palanichamy wrote:
[...]
1. Add ABC.java as the only source unit. Then I override resolve
visitor, to detect all resolve attempts. I now know what other
classes need to be resolved, so I try to add new files to the
compilation units. The code looks like it should go back to
initialization phase. Now when I see other classes that I added, I
can repeat this process recursively. I am not sure how feasible this
is given the amount of looping back and forth
that is perfectly fine.
2. Your comment about allowing groovy to find the script file was
interesting. So run GroovyC on one file and let the compile find all
dependencies as scripts. This looks like exactly what I want to do
in 1. but all my files are named .java so I am not sure groovy will
find them
didn't we have an option to set the extension of the files in the
compiler configuration?
Which approach do you think I should try?
the later one looks promising. Don't worry about resolving the same file
multiple times. Resolved types will stay resolved and skipped if the
resolver revisits them. Also not the whole compiler goes back to init,
just for the specific source unit. Once all source units are at the same
progress level they proceed together again.
bye Jochen