コード例 #1
0
 public static void virtual_appendName_1368030936106665465(
     SNode thisNode, SNode parent, StringBuilder sb) {
   if (SNodeOperations.isInstanceOf(
       parent, "jetbrains.mps.build.structure.BuildLayout_Container")) {
     sb.append("/");
   }
   sb.append(
       BuildString_Behavior.call_getText_4380385936562005550(
           SLinkOperations.getTarget(
               SLinkOperations.getTarget(thisNode, "plugin", false), "containerName", true),
           null));
 }
コード例 #2
0
 public void applyRule(
     final SNode jarArchive,
     final TypeCheckingContext typeCheckingContext,
     IsApplicableStatus status) {
   String approxName =
       BuildString_Behavior.call_getText_4380385936562005550(
           SLinkOperations.getTarget(jarArchive, "containerName", true), null);
   if (!(approxName.endsWith("}"))
       && !(approxName
           .toLowerCase()
           .endsWith(
               BehaviorReflection.invokeVirtual(
                   String.class,
                   jarArchive,
                   "virtual_getExpectedExtension_6967233722066020217",
                   new Object[] {})))) {
     {
       MessageTarget errorTarget = new NodeMessageTarget();
       IErrorReporter _reporter_2309309498 =
           typeCheckingContext.reportWarning(
               SLinkOperations.getTarget(jarArchive, "containerName", true),
               "should end with `"
                   + BehaviorReflection.invokeVirtual(
                       String.class,
                       jarArchive,
                       "virtual_getExpectedExtension_6967233722066020217",
                       new Object[] {})
                   + "'",
               "r:2349e4dd-6518-4a4c-9022-c7887bed8b52(jetbrains.mps.build.typesystem)",
               "1979010778009333641",
               null,
               errorTarget);
       {
         BaseQuickFixProvider intentionProvider =
             new BaseQuickFixProvider(
                 "jetbrains.mps.build.typesystem.fixContainerName_QuickFix", false);
         intentionProvider.putArgument(
             "newExtension",
             BehaviorReflection.invokeVirtual(
                 String.class,
                 jarArchive,
                 "virtual_getExpectedExtension_6967233722066020217",
                 new Object[] {}));
         _reporter_2309309498.addIntentionProvider(intentionProvider);
       }
     }
   }
 }
コード例 #3
0
 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);
       }
     }
   }
 }
コード例 #4
0
 public static String call_getOutputPath_WithMacro_280273048052535414(
     SNode thisNode, Context context) {
   if ((SNodeOperations.getParent(thisNode) != null)
       && SNodeOperations.isInstanceOf(
           SNodeOperations.getParent(thisNode),
           "jetbrains.mps.build.structure.BuildLayout_Container")) {
     String parentChildrenTargetDir =
         BehaviorReflection.invokeVirtual(
             String.class,
             SNodeOperations.cast(
                 SNodeOperations.getParent(thisNode),
                 "jetbrains.mps.build.structure.BuildLayout_Container"),
             "virtual_getChildrenOutputDir_WithMacro_4701820937132344011",
             new Object[] {context});
     return parentChildrenTargetDir
         + "/"
         + BuildString_Behavior.call_getText_4380385936562005550(
             SLinkOperations.getTarget(
                 SLinkOperations.getTarget(thisNode, "plugin", false), "containerName", true),
             context.getMacros(thisNode));
   }
   return null;
 }
コード例 #5
0
 public static String virtual_getApproximateName_5610619299014531547(SNode thisNode) {
   return BuildString_Behavior.call_getText_4380385936562005550(
       SLinkOperations.getTarget(
           SLinkOperations.getTarget(thisNode, "plugin", false), "containerName", true),
       null);
 }