GenerationDirectory targetFolder = new GenerationDirectory(new File(outputDir), null, null);
File generationFolder = targetFolder.getAbsolutePath();
GeneratorConfigurationBuilder configBuilder = new GeneratorConfigurationBuilder();
configBuilder.allowedPackage(builtProjectClassLoader.loadClass(className).getPackage().getName());
GeneratorConfiguration configuration = configBuilder.build();
gen.init(builtProjectClassLoader, configuration.getSourceEncoding());
gen.generateJavascript(builtProjectClassLoader, className, sourceFolder, targetFolder, generationFolder, configuration);
}
catch (Exception e) {
throw Throwables.propagate(e);
}