use of org.gradle.model.internal.core.rule.describe.SimpleModelRuleDescriptor in project gradle by gradle.
the class DefaultTaskContainer method addPlaceholderAction.
public <T extends TaskInternal> void addPlaceholderAction(final String placeholderName, final Class<T> taskType, final Action<? super T> configure) {
if (!modelNode.hasLink(placeholderName)) {
final ModelType<T> taskModelType = ModelType.of(taskType);
ModelPath path = MODEL_PATH.child(placeholderName);
modelNode.addLink(ModelRegistrations.of(path).action(ModelActionRole.Create, new TaskCreator<T>(placeholderName, taskType, configure, taskModelType)).withProjection(new UnmanagedModelProjection<T>(taskModelType)).descriptor(new SimpleModelRuleDescriptor("tasks.addPlaceholderAction(" + placeholderName + ")")).build());
}
if (findByNameWithoutRules(placeholderName) == null) {
placeholders.add(placeholderName);
}
}
use of org.gradle.model.internal.core.rule.describe.SimpleModelRuleDescriptor in project gradle by gradle.
the class TestNativeBinariesFactory method create.
public static <T extends NativeBinarySpec, I extends AbstractNativeBinarySpec> T create(Class<T> publicType, Class<I> implType, String name, ITaskFactory taskFactory, MutableModelNode componentNode, BinaryNamingScheme namingScheme, NativeDependencyResolver resolver, NativePlatform platform, BuildType buildType, Flavor flavor) {
T binary = BaseBinaryFixtures.create(publicType, implType, name, componentNode, taskFactory);
NativeBinaries.initialize(binary, namingScheme, resolver, TestFiles.fileCollectionFactory(), platform, buildType, flavor);
SourceComponentSpec component = componentNode.asImmutable(ModelType.of(SourceComponentSpec.class), new SimpleModelRuleDescriptor("get component of " + name)).getInstance();
binary.getInputs().addAll(component.getSources().values());
return binary;
}
use of org.gradle.model.internal.core.rule.describe.SimpleModelRuleDescriptor 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