Java Code Examples for org.gradle.model.internal.registry.ModelRegistry#mutate()
The following examples show how to use
org.gradle.model.internal.registry.ModelRegistry#mutate() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BinaryTasksRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private <R, S extends BinarySpec> void doRegister(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { try { RuleMethodDataCollector dataCollector = new RuleMethodDataCollector(); verifyMethodSignature(dataCollector, ruleDefinition); Class<S> binaryType = dataCollector.getParameterType(BinarySpec.class); dependencies.add(ComponentModelBasePlugin.class); final ModelReference<TaskContainer> tasks = ModelReference.of(ModelPath.path("tasks"), new ModelType<TaskContainer>() { }); modelRegistry.mutate(new BinaryTaskRule<R, S>(tasks, binaryType, ruleDefinition, modelRegistry)); } catch (InvalidComponentModelException e) { invalidModelRule(ruleDefinition, e); } }
Example 2
Source File: BinaryTasksRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private <R, S extends BinarySpec> void doRegister(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { try { RuleMethodDataCollector dataCollector = new RuleMethodDataCollector(); verifyMethodSignature(dataCollector, ruleDefinition); Class<S> binaryType = dataCollector.getParameterType(BinarySpec.class); dependencies.add(ComponentModelBasePlugin.class); final ModelReference<TaskContainer> tasks = ModelReference.of(ModelPath.path("tasks"), new ModelType<TaskContainer>() { }); modelRegistry.mutate(new BinaryTaskRule<R, S>(tasks, binaryType, ruleDefinition, modelRegistry)); } catch (InvalidComponentModelException e) { invalidModelRule(ruleDefinition, e); } }
Example 3
Source File: ComponentModelRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public <R> void register(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { try { ModelType<? extends T> type = readType(ruleDefinition); ModelType<? extends U> implementation = determineImplementationType(ruleDefinition, type); dependencies.add(ComponentModelBasePlugin.class); if (implementation != null) { ModelMutator<?> mutator = new RegisterTypeRule<T, U>(type, implementation, ruleDefinition.getDescriptor(), registerer); modelRegistry.mutate(mutator); } } catch (InvalidComponentModelException e) { invalidModelRule(ruleDefinition, e); } }
Example 4
Source File: AbstractMutationRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public <R> void register(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { List<ModelReference<?>> bindings = ruleDefinition.getReferences(); ModelReference<?> subject = bindings.get(0); List<ModelReference<?>> inputs = bindings.subList(1, bindings.size()); MethodModelMutator<?> mutator = toMutator(ruleDefinition, subject, inputs); if (isFinalize()) { modelRegistry.finalize(mutator); } else { modelRegistry.mutate(mutator); } }
Example 5
Source File: ComponentModelRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public <R> void register(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { try { ModelType<? extends T> type = readType(ruleDefinition); ModelType<? extends U> implementation = determineImplementationType(ruleDefinition, type); dependencies.add(ComponentModelBasePlugin.class); if (implementation != null) { ModelMutator<?> mutator = new RegisterTypeRule<T, U>(type, implementation, ruleDefinition.getDescriptor(), registerer); modelRegistry.mutate(mutator); } } catch (InvalidComponentModelException e) { invalidModelRule(ruleDefinition, e); } }
Example 6
Source File: AbstractMutationRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public <R> void register(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) { List<ModelReference<?>> bindings = ruleDefinition.getReferences(); ModelReference<?> subject = bindings.get(0); List<ModelReference<?>> inputs = bindings.subList(1, bindings.size()); MethodModelMutator<?> mutator = toMutator(ruleDefinition, subject, inputs); if (isFinalize()) { modelRegistry.finalize(mutator); } else { modelRegistry.mutate(mutator); } }
Example 7
Source File: ComponentBinariesRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
private <S extends BinarySpec, R> void configureMutationRule(ModelRegistry modelRegistry, ModelReference<BinaryContainer> subject, Class<? extends ComponentSpec> componentType, Class<S> binaryType, MethodRuleDefinition<R> ruleDefinition) { modelRegistry.mutate(new ComponentBinariesRule<R, S>(subject, componentType, binaryType, ruleDefinition, modelRegistry)); }
Example 8
Source File: ComponentBinariesRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
private <S extends BinarySpec, R> void configureMutationRule(ModelRegistry modelRegistry, ModelReference<BinaryContainer> subject, Class<? extends ComponentSpec> componentType, Class<S> binaryType, MethodRuleDefinition<R> ruleDefinition) { modelRegistry.mutate(new ComponentBinariesRule<R, S>(subject, componentType, binaryType, ruleDefinition, modelRegistry)); }