use of org.gradle.model.internal.core.NodeInitializer in project gradle by gradle.
the class NonTransformedModelDslBacking method register.
private <T> void register(Class<T> type, Action<? super T> action) {
ModelRuleDescriptor descriptor = new SimpleModelRuleDescriptor("model." + modelPath);
NodeInitializerRegistry nodeInitializerRegistry = modelRegistry.realize(DEFAULT_REFERENCE.getPath(), DEFAULT_REFERENCE.getType());
ModelType<T> modelType = ModelType.of(type);
NodeInitializer nodeInitializer = nodeInitializerRegistry.getNodeInitializer(forType(modelType));
modelRegistry.register(ModelRegistrations.of(modelPath, nodeInitializer).descriptor(descriptor).action(ModelActionRole.Initialize, NoInputsModelAction.of(ModelReference.of(modelPath, modelType), descriptor, action)).build());
}
Aggregations