On 08.03.22 19:08, Andriy Rysin wrote:
So it looks like groovy picks up groovy scripts from the current
directory by default.
So the users can't just do "/path/to/scripts/TagText.groovy <myfile>"
any more.
They would have to do:
cd /path/to/scripts/
./TagText.groovy <myfile>

or they would have to invoke groovy explicitly:
groovy -cp /path/to/scripts /path/to/scripts/TagText.groovy <myfile>

what you could also do is to make something like a small loader. Use
https://docs.groovy-lang.org/latest/html/gapi/groovy/transform/SourceURI.html
to get the uri of the file, then add the to the classloader to then
finally load the class that is really doing the work and has
dependencies on other scripts. This loader should not have any direct
source dependencies for this to work.

bye Jochen

Reply via email to