groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thibault Kruse <tibokr...@googlemail.com>
Subject groovysh: import completion for Grape loaded classes
Date Mon, 10 Aug 2015 22:15:06 GMT
Hi,

I was thinking about allowing tab completion for classes loaded by
Grapes. However I struggle to
programmatically find out what jars Grape has loaded so far. I believe
this is all about classloaders,
and I know very little about them.

I believe the GrapeIvy class adds URLs to a classloader, and all I
would need to do is to query that classloader in PackageHelperImpl.

In PackageHelperImpl the classloader hierarchy is moved upwards
starting with Thread.currentThread().contextClassLoader, but it seems
that moving up that hierarchy, I do not meet the same classloader that
GrapeIvy uses.

So is there any nice way to find that classloader?

regards,
  Thibault

Mime
View raw message