You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2018/10/28 17:58:01 UTC

get bytecode from groovyclassloader?

Hi guys,

wonder if it would make sense to store the bytecode of the compiled scripts
in the groovyclassloader to be able to access it as any other classloader
(jar/file) using loader.getResource("class/path/with/full/Name.class")?

I know it can be done with a BytecodeProcessor but it is not that
convenient and the impl can be trivial
since groovy.lang.GroovyClassLoader.ClassCollector#createClass can also
populate some resource map as well. Don't think the subfolder emulation is
needed (ie getResource("class/path") can return null if the package does
not exist anywhere else).

wdyt?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>