public void process() { VisibleArtifacts artifacts = new VisibleArtifacts(project, genContext); artifacts.collect(); UnpackHelper helper = new UnpackHelper(artifacts, genContext); for (SNode dep : SNodeOperations.getDescendants( project, "jetbrains.mps.build.structure.BuildExternalDependency", false, new String[] {})) { BehaviorReflection.invokeVirtual( Void.class, dep, "virtual_fetchDependencies_5908258303322131137", new Object[] { artifacts, new FetchDependenciesProcessor.RequiredDependenciesBuilderImpl(artifacts, dep, helper) }); } helper.eval(); List<SNode> statements = helper.getStatements(); if (!(ListSequence.fromList(statements).isEmpty())) { SNode wf = SModelOperations.createNewNode( SNodeOperations.getModel(project), null, "jetbrains.mps.build.structure.BuildCustomWorkflow"); SNode taskpart = SModelOperations.createNewNode( SNodeOperations.getModel(project), null, "jetbrains.mps.build.workflow.structure.BwfTaskPart"); SLinkOperations.setTarget( taskpart, "task", SLinkOperations.getTarget(_quotation_createNode_t02zqv_a0a2a7a3(), "target", false), false); ListSequence.fromList(SLinkOperations.getTargets(wf, "parts", true)).addElement(taskpart); SNode stask = SModelOperations.createNewNode( SNodeOperations.getModel(project), null, "jetbrains.mps.build.workflow.structure.BwfSubTask"); SPropertyOperations.set(stask, "name", "fetch"); ListSequence.fromList(SLinkOperations.getTargets(taskpart, "subTasks", true)) .addElement(stask); ListSequence.fromList(SLinkOperations.getTargets(stask, "statements", true)) .addSequence(ListSequence.fromList(statements)); ListSequence.fromList(SLinkOperations.getTargets(project, "aspects", true)).addElement(wf); } }
protected boolean check(SNode node) { if (SNodeOperations.getModel(node).getModule() instanceof TransientModelsModule) { genContext.showErrorMessage( dep, "returned dependency in transient model: " + jetbrains.mps.util.SNodeOperations.getDebugText(node)); return false; } if (!(artifacts.contains(node))) { genContext.showErrorMessage( dep, "returned node which is not available in dependencies: " + jetbrains.mps.util.SNodeOperations.getDebugText(node)); return false; } return true; }