C# Class XSharp.Build.Xsc

Inheritance: Microsoft.Build.Tasks.ManagedCompiler
Mostra file Open project: X-Sharp/XSharpPublic

Private Properties

Property Type Description
AddAdditionalFilesToCommandLine void
AddAnalyzersToCommandLine void
AddCscCompilerCommands void
AddFeatures void
AddManagedCompilerCommands void
AddReferencesToCommandLine void
AddVOCompatibilityCommands void
ConfigureDebugProperties void
FindXsc string

Public Methods

Method Description
Xsc ( ) : System

Protected Methods

Method Description
AddResponseFileCommands ( Microsoft.Build.Tasks.CommandLineBuilderExtension commandLine ) : void
AddResponseFileCommandsImpl ( Microsoft.Build.Tasks.CommandLineBuilderExtension cmdline ) : void
ExecuteTool ( string pathToTool, string responseFileCommands, string commandLineCommands ) : int
GenerateCommandLineCommands ( ) : string
GenerateFullPathToTool ( ) : string
GenerateResponseFileCommands ( ) : string
LogEventsFromTextOutput ( string singleLine, MessageImportance messageImportance ) : void

Private Methods

Method Description
AddAdditionalFilesToCommandLine ( XSharpCommandLineBuilder commandLine ) : void

Adds a "/additionalfile:" switch to the command line for each additional file.

AddAnalyzersToCommandLine ( XSharpCommandLineBuilder commandLine, ITaskItem analyzers ) : void

Adds a "/analyzer:" switch to the command line for each provided analyzer.

AddCscCompilerCommands ( XSharpCommandLineBuilder commandLine ) : void

Mostly copied from the csc task in Roslyn

AddFeatures ( XSharpCommandLineBuilder commandLine, string features ) : void

Adds a "/features:" switch to the command line for each provided feature.

AddManagedCompilerCommands ( XSharpCommandLineBuilder cmdline ) : void

Mostly copied from the ManagedCompiler task in Roslyn

AddReferencesToCommandLine ( XSharpCommandLineBuilder commandLine, ITaskItem references, bool isInteractive = false ) : void

The C# compiler (starting with Whidbey) supports assembly aliasing for references. See spec at http://devdiv/spectool/Documents/Whidbey/VCSharp/Design%20Time/M3%20DCRs/DCR%20Assembly%20aliases.doc. This method handles the necessary work of looking at the "Aliases" attribute on the incoming "References" items, and making sure to generate the correct command-line on csc.exe. The syntax for aliasing a reference is: csc.exe /reference:Foo=System.Xml.dll The "Aliases" attribute on the "References" items is actually a comma-separated list of aliases, and if any of the aliases specified is the string "global", then we add that reference to the command-line without an alias.

AddVOCompatibilityCommands ( XSharpCommandLineBuilder commandline ) : void
ConfigureDebugProperties ( ) : void

Configure the debug switches which will be placed on the compiler command-line. The matrix of debug type and symbol inputs and the desired results is as follows: Debug Symbols DebugType Desired Results True Full /debug+ /debug:full True PdbOnly /debug+ /debug:PdbOnly True None /debug- True Blank /debug+ False Full /debug- /debug:full False PdbOnly /debug- /debug:PdbOnly False None /debug- False Blank /debug- Blank Full /debug:full Blank PdbOnly /debug:PdbOnly Blank None /debug- Debug: Blank Blank /debug+ //Microsoft.common.targets will set this Release: Blank Blank "Nothing for either switch" The logic is as follows: If debugtype is none set debugtype to empty and debugSymbols to false If debugType is blank use the debugsymbols "as is" If debug type is set, use its value and the debugsymbols value "as is"

FindXsc ( string toolName ) : string

Method Details

AddResponseFileCommands() protected method

protected AddResponseFileCommands ( Microsoft.Build.Tasks.CommandLineBuilderExtension commandLine ) : void
commandLine Microsoft.Build.Tasks.CommandLineBuilderExtension
return void

AddResponseFileCommandsImpl() protected method

protected AddResponseFileCommandsImpl ( Microsoft.Build.Tasks.CommandLineBuilderExtension cmdline ) : void
cmdline Microsoft.Build.Tasks.CommandLineBuilderExtension
return void

ExecuteTool() protected method

protected ExecuteTool ( string pathToTool, string responseFileCommands, string commandLineCommands ) : int
pathToTool string
responseFileCommands string
commandLineCommands string
return int

GenerateCommandLineCommands() protected method

protected GenerateCommandLineCommands ( ) : string
return string

GenerateFullPathToTool() protected method

protected GenerateFullPathToTool ( ) : string
return string

GenerateResponseFileCommands() protected method

protected GenerateResponseFileCommands ( ) : string
return string

LogEventsFromTextOutput() protected method

protected LogEventsFromTextOutput ( string singleLine, MessageImportance messageImportance ) : void
singleLine string
messageImportance MessageImportance
return void

Xsc() public method

public Xsc ( ) : System
return System