Exemplo n.º 1
0
  public static void virtual_unpack_7128123785277710736(
      SNode thisNode, UnpackHelper helper, Iterable<Object> artifacts) {
    SNode parent = helper.parent(thisNode);
    String parentLocation = helper.contentLocations().get(parent);
    String zipLocation =
        parentLocation
            + "/"
            + BuildString_Behavior.call_getText_4380385936562005550(
                SLinkOperations.getTarget(thisNode, "containerName", true),
                helper.getMacroHelper());
    helper.locations().put(thisNode, zipLocation);

    if (helper.isContentRequired(thisNode)) {
      String tempPath =
          helper
              .getPathProvider()
              .createTempPath(
                  SPropertyOperations.getString(thisNode, "name"),
                  "deps",
                  SPropertyOperations.getString(
                      SNodeOperations.getAncestor(
                          thisNode, "jetbrains.mps.build.structure.BuildProject", false, false),
                      "name"));
      helper.emit(_quotation_createNode_20awhq_a0a1a5a0(tempPath));
      helper.emit(_quotation_createNode_20awhq_a0a2a5a0(zipLocation, tempPath));
      helper.contentLocations().put(thisNode, tempPath);
    }
  }
 public static void virtual_unpack_7128123785277710736(
     SNode thisNode, UnpackHelper helper, Iterable<Object> artifacts) {
   // TODO extract! (it is a copy of Folder behavior)
   SNode parent = helper.parent(thisNode);
   String parentLocation = helper.contentLocations().get(parent);
   String folderLocation =
       parentLocation
           + "/"
           + BuildString_Behavior.call_getText_4380385936562005550(
               SLinkOperations.getTarget(
                   SLinkOperations.getTarget(thisNode, "plugin", false), "containerName", true),
               helper.getMacroHelper());
   helper.locations().put(thisNode, folderLocation);
   helper.contentLocations().put(thisNode, folderLocation);
   for (SNode ic :
       ListSequence.fromList(SLinkOperations.getTargets(thisNode, "children", true))
           .where(
               new IWhereFilter<SNode>() {
                 public boolean accept(SNode it) {
                   return SNodeOperations.isInstanceOf(
                       it, "jetbrains.mps.build.structure.BuildLayout_ImportContent");
                 }
               })
           .select(
               new ISelector<SNode, SNode>() {
                 public SNode select(SNode it) {
                   return SNodeOperations.cast(
                       it, "jetbrains.mps.build.structure.BuildLayout_ImportContent");
                 }
               })) {
     SNode node =
         SNodeOperations.as(
             SLinkOperations.getTarget(ic, "target", false),
             "jetbrains.mps.build.structure.BuildLayout_PathElement");
     if ((node != null)) {
       // note: if node is imported directly - do not override its original location
       if (!(helper.locations().containsKey(node))) {
         helper.locations().put(node, folderLocation);
       }
       if (!(helper.contentLocations().containsKey(node))) {
         helper.contentLocations().put(node, folderLocation);
       }
     }
   }
 }