RobustHaven.Tasks (MSBuild)
This product includes the custom MSBuild tasks our team has created for internal use.
Tasks:
- FlexibleConfig.FlexibleConfigTask
- DBChangeManagement.MSBuildTask.MSSQLTask
How do you use the tasks?
This example shows how the two tasks complement one another. The FlexibleConfigTask is used to conditionally write the connection string, based on the developer's running the task. The output is written to "\MSBuild\bin\MSBuild.config".
The MSSQLTask uses the generated configuration file to rebuild the database, starting with the backup, and then executing all scripts located in the UpdateScriptLocation folder.
<Target Name="DatabaseChangesSync"> <Message Text="Creating MSBuild.config" /> <FlexibleConfig.FlexibleConfigTask Parameters="@(FlexibleConfigParameters)" BaseLineFile="$(MSBuildStartupDirectory)\MSBuild\MSBuild.config" ErrorLogFile="$(MSBuildStartupDirectory)\MSBuild\bin\Error.log" OutputFile="$(MSBuildStartupDirectory)\MSBuild\bin\MSBuild.config" /> <Message Text="Executing - Database Change Management" /> <DBChangeManagement.MSBuildTask.MSSQLTask TaskConfiguration="$(MSBuildStartupDirectory)\MSBuild\bin\MSBuild.config" EnvironmentName="Development" BackupLocation="$(MSBuildStartupDirectory)\Database\robusthavenaspnetmvc.bak" DatabaseName="robusthavenaspnetmvc" ConnectionStringKey="dbhReader" UpdateScriptsLocation="$(MSBuildStartupDirectory)\Database" /> </Target>
FlexibleConfig.FlexibleConfigTask
This task provides flexibility by conditionally merging a file. Conditions can be any valid CSharp boolean expression. In practice, this can be used to merge settings specific to a user (distributed workforce not sharing a common infrastructure) or environment(integration/QA/production).
Related Articles:
DBChangeManagement.MSBuildTask.MSSQLTask
This task provides a strategy to manage database changes during development.
Project 1
Project 2
This screenshot shows DoNotRelease keyword in the filename so that when the EnvironmentName is Production, then it will not execute.
What's included when purchased?
The download contains the product purchased and three guided labs that allow the user to gain the most benefit from the product.