コード例 #1
0
            public ProjectFileInfo Build(string language)
            {
                var commandLineArgs = GetCommandLineArgs(_project);

                var outputFilePath = _project.ReadPropertyString(PropertyNames.TargetPath);

                if (!string.IsNullOrWhiteSpace(outputFilePath))
                {
                    outputFilePath = GetAbsolutePathRelativeToProject(outputFilePath);
                }

                var outputRefFilePath = _project.ReadPropertyString(PropertyNames.TargetRefPath);

                if (!string.IsNullOrWhiteSpace(outputRefFilePath))
                {
                    outputRefFilePath = GetAbsolutePathRelativeToProject(outputRefFilePath);
                }

                var targetFramework = _project.ReadPropertyString(PropertyNames.TargetFramework);

                if (string.IsNullOrWhiteSpace(targetFramework))
                {
                    targetFramework = null;
                }

                var docs = _project.GetDocuments()
                           .Where(IsNotTemporaryGeneratedFile)
                           .Select(d => MakeDocumentFileInfo(_project, d))
                           .ToImmutableArray();

                var additionalDocs = _project.GetAdditionalFiles()
                                     .Select(MakeAdditionalDocumentFileInfo)
                                     .ToImmutableArray();

                return(ProjectFileInfo.Create(
                           language,
                           _loadedProject.FullPath,
                           outputFilePath,
                           outputRefFilePath,
                           targetFramework,
                           commandLineArgs,
                           docs,
                           additionalDocs,
                           _project.GetProjectReferences().ToImmutableArray()
                           ));
            }