use of org.gradle.internal.management.VersionCatalogBuilderInternal in project gradle by gradle.
the class DefaultDependenciesAccessors method generateAccessors.
@Override
public void generateAccessors(List<VersionCatalogBuilder> builders, ClassLoaderScope classLoaderScope, Settings settings) {
try {
this.classLoaderScope = classLoaderScope;
// this is used in tests only, shouldn't happen in real context
this.models.clear();
for (VersionCatalogBuilder builder : builders) {
DefaultVersionCatalog model = ((VersionCatalogBuilderInternal) builder).build();
models.add(model);
}
if (models.stream().anyMatch(DefaultVersionCatalog::isNotEmpty)) {
for (DefaultVersionCatalog model : models) {
if (model.isNotEmpty()) {
writeDependenciesAccessors(model);
}
}
}
if (featurePreviews.isFeatureEnabled(FeaturePreviews.Feature.TYPESAFE_PROJECT_ACCESSORS)) {
IncubationLogger.incubatingFeatureUsed("Type-safe project accessors");
writeProjectAccessors(((SettingsInternal) settings).getProjectRegistry());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations