use of io.micronaut.starter.analytics.SelectedFeature in project micronaut-starter by micronaut-projects.
the class GenerationListener method onApplicationGenerated.
@EventListener
void onApplicationGenerated(ApplicationGeneratingEvent event) {
GeneratorContext context = event.getSource();
List<SelectedFeature> features = context.getFeatures().stream().map(SelectedFeature::new).collect(Collectors.toList());
Generated generated = new Generated(context.getApplicationType(), context.getLanguage(), context.getBuildTool(), context.getTestFramework(), context.getJdkVersion());
generated.setSelectedFeatures(features);
if (analyticsOperations != null) {
analyticsOperations.applicationGenerated(generated).whenComplete((httpStatus, throwable) -> {
if (throwable != null) {
if (LOG.isErrorEnabled()) {
LOG.error("Error occurred reporting analytics: " + throwable.getMessage(), throwable);
}
}
});
}
}
Aggregations