void ( @NotNull BuildController controller, @NotNull GradleBuild gradleBuild, @NotNull ProjectImportModelProvider modelProvider ) { Set<String> obtainedModels = new HashSet<>(); long startTime = System.currentTimeMillis(); modelProvider.populateBuildModels(controller, gradleBuild, new ProjectImportModelProvider.BuildModelConsumer() { @Override public void consumeProjectModel(@NotNull ProjectModel projectModel, @NotNull Object object, @NotNull Class<?> clazz) { obtainedModels.add(clazz.getName()); addProjectModel(projectModel, object, clazz); } @Override public void consume(@NotNull BuildModel buildModel, @NotNull Object object, @NotNull Class<?> clazz) { obtainedModels.add(clazz.getName()); addBuildModel(buildModel, object, clazz); } }); myAllModels.logPerformance( "Ran extension " + modelProvider.getName() + " during " + modelProvider.getPhase() + " for build " + gradleBuild.getBuildIdentifier().getRootDir().getPath() + " obtained " + obtainedModels.size() + " model(s): " + joinClassNamesToString(obtainedModels), System.currentTimeMillis() - startTime ); }