示例#1
0
    private void load(File file, Element root) {
      Macros macros = MacrosFactory.projectDescriptor();
      FileMPSProject.ProjectDescriptor result_dkknya_a1a1a = this;
      final String result_dkknya_a0a1a1a = file.getName();
      result_dkknya_a1a1a.setName(result_dkknya_a0a1a1a);

      if (root == null) {
        return;
      }

      List<Element> moduleList = ListSequence.fromList(new ArrayList<Element>());
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(
                              AttributeUtils.elementChildren(root, "projectSolutions"))
                          .first(),
                      "solutionPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(
                              AttributeUtils.elementChildren(root, "projectLanguages"))
                          .first(),
                      "languagePath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(AttributeUtils.elementChildren(root, "projectDevkits"))
                          .first(),
                      "devkitPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(AttributeUtils.elementChildren(root, "projectModules"))
                          .first(),
                      "modulePath")));
      for (Element moduleElement : ListSequence.fromList(moduleList)) {
        Path modulePath = new Path();
        Path result_dkknya_a1a9a1a1a = modulePath;
        final String result_dkknya_a0a1a9a1a1a =
            macros.expandPath(moduleElement.getAttributeValue("path"), file);
        result_dkknya_a1a9a1a1a.setPath(result_dkknya_a0a1a9a1a1a);
        final String result_dkknya_a1a1a9a1a1a = moduleElement.getAttributeValue("folder");
        result_dkknya_a1a9a1a1a.setMPSFolder(result_dkknya_a1a1a9a1a1a);
        result_dkknya_a1a1a.addModule(modulePath);
      }

      for (Element e :
          ListSequence.fromList(
              AttributeUtils.elementChildren(
                  ListSequence.fromList(AttributeUtils.elementChildren(root, "genConfs")).first(),
                  "genConfModels"))) {
        ModelsTestConfiguration tc = new ModelsTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        for (Element me :
            ListSequence.fromList(
                AttributeUtils.elementChildren(
                    ListSequence.fromList(AttributeUtils.elementChildren(e, "models")).first(),
                    "model"))) {
          tc.addModel(SModelReference.fromString(me.getAttributeValue("modelRef")));
        }
        result_dkknya_a1a1a.getTestConfiturations().add(tc);
      }
      for (Element e :
          ListSequence.fromList(
              AttributeUtils.elementChildren(
                  ListSequence.fromList(AttributeUtils.elementChildren(root, "genConfs")).first(),
                  "genConfModule"))) {
        ModuleTestConfiguration tc = new ModuleTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        if (e.getAttributeValue("moduleRef") != null) {
          tc.setModuleRef(ModuleReference.fromString(e.getAttributeValue("moduleRef")));
          result_dkknya_a1a1a.getTestConfiturations().add(tc);
        }
      }
    }
示例#2
0
    private void load(File file, Element root) {
      FileMPSProject.ProjectDescriptor result_dkknya_a0a5o = this;
      final String result_dkknya_a0a0a5o = file.getName();
      result_dkknya_a0a5o.setName(result_dkknya_a0a0a5o);

      if (root == null) {
        return;
      }

      List<Element> moduleList = ListSequence.fromList(new ArrayList<Element>());
      ListSequence.fromList(moduleList)
          .addSequence(
              Sequence.fromIterable(
                  XmlUtil.children(XmlUtil.first(root, "projectSolutions"), "solutionPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              Sequence.fromIterable(
                  XmlUtil.children(XmlUtil.first(root, "projectLanguages"), "languagePath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              Sequence.fromIterable(
                  XmlUtil.children(XmlUtil.first(root, "projectDevkits"), "devkitPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              Sequence.fromIterable(
                  XmlUtil.children(XmlUtil.first(root, "projectModules"), "modulePath")));
      for (Element moduleElement : ListSequence.fromList(moduleList)) {
        Path modulePath = new Path();
        Path result_dkknya_a1a9a0a5o = modulePath;
        final String result_dkknya_a0a1a9a0a5o =
            MacrosFactory.forProjectFile(FileSystem.getInstance().getFileByPath(file.getPath()))
                .expandPath(moduleElement.getAttributeValue("path"));
        result_dkknya_a1a9a0a5o.setPath(result_dkknya_a0a1a9a0a5o);
        final String result_dkknya_a1a1a9a0a5o = moduleElement.getAttributeValue("folder");
        result_dkknya_a1a9a0a5o.setMPSFolder(result_dkknya_a1a1a9a0a5o);
        result_dkknya_a0a5o.addModule(modulePath);
      }

      for (Element e :
          Sequence.fromIterable(
              XmlUtil.children(XmlUtil.first(root, "genConfs"), "genConfModels"))) {
        ModelsTestConfiguration tc = new ModelsTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        for (Element me :
            Sequence.fromIterable(XmlUtil.children(XmlUtil.first(e, "models"), "model"))) {
          tc.addModel(SModelReference.fromString(me.getAttributeValue("modelRef")));
        }
        result_dkknya_a0a5o.getTestConfigurations().add(tc);
      }

      for (Element e :
          Sequence.fromIterable(
              XmlUtil.children(XmlUtil.first(root, "genConfs"), "genConfModule"))) {
        ModuleTestConfiguration tc = new ModuleTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        String moduleRef = e.getAttributeValue("moduleRef");
        if (moduleRef != null) {
          tc.setModuleRef(ModuleReference.fromString(moduleRef));
          result_dkknya_a0a5o.getTestConfigurations().add(tc);
        }
      }
    }