@Override
public void begin(RenderingContext context, BuildTarget buildTarget) throws IOException {
boolean hasOneResource = false;
for (String className : context.getClassSource().getClassNames()) {
ClassReader cls = context.getClassSource().get(className);
AnnotationReader annot = cls.getAnnotations().get(JavaScriptResource.class.getName());
if (annot == null) {
continue;
}
String path = annot.getValue("value").getString();
String packageName = className.substring(0, className.lastIndexOf('.'));
String resourceName = packageName.replace('.', '/') + "/" + path;
try (InputStream input = context.getClassLoader().getResourceAsStream(resourceName)) {
if (input == null) {
throw new RenderingException("Error processing JavaScriptResource annotation on class " +