Java 类org.eclipse.xtext.xtext.generator.model.project.BundleProjectConfig 实例源码

项目:xtext-core    文件:WizardConfigTest.java   
@Test
public void testMavenProjectNames() {
  StandardProjectConfig _standardProjectConfig = new StandardProjectConfig();
  final Procedure1<StandardProjectConfig> _function = (StandardProjectConfig it) -> {
    it.setBaseName("com.acme");
    it.setMavenLayout(true);
    BundleProjectConfig _runtimeTest = it.getRuntimeTest();
    _runtimeTest.setEnabled(true);
    BundleProjectConfig _eclipsePlugin = it.getEclipsePlugin();
    _eclipsePlugin.setEnabled(true);
    BundleProjectConfig _eclipsePluginTest = it.getEclipsePluginTest();
    _eclipsePluginTest.setEnabled(true);
  };
  final StandardProjectConfig cfg = ObjectExtensions.<StandardProjectConfig>operator_doubleArrow(_standardProjectConfig, _function);
  cfg.initialize(this.injector);
  Assert.assertEquals("com.acme", cfg.getRuntimeTest().getName());
  Assert.assertEquals("com.acme.ui", cfg.getEclipsePluginTest().getName());
}
项目:xtext-core    文件:WizardConfigTest.java   
@Test
public void testPlainProjectNames() {
  StandardProjectConfig _standardProjectConfig = new StandardProjectConfig();
  final Procedure1<StandardProjectConfig> _function = (StandardProjectConfig it) -> {
    it.setBaseName("com.acme");
    BundleProjectConfig _runtimeTest = it.getRuntimeTest();
    _runtimeTest.setEnabled(true);
    BundleProjectConfig _eclipsePlugin = it.getEclipsePlugin();
    _eclipsePlugin.setEnabled(true);
    BundleProjectConfig _eclipsePluginTest = it.getEclipsePluginTest();
    _eclipsePluginTest.setEnabled(true);
  };
  final StandardProjectConfig cfg = ObjectExtensions.<StandardProjectConfig>operator_doubleArrow(_standardProjectConfig, _function);
  cfg.initialize(this.injector);
  Assert.assertEquals("com.acme.tests", cfg.getRuntimeTest().getName());
  Assert.assertEquals("com.acme.ui.tests", cfg.getEclipsePluginTest().getName());
}
项目:xtext-core    文件:XtextProjectConfig.java   
@Override
public List<? extends SubProjectConfig> getTestProjects() {
  ArrayList<BundleProjectConfig> _xblockexpression = null;
  {
    final ArrayList<BundleProjectConfig> testProjects = CollectionLiterals.<BundleProjectConfig>newArrayList();
    Iterables.<BundleProjectConfig>addAll(testProjects, Collections.<BundleProjectConfig>unmodifiableList(CollectionLiterals.<BundleProjectConfig>newArrayList(this.runtimeTest, this.eclipsePluginTest)));
    _xblockexpression = testProjects;
  }
  return _xblockexpression;
}
项目:CooperateModelingEnvironment    文件:CooperateXtextGenerator.java   
@Override
protected void generateManifests() {
    projectConfig.getEnabledProjects().stream().filter(BundleProjectConfig.class::isInstance)
            .map(BundleProjectConfig.class::cast).map(BundleProjectConfig::getManifest)
            .forEach(m -> m.getImportedPackages().remove("org.apache.log4j"));
    super.generateManifests();
}
项目:xtext-extras    文件:Generator2AdapterSetup.java   
private XtextProjectConfig createProjectConfig() {
  StandardProjectConfig _standardProjectConfig = new StandardProjectConfig();
  final Procedure1<StandardProjectConfig> _function = (StandardProjectConfig it) -> {
    it.setCreateEclipseMetaData(true);
    it.setBaseName(this.naming.getProjectNameRt());
    final String runtimeRoot = this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_RT).getPath();
    final int projectNameIndex = runtimeRoot.lastIndexOf(it.getBaseName());
    if ((projectNameIndex >= 0)) {
      it.setRootPath(runtimeRoot.substring(0, projectNameIndex));
    } else {
      it.setRootPath(runtimeRoot);
    }
    RuntimeProjectConfig _runtime = it.getRuntime();
    _runtime.setName(it.getBaseName());
    RuntimeProjectConfig _runtime_1 = it.getRuntime();
    _runtime_1.setRoot(runtimeRoot);
    RuntimeProjectConfig _runtime_2 = it.getRuntime();
    _runtime_2.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC).getPath());
    RuntimeProjectConfig _runtime_3 = it.getRuntime();
    _runtime_3.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN).getPath());
    RuntimeProjectConfig _runtime_4 = it.getRuntime();
    _runtime_4.setEcoreModel(this.xpandContext.getOutput().getOutlet(Generator.MODEL).getPath());
    BundleProjectConfig _eclipsePlugin = it.getEclipsePlugin();
    _eclipsePlugin.setEnabled(true);
    BundleProjectConfig _eclipsePlugin_1 = it.getEclipsePlugin();
    _eclipsePlugin_1.setName(this.naming.getProjectNameUi());
    BundleProjectConfig _eclipsePlugin_2 = it.getEclipsePlugin();
    _eclipsePlugin_2.setRoot(this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_UI).getPath());
    BundleProjectConfig _eclipsePlugin_3 = it.getEclipsePlugin();
    _eclipsePlugin_3.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC_UI).getPath());
    BundleProjectConfig _eclipsePlugin_4 = it.getEclipsePlugin();
    _eclipsePlugin_4.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN_UI).getPath());
    BundleProjectConfig _genericIde = it.getGenericIde();
    _genericIde.setEnabled(true);
    BundleProjectConfig _genericIde_1 = it.getGenericIde();
    _genericIde_1.setName(this.naming.getProjectNameIde());
    BundleProjectConfig _genericIde_2 = it.getGenericIde();
    _genericIde_2.setRoot(this.xpandContext.getOutput().getOutlet(Generator.PLUGIN_IDE).getPath());
    BundleProjectConfig _genericIde_3 = it.getGenericIde();
    _genericIde_3.setSrc(this.xpandContext.getOutput().getOutlet(Generator.SRC_IDE).getPath());
    BundleProjectConfig _genericIde_4 = it.getGenericIde();
    _genericIde_4.setSrcGen(this.xpandContext.getOutput().getOutlet(Generator.SRC_GEN_IDE).getPath());
  };
  return ObjectExtensions.<StandardProjectConfig>operator_doubleArrow(_standardProjectConfig, _function);
}
项目:xtext-core    文件:XtextProjectConfig.java   
@Pure
public BundleProjectConfig getRuntimeTest() {
  return this.runtimeTest;
}
项目:xtext-core    文件:XtextProjectConfig.java   
public void setRuntimeTest(final BundleProjectConfig runtimeTest) {
  this.runtimeTest = runtimeTest;
}
项目:xtext-core    文件:XtextProjectConfig.java   
@Pure
public BundleProjectConfig getGenericIde() {
  return this.genericIde;
}
项目:xtext-core    文件:XtextProjectConfig.java   
public void setGenericIde(final BundleProjectConfig genericIde) {
  this.genericIde = genericIde;
}
项目:xtext-core    文件:XtextProjectConfig.java   
@Pure
public BundleProjectConfig getEclipsePlugin() {
  return this.eclipsePlugin;
}
项目:xtext-core    文件:XtextProjectConfig.java   
public void setEclipsePlugin(final BundleProjectConfig eclipsePlugin) {
  this.eclipsePlugin = eclipsePlugin;
}
项目:xtext-core    文件:XtextProjectConfig.java   
@Pure
public BundleProjectConfig getEclipsePluginTest() {
  return this.eclipsePluginTest;
}
项目:xtext-core    文件:XtextProjectConfig.java   
public void setEclipsePluginTest(final BundleProjectConfig eclipsePluginTest) {
  this.eclipsePluginTest = eclipsePluginTest;
}
项目:xtext-core    文件:StandardProjectConfig.java   
@Override
public void setDefaults() {
  super.setDefaults();
  final Consumer<SubProjectConfig> _function = (SubProjectConfig it) -> {
    String _name = it.getName();
    boolean _tripleEquals = (_name == null);
    if (_tripleEquals) {
      it.setName(this.computeName(it));
    }
    String _rootPath = it.getRootPath();
    boolean _tripleEquals_1 = (_rootPath == null);
    if (_tripleEquals_1) {
      it.setRoot(this.computeRoot(it));
    }
    String _metaInfPath = it.getMetaInfPath();
    boolean _tripleEquals_2 = (_metaInfPath == null);
    if (_tripleEquals_2) {
      it.setMetaInf(this.computeMetaInf(it));
    }
    String _srcPath = it.getSrcPath();
    boolean _tripleEquals_3 = (_srcPath == null);
    if (_tripleEquals_3) {
      it.setSrc(this.computeSrc(it));
    }
    String _srcGenPath = it.getSrcGenPath();
    boolean _tripleEquals_4 = (_srcGenPath == null);
    if (_tripleEquals_4) {
      it.setSrcGen(this.computeSrcGen(it));
    }
    if ((it instanceof BundleProjectConfig)) {
      if (this.createEclipseMetaData) {
        ManifestAccess _manifest = ((BundleProjectConfig)it).getManifest();
        boolean _tripleEquals_5 = (_manifest == null);
        if (_tripleEquals_5) {
          ((BundleProjectConfig)it).setManifest(this.newManifestAccess());
        }
        PluginXmlAccess _pluginXml = ((BundleProjectConfig)it).getPluginXml();
        boolean _tripleEquals_6 = (_pluginXml == null);
        if (_tripleEquals_6) {
          ((BundleProjectConfig)it).setPluginXml(this.newPluginXmlAccess());
        }
      }
    }
    if ((it instanceof RuntimeProjectConfig)) {
      String _ecoreModelPath = ((RuntimeProjectConfig)it).getEcoreModelPath();
      boolean _tripleEquals_7 = (_ecoreModelPath == null);
      if (_tripleEquals_7) {
        ((RuntimeProjectConfig)it).setEcoreModel(this.computeEcoreModel(((RuntimeProjectConfig)it)));
      }
    }
    if ((it instanceof WebProjectConfig)) {
      String _assetsPath = ((WebProjectConfig)it).getAssetsPath();
      boolean _tripleEquals_8 = (_assetsPath == null);
      if (_tripleEquals_8) {
        ((WebProjectConfig)it).setAssets(this.computeAssets(((WebProjectConfig)it)));
      }
    }
  };
  this.getEnabledProjects().forEach(_function);
}
项目:xtext-core    文件:StandardProjectConfig.java   
protected String computeName(final SubProjectConfig project) {
  String _switchResult = null;
  boolean _matched = false;
  RuntimeProjectConfig _runtime = this.getRuntime();
  if (Objects.equal(project, _runtime)) {
    _matched=true;
    _switchResult = this.baseName;
  }
  if (!_matched) {
    BundleProjectConfig _runtimeTest = this.getRuntimeTest();
    if (Objects.equal(project, _runtimeTest)) {
      _matched=true;
      String _xifexpression = null;
      if ((!this.mavenLayout)) {
        _xifexpression = (this.baseName + ".tests");
      } else {
        _xifexpression = this.baseName;
      }
      _switchResult = _xifexpression;
    }
  }
  if (!_matched) {
    BundleProjectConfig _genericIde = this.getGenericIde();
    if (Objects.equal(project, _genericIde)) {
      _matched=true;
      _switchResult = (this.baseName + ".ide");
    }
  }
  if (!_matched) {
    BundleProjectConfig _eclipsePlugin = this.getEclipsePlugin();
    if (Objects.equal(project, _eclipsePlugin)) {
      _matched=true;
      _switchResult = (this.baseName + ".ui");
    }
  }
  if (!_matched) {
    BundleProjectConfig _eclipsePluginTest = this.getEclipsePluginTest();
    if (Objects.equal(project, _eclipsePluginTest)) {
      _matched=true;
      String _xifexpression_1 = null;
      if ((!this.mavenLayout)) {
        _xifexpression_1 = (this.baseName + ".ui.tests");
      } else {
        _xifexpression_1 = (this.baseName + ".ui");
      }
      _switchResult = _xifexpression_1;
    }
  }
  if (!_matched) {
    SubProjectConfig _ideaPlugin = this.getIdeaPlugin();
    if (Objects.equal(project, _ideaPlugin)) {
      _matched=true;
      _switchResult = (this.baseName + ".idea");
    }
  }
  if (!_matched) {
    WebProjectConfig _web = this.getWeb();
    if (Objects.equal(project, _web)) {
      _matched=true;
      _switchResult = (this.baseName + ".web");
    }
  }
  return _switchResult;
}