Documentation ¶
Index ¶
- func ExtractBuildTarget(configuration CSharpProject) string
- func ExtractLibraryPath(configuration CSharpProject) string
- func ExtractPackageList(configuration CSharpProject) string
- func ExtractReferences(configuration CSharpProject) string
- func ExtractSourceFileList(configuration CSharpProject, sourceDirectory string) []string
- func ExtractTestBuildTarget(configuration CSharpProject) string
- func ExtractTestLibraryPath(configuration CSharpProject) string
- func ExtractTestPackageList(configuration CSharpProject) string
- func ExtractTestReferences(configuration CSharpProject) string
- func ExtractTestSourceFileList(configuration CSharpProject, sourceDirectory string) []string
- func GetFileSuffix(buildTarget string) string
- func SetTestWarningLevel(configuration CSharpProject) string
- func SetWarningLevel(configuration CSharpProject) string
- func TestTreatWarningsAsErrors(configuration CSharpProject) string
- func TreatWarningsAsErrors(configuration CSharpProject) string
- type CSharpCommand
- type CSharpProject
- type CSharpProjectBuilder
- type CSharpProjectRunner
- type CSharpTests
- type MonoCommand
- type Reference
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractBuildTarget ¶
func ExtractBuildTarget(configuration CSharpProject) string
func ExtractLibraryPath ¶
func ExtractLibraryPath(configuration CSharpProject) string
ExtractLibraryPath extracts all of the library paths provided in the configuration file and returns them as an argument item for the compiler.
func ExtractPackageList ¶
func ExtractPackageList(configuration CSharpProject) string
ExtractPackageList extracts all of the packages provided in the configuration file and returns them as an argument item for the compiler.
func ExtractReferences ¶
func ExtractReferences(configuration CSharpProject) string
ExtractReferences extracts all of the references provided in the configuration file and returns them as an argument item for the compiler.
func ExtractSourceFileList ¶
func ExtractSourceFileList(configuration CSharpProject, sourceDirectory string) []string
ExtractSourceFileList is a function that reads all of the source files to be compiled from the configuration file and returns a slice of source files to be compiled using the mcs command. Each source file has had the base path appended to it when returned from the function.
func ExtractTestBuildTarget ¶
func ExtractTestBuildTarget(configuration CSharpProject) string
func ExtractTestLibraryPath ¶
func ExtractTestLibraryPath(configuration CSharpProject) string
ExtractLibraryPath extracts all of the library paths provided in the configuration file and returns them as an argument item for the compiler.
func ExtractTestPackageList ¶
func ExtractTestPackageList(configuration CSharpProject) string
ExtractPackageList extracts all of the packages provided in the configuration file and returns them as an argument item for the compiler.
func ExtractTestReferences ¶
func ExtractTestReferences(configuration CSharpProject) string
ExtractReferences extracts all of the references provided in the configuration file and returns them as an argument item for the compiler.
func ExtractTestSourceFileList ¶
func ExtractTestSourceFileList(configuration CSharpProject, sourceDirectory string) []string
ExtractSourceFileList is a function that reads all of the source files to be compiled from the configuration file and returns a slice of source files to be compiled using the mcs command. Each source file has had the base path appended to it when returned from the function.
func GetFileSuffix ¶
GetFileSuffix is a function for determining the file suffix of the build artifact based in the provided build target.
func SetTestWarningLevel ¶
func SetTestWarningLevel(configuration CSharpProject) string
SetWarningLevel extracts the provided warning level to be used from the configuration file and returned as an argument for the compiler if one is provided.
func SetWarningLevel ¶
func SetWarningLevel(configuration CSharpProject) string
SetWarningLevel extracts the provided warning level to be used from the configuration file and returned as an argument for the compiler if one is provided.
func TestTreatWarningsAsErrors ¶
func TestTreatWarningsAsErrors(configuration CSharpProject) string
TreatWarningsAsErrors determines if the treat warnings as errors option is enabled in the configuration file. If no value is provided then the default for the compiler is used.
func TreatWarningsAsErrors ¶
func TreatWarningsAsErrors(configuration CSharpProject) string
TreatWarningsAsErrors determines if the treat warnings as errors option is enabled in the configuration file. If no value is provided then the default for the compiler is used.
Types ¶
type CSharpCommand ¶
type CSharpCommand struct { CommandName string DebugFlag string OutputFilename string SourceFiles []string BuildTarget string References string SourceDirectory string DestinationDirectory string LibraryPath string PackageList string WarningLevel string WarningsAsErrors string ReferencePaths []Reference }
CSharpCommand provides a representation of a call to the CSharp compiler command.
func GetCSharpBuildCommand ¶
func GetCSharpBuildCommand(configuration CSharpProject) CSharpCommand
BuildCommand is a function for building up a mcs command that can be used for building a CSharp project. This command is built up using the project configuration.
func GetCSharpTestBuildCommand ¶
func GetCSharpTestBuildCommand(configuration CSharpProject) CSharpCommand
BuildCommand is a function for building up a mcs command that can be used for building a CSharp project. This command is built up using the project configuration.
func NewDefaultCommand ¶
func NewDefaultCommand() CSharpCommand
NewDefaultCommand returns a CSharpCommand with some default values set.
func (CSharpCommand) GenerateArgumentList ¶
func (c CSharpCommand) GenerateArgumentList() []string
GenerateArgumentList is a method which returns a slice of strings containing the arguments to use when running the CSharp compiler command.
func (CSharpCommand) GetCommandName ¶
func (command CSharpCommand) GetCommandName() string
GetCommandName is a method on a CSharpCommand which accesses the name of the command to be run.
func (CSharpCommand) GetDestinationDirectory ¶
func (command CSharpCommand) GetDestinationDirectory() string
GetDestination is a method which returns the the destination directory where the compiler's output is going to be copied to.
func (CSharpCommand) String ¶
func (command CSharpCommand) String() string
type CSharpProject ¶
type CSharpProject struct { // The name of the project. Name string // Holds the project version number. Version string // Holds a description of the project. Description string // Holds the name of the programming language that the project is written in Language string // Holds the list of references required to build the project. References []Reference // Holds a list of all of the files to be compiled into the project. SourceFiles []string // The list of resources that are required by the built artifiact. Resources []Resource // The desired target type of the build. BuildTarget string // The name of the file to be output by the compiler. OutputFilename string // The base directory for source files. SourceDirectory string // The directory that build artifacts are going to be placed in. DestinationDirectory string LibraryPath []string // The list of packages required to build the project. PackageList []string // Used to control the level of warnings provided by the compiler. WarningLevel string // Used to indicate whether or not to treat warnings as errors. WarningsAsErrors string RunArguments []string TestProject CSharpTests }
CSharpProject is a struct for holding the information required for building or running a CSharp project. RunArguments lists any arguments that need to be passed through to project when it is run.
type CSharpProjectBuilder ¶
type CSharpProjectBuilder struct {
// contains filtered or unexported fields
}
CSharpProjectBuilder represents a class for building a CSharp project.
func New ¶
func New(command CSharpCommand, project CSharpProject) CSharpProjectBuilder
New creates a new instance of a CSharpProjectBuilder.
func NewTest ¶
func NewTest(command CSharpCommand, project CSharpProject) CSharpProjectBuilder
New creates a new instance of a CSharpProjectBuilder.
func (CSharpProjectBuilder) BuildProject ¶
func (builder CSharpProjectBuilder) BuildProject(verbose bool) error
BuildProject builds the CSharp project.
func (CSharpProjectBuilder) ExecutePostBuildTasks ¶
func (builder CSharpProjectBuilder) ExecutePostBuildTasks(verbose bool) error
ExecutePostBuildTasks performs any tasks that need to be carried out after a successful build.
func (CSharpProjectBuilder) ExecutePreBuildTasks ¶
func (builder CSharpProjectBuilder) ExecutePreBuildTasks(verbose bool) error
ExecutePreBuildTasks is used for executing any actions that need to be performed before building the project.
type CSharpProjectRunner ¶
type CSharpProjectRunner struct {
// contains filtered or unexported fields
}
func NewProjectRunner ¶
func NewProjectRunner(command MonoCommand, project CSharpProject) CSharpProjectRunner
func (CSharpProjectRunner) RunProject ¶
func (runner CSharpProjectRunner) RunProject() error
type CSharpTests ¶
type CSharpTests struct { DebugFlag string // The source files that belong to the test project. SourceFiles []string // The name of the test framework to be used. TestFrameWork string // The destination directory that the build artifacts are to be placed. DestinationDirectory string // The name of the file for the test project. OutputFilename string References []Reference // The list of resources that are required by the built artifiact. Resources []Resource LibraryPath []string PackageList []string TestRunner string RunArguments []string }
type MonoCommand ¶
MonoCommand provides a representation of a call to the mono command.
func GetCSharpRunCommand ¶
func GetCSharpRunCommand(configuration CSharpProject) MonoCommand
func GetCSharpRunTestCommand ¶
func GetCSharpRunTestCommand(configuration CSharpProject) MonoCommand
func NewDefaultMonoCommand ¶
func NewDefaultMonoCommand() MonoCommand
NewDefaultMonoCommand returns a MonoCommand with some default values set.
func (MonoCommand) GenerateArgumentList ¶
func (command MonoCommand) GenerateArgumentList() []string
GenerateArgumentList is a method which returns a slice of strings containing the arguments to use when running the mono command.
func (MonoCommand) GetCommandName ¶
func (command MonoCommand) GetCommandName() string
GetCommandName is a method which accesses the name of the command to be run.
func (MonoCommand) String ¶
func (command MonoCommand) String() string
type Reference ¶
Reference is a structure for holding information about reference in a CSharp project.
func ExtractReferencePaths ¶
func ExtractReferencePaths(configuration CSharpProject) []Reference
func ExtractTestReferencePaths ¶
func ExtractTestReferencePaths(configuration CSharpProject) []Reference