C# Class RunTimeCompiler.CsprojCompiler

Compiles a csproj. I should probably define an interface and access the functionality available here via ProjectReader or a similar class.
Mostrar archivo Open project: Virtual-Universe/Virtual-Universe Class Usage Examples

Public Methods

Method Description
Compile ( BasicProject project ) : void

This method compiles the project specified as parameter. It can only be used for CSharp projects, but can be modified to support some other .Net project types.

Private Methods

Method Description
GetCompilerOptions ( BasicProject project ) : string

This method is used to get the compiler options to be specified in the CompilerParameters for a CodeDomProvider. It determines the compiler options based on the settings from the csproj file.

GetOutputFilename ( BasicProject project ) : string

This method is used to get OutputAssembly settings to be specified in the CompilerParameters for a CodeDomProvider. It returns the absolute path where to place the compiled assembly.

GetOutputPath ( BasicProject project ) : string

It gets the absolute path to the output folder.

GetReferences ( BasicProject project ) : string[]

This method is used to get the list of references to be specified in the CompilerParameters for a CodeDomProvider. It should get the fully qualified names of each reference, but a simple name (with the .dll extension) may be enough in most cases. The current implementation appears to "work ok" with very simple applications but it has two problems: 1) It returns the name of the file and not the fully qualified name. 2) It assumes the name of the file is the assembly title plus the ".dll" extension. A better implementation is needed.

IsExe ( BasicProject project ) : bool

This method is used to get GenerateExecutable settings to be specified in the CompilerParameters for a CodeDomProvider. It returns true if the OutputType specified in the csproj file is winexe or exe.

ReadSourceFiles ( BasicProject project ) : string[]

The method is used to provide the source code for the CodeDomProvider. It reads the content of the source files and returns it.

Method Details

Compile() public method

This method compiles the project specified as parameter. It can only be used for CSharp projects, but can be modified to support some other .Net project types.
public Compile ( BasicProject project ) : void
project BasicProject
return void