private function buildFileListFromProject(ArrayObject $result, ConfigInterface $config, Project $project) { if ($this->shouldCompileDependencies) { foreach ($project->getConfigurations() as $configuration) { $this->buildFileListFromConfiguration($result, $configuration); } } if (!$this->shouldCompileProjects && $this->buildDepth === 0) { return; } $result[$config->getVendor() . '/' . $config->getName()] = $project; }
public function generate() { $root = $this->dom->appendChild($this->dom->createElement('Project')); $root->setAttribute('ToolsVersion', '4.0'); $root->setAttribute('xmlns', 'http://schemas.microsoft.com/developer/msbuild/2003'); $filterParser = new FilterParser(); $filter = $filterParser->parse($this->project->getSource()); $this->writeItemGroupFilters($root, $filter); $this->writeItemGroupNone($root, $filter); $this->writeItemGroupIncludes($root, $filter); $this->writeItemGroupSource($root, $filter); $this->writeItemGroupResources($root, $filter); $this->dom->formatOutput = true; $this->dom->save($this->path); }
protected function writePreprocessorDefinitions(DOMElement $parent, Configuration $configuration) { $definitions = array_merge($this->project->getDefinitions(), $configuration->getDefinitions()); if ($configuration->getDebug()) { $definitions[] = '_DEBUG'; } else { $definitions[] = 'NDEBUG'; } $definitions[] = '%(PreprocessorDefinitions)'; $uniqueDefinitions = array_unique($definitions); XmlDom::createElement($parent, 'PreprocessorDefinitions', implode(';', $uniqueDefinitions)); }
protected function generateFilterFile(Project $project, $targetDirectory) { $path = sprintf('%s/%s.vcxproj.filters', $targetDirectory, $project->getName()); $generator = new FilterGenerator($path, $project, $this->getConfig(), $this->getVariableParser()); $generator->generate(); }
private function findPrecompiledHeader(Project $project, Configuration $configuration) { $pch = $configuration->getPrecompiledHeader(); if (!$pch) { $pch = $project->getPrecompiledHeader(); } return $pch; }
protected function getDependencies(Project $project) { $result = []; foreach ($project->getConfigurations() as $configuration) { foreach ($configuration->getDependencies() as $dependency) { $dependentProject = $this->config->findProject($dependency->getName()); if ($dependentProject && !in_array($dependentProject, $result)) { $result[] = $dependentProject; } } } return $result; }
/** * @covers PixelPolishers\Resolver\Config\Config::findProject */ public function testFindProjectWithValidProject() { // Arrange $project = new Project(); $project->setName('project'); $config = new Config(); $config->setProjects([$project]); // Act $result = $config->findProject('project'); // Assert $this->assertInstanceOf(Project::class, $result); }
protected function parseProjectType(Project $project, $data) { if (array_key_exists('type', $data)) { $project->setType($data['type']); } else { $project->setType(ProjectType::APPLICATION); } }