Documentation (0.4)
Installing
- Go to the releases section and download the latest binary version
- Unzip into a directory
- Place the directory location containing the bd.bat file within your path
Setting up and Building a Simple Project
To setup a single-module project:
- Create the project directory
- Go to the root of the project directory, at create a new file called project.xml. It should looks something like:
<Project>
<GroupId>Byldan</GroupId>
<ArtifactId>Byldan.Test</ArtifactId>
<Version>1.1.0.3</Version>
<Type>library</Type>
</Project>
In the Type tag, you can use the following value: library, winexe, exe, netmodule, project
- Add your classes
- Type bd install
- Look under the target directory for the assembly file: it will be named <ArtifactId>.<Extension_Type>
To clean the directories, type "bd clean".
Using Dependencies
To use dependencies:
- Create a new project and setup your project.xml similar to the following:
<Project>
<GroupId>Byldan</GroupId>
<ArtifactId>Byldan.Test.Dependency</ArtifactId>
<Version>1.1.0.3</Version>
<Type>exe</Type>
<Dependencies>
<Dependency>
<GroupId>Byldan</GroupId>
<ArtifactId>Byldan.Test</ArtifactId>
<Version>1.1.0.3</Version>
<Type>library</Type>
</Dependency>
</Dependencies>
</Project>
If the dependency has already been installed into the GAC, then the 'Type' field should specify 'gac' instead of 'library'.
- Create your class files that use classes from the Byldan.Test assembly.
- Type bd install
- Look under the target directory for the assembly file: it will be named <ArtifactId>.<Extension_Type>
Multi-module Builds
To setup multi-module builds, go to the parent directory of your projects, and create another project.xml file:
<Project>
<GroupId>Byldan</GroupId>
<ArtifactId>Byldan.Test.Multimodule</ArtifactId>
<Version>1.1.0.3</Version>
<Type>project</Type>
<Modules>
<Module>simple-build</Module>
<Module>simple-dependency</Module>
</Modules>
</Project>
The module names should match the directories of your project. It is important that you put these in order of their dependencies. For example, simple-dependency depends on simple-build, so it should be included last.
- Type bd install (This still needs to be added to distribution)
- Look under the target directory of each project for the assembly file: it will be named <ArtifactId>.<Extension_Type>
Creating Custom Build Tasks
To create a custom build task, requires implementing the Byldan.Build.Framework.IBuildTask interface. Next add a Byldan.Build.Framework.GoalAttribute to the Execute method, specifying the goal attribute name as a parameter (in this case 'xsd').
public class XsdClassGeneratorBuildTask : IBuildTask
{
[GoalAttribute(Name = "xsd")]
public void Execute(Project project, ProjectInfo projectInfo)
{
Console.WriteLine("Executed the XSD Generator");
}
}
The project.xml file for building the custom build task would look similar to:
<Project>
<GroupId>Byldan.Build.BuildTasks</GroupId>
<ArtifactId>Byldan.Build.BuildTask.Xsd</ArtifactId>
<Version>0.4</Version>
<Type>library</Type>
<Dependencies>
<Dependency>
<GroupId>Byldan.Build</GroupId>
<ArtifactId>Byldan.Build.Framework</ArtifactId>
<Version>0.4</Version>
<Type>exe</Type>
</Dependency>
<Dependency>
<GroupId>Byldan.Build</GroupId>
<ArtifactId>Byldan.Build.Model</ArtifactId>
<Version>0.4</Version>
<Type>library</Type>
</Dependency>
</Dependencies>
</Project>
Using Custom Build Tasks
To use the custom attribute defined above, add a build task to your project.xml file. The group id and artifact id must match those defined within the project.xml file of the project assembly containing the build task implementation.
<Project>
<GroupId>Byldan.Build</GroupId>
<ArtifactId>Byldan.Build.Test</ArtifactId>
<Version>0.4</Version>
<Type>library</Type>
<BuildTasks>
<BuildTask>
<GroupId>Byldan.Build.BuildTasks</GroupId>
<ArtifactId>Byldan.Build.BuildTask.Xsd</ArtifactId>
<Version>0.4</Version>
<Goals>
<Goal>
<Name>xsd</Name>
<Phase>compile</Phase>
</Goal>
</Goals>
</BuildTask>
</BuildTasks>
</Project>
You can also execute the plugin directly without specifying it within the project.xml file.
bd <group_id>:<artifact_id>:<version>:<goal>
For example:
bd Byldan:Byldan.BuildTasks:0.2:xsd
Running FxCop
You will need to have FxCopCmd located within your path. From the directory containing the project.xml file, type:
bd fxcop:fxcop
The target of the project will contain the FxCop output file.
Using NUnit
You will need nunit-console located within your path. Within your project directory, create a directory called 'Tests'. Place your NUnit tests in this directory. From the directory containing the project.xml file, type:
bd install
Byldan will automatically compile and run the unit tests.
Signing Assemblies
Just place your snk file within the ~\.byldan directory (this directory also contains your build artifacts). Byldan will automatically pick it up and sign your project assemblies.