void onApplicationGenerated()

in grails-forge-api/src/main/java/org/grails/forge/api/analytics/GenerationListener.java [42:64]


    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.getGorm(),
                context.getServlet(),
                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);
                        }
                    }
                });
        }
    }