protected function writeItemGroupProjectConfig(DOMElement $parent) { /** @var DOMElement $element */ $element = $parent->appendChild($this->dom->createElement('ItemGroup')); $element->setAttribute('Label', 'ProjectConfigurations'); foreach ($this->project->getConfigurations() as $configuration) { $this->variableParser->push('ide.config', $configuration); $this->writeProjectConfig($element, $configuration); $this->variableParser->pop('ide.config'); } }
protected function execute(InputInterface $input, OutputInterface $output) { $ide = $input->getArgument('ide'); $config = $this->getConfig(); if (!array_key_exists($ide, $this->generators)) { throw new InvalidArgumentException(sprintf('The "%s" generator is not supported.', $ide)); } $output->writeln('Generating project files for ' . $this->generators[$ide]['name']); $variableParser = new Parser(); $variableParser->push('config', $config); $variableParser->set('ide.type', $ide); $outputDirectory = $variableParser->parse('projects/$(ide.type)/'); FileSystem::createDirectory($outputDirectory, 0777); $generatorFqcn = $this->generators[$ide]['fqcn']; $generator = new $generatorFqcn($config); $generator->setVariableParser($variableParser); $generator->generate($outputDirectory); }