Example #1
0
                internal CSharpCompilerInputs(CSharpProjectFile projectFile)
                {
                    this.projectFile = projectFile;
                    var projectDirectory = Path.GetDirectoryName(projectFile.FilePath);
                    var outputDirectory  = projectFile.GetTargetPath();

                    if (!string.IsNullOrEmpty(outputDirectory) && Path.IsPathRooted(outputDirectory))
                    {
                        outputDirectory = Path.GetDirectoryName(outputDirectory);
                    }
                    else
                    {
                        outputDirectory = projectDirectory;
                    }

                    this.ParseOptions       = defaultParseOptions;
                    this.CompilationOptions = new CSharpCompilationOptions(
                        OutputKind.ConsoleApplication,
                        debugInformationKind: DebugInformationKind.None,
                        xmlReferenceResolver: new XmlFileResolver(projectDirectory),
                        sourceReferenceResolver: new SourceFileResolver(ImmutableArray <string> .Empty, projectDirectory),
                        metadataReferenceResolver: new MetadataFileReferenceResolver(ImmutableArray <string> .Empty, projectDirectory),
                        metadataReferenceProvider: MetadataFileReferenceProvider.Default,
                        strongNameProvider: new DesktopStrongNameProvider(ImmutableArray.Create(projectDirectory, outputDirectory)),
                        assemblyIdentityComparer: DesktopAssemblyIdentityComparer.Default);
                    this.Warnings           = new Dictionary <string, ReportDiagnostic>();
                    this.Sources            = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.References         = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.AnalyzerReferences = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                }
 internal CSharpCompilerInputs(CSharpProjectFile projectFile)
 {
     _projectFile           = projectFile;
     this.CommandLineArgs   = new List <string>();
     this.Sources           = SpecializedCollections.EmptyEnumerable <ITaskItem>();
     this.AdditionalSources = SpecializedCollections.EmptyEnumerable <ITaskItem>();
     this.ProjectDirectory  = Path.GetDirectoryName(projectFile.FilePath);
     this.OutputDirectory   = projectFile.GetOutputDirectory();
 }
                internal CSharpCompilerInputs(CSharpProjectFile projectFile)
                {
                    this.projectFile = projectFile;

                    this.ParseOptions       = defaultParseOptions;
                    this.CompilationOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication);
                    this.Warnings           = new Dictionary <string, ReportDiagnostic>();
                    this.Sources            = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.References         = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                }
                internal CSharpCompilerInputs(CSharpProjectFile projectFile)
                {
                    _projectFile            = projectFile;
                    this.Options            = new HostBuildOptions();
                    this.Sources            = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.References         = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.AnalyzerReferences = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.AdditionalFiles    = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.LibPaths           = SpecializedCollections.EmptyReadOnlyList <string>();

                    this.Options.ProjectDirectory = Path.GetDirectoryName(projectFile.FilePath);
                    this.Options.OutputDirectory  = projectFile.GetOutputDirectory();
                }
                internal CSharpCompilerInputs(CSharpProjectFile projectFile)
                {
                    this.projectFile = projectFile;
                    var projectDirectory = Path.GetDirectoryName(projectFile.FilePath);
                    var outputDirectory  = projectFile.GetOutputDirectory();

                    this.ParseOptions       = defaultParseOptions;
                    this.CompilationOptions = new CSharpCompilationOptions(
                        OutputKind.ConsoleApplication,
                        xmlReferenceResolver: new XmlFileResolver(projectDirectory),
                        sourceReferenceResolver: new SourceFileResolver(ImmutableArray <string> .Empty, projectDirectory),
                        metadataReferenceResolver: new MetadataFileReferenceResolver(ImmutableArray <string> .Empty, projectDirectory),
                        metadataReferenceProvider: MetadataFileReferenceProvider.Default,
                        strongNameProvider: new DesktopStrongNameProvider(ImmutableArray.Create(projectDirectory, outputDirectory)),
                        assemblyIdentityComparer: DesktopAssemblyIdentityComparer.Default);
                    this.Warnings           = new Dictionary <string, ReportDiagnostic>();
                    this.Sources            = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.References         = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.AnalyzerReferences = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.AdditionalFiles    = SpecializedCollections.EmptyEnumerable <MSB.Framework.ITaskItem>();
                    this.LibPaths           = SpecializedCollections.EmptyReadOnlyList <string>();
                }