use of org.gradle.model.internal.core.ModelNode.State in project gradle by gradle.
the class DefaultModelRegistry method transition.
@Override
public void transition(ModelNodeInternal node, ModelNode.State desired, boolean laterOk) {
ModelPath path = node.getPath();
ModelNode.State state = node.getState();
LOGGER.debug("Project {} - Transitioning model element '{}' from state {} to {}", projectPath, path, state.name(), desired.name());
if (desired.ordinal() < state.ordinal()) {
if (laterOk) {
return;
} else {
throw new IllegalStateException("Cannot lifecycle model node '" + path + "' to state " + desired.name() + " as it is already at " + state.name());
}
}
if (state == desired) {
return;
}
GoalGraph goalGraph = new GoalGraph();
transitionTo(goalGraph, goalGraph.nodeAtState(new NodeAtState(node.getPath(), desired)));
}
Aggregations