Last active
November 15, 2022 23:05
-
-
Save mitchelldavis/11408922 to your computer and use it in GitHub Desktop.
Some MSBuild Scripts for Liquibase and MS Sql.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | |
<PropertyGroup> | |
<Liquibase_Common_Targets>true</Liquibase_Common_Targets> | |
<sqljdbcDriver Condition=" '$(sqljdbcDriver)' == '' ">..\Dependencies\sqljdbc_4.0\enu\sqljdbc4.jar</sqljdbcDriver> | |
<Server Condition=" '$(Server)' == '' ">localhost</Server> | |
<Database Condition=" '$(Database)' == '' "></Database> | |
<Username Condition=" '$(Username)' == '' "></Username> | |
<Password Condition=" '$(Password)' == '' "></Password> | |
<ChangeLogFile Condition=" '$(ChangeLogFile)' == '' "></ChangeLogFile> | |
<UseIS Condition=" '$(UseIS)' == '' ">true</UseIS> | |
<x86Java Condition=" '$(x86Java)' == '' ">true</x86Java> | |
<Development Condition=" '$(Development)' == '' ">true</Development> | |
<Tag Condition=" '$(Tag)' == '' ">$([System.DateTime]::Now.ToString("yyyy-MM-dd hh:mm:ss.fff"))</Tag> | |
<RollbackToDate Condition=" '$(RollbackToDate)' == '' ">$(Tag)</RollbackToDate> | |
<RollbackCount Condition=" '$(RollbackCount)' == '' ">0</RollbackCount> | |
</PropertyGroup> | |
<ItemGroup> | |
<LiquibaseJar Include="..\Dependencies\liquibase\liquibase.jar" /> | |
<sqljdbcAuth Include="..\Dependencies\sqljdbc_4.0\enu\auth\x86" Condition=" '$(x86Java)' == 'true' " /> | |
<sqljdbcAuth Include="..\Dependencies\sqljdbc_4.0\enu\auth\x64" Condition=" '$(x86Java)' == 'false' " /> | |
<PesterBat Include="..\packages\Pester\tools\bin\Pester.bat"/> | |
<ChangeLogFile Include="$(ChangeLogFile)" Condition=" '$(ChangeLogFile)' != '' "/> | |
</ItemGroup> | |
<Target Name="Validate"> | |
<Error Text="You must supply the path to the sqljdbc driver: /P:sqljdbcDriver<Path to Driver>" | |
Condition=" '$(sqljdbcDriver)' == '' " /> | |
<Error Text="You must supply the url of the Server to deploy to: /P:Server<Server url>" | |
Condition=" '$(Server)' == '' " /> | |
<Error Text="You must supply the name of the database to deploy to: /P:Database<Database to deploy to>" | |
Condition=" '$(Database)' == '' " /> | |
<Error Text="You must supply the username to use to log into the database: /P:Username<Username to use>" | |
Condition=" '$(Username)' == '' AND '$(UseIS)' == 'false' " /> | |
<Error Text="You must supply the password to use to log into the database: /P:Password<Password to use>" | |
Condition=" '$(Password)' == '' AND '$(UseIS)' == 'false' " /> | |
<Error Text="You must supply an ChangeLogFile item." | |
Condition=" '@(ChangeLogFile -> '%(Identity)', ' ')' == '' " /> | |
<Error Text="The Change Log File you supplied (%(FullPath)) was not found. Please make sure you supply a change log file that exists." | |
Condition="!Exists(%(ChangeLogFile.FullPath)) AND '$(ChangeLogFile)' == '' " /> | |
<Error Text="The Liquibase jar file was not found. It is expected to be at (%(LiquibaseJar.Identity))." | |
Condition="!Exists(%(LiquibaseJar.Identity))" /> | |
<Error Text="The location of the sqljdbcAuth dll was not found. It is expected to be at (%(sqljdbcAuth.Identity))." | |
Condition=" !Exists(%(sqljdbcAuth.Identity)) " /> | |
<Message Text="Build Validation successful. Good to go..." /> | |
</Target> | |
<Target Name="CreateDatabase" Condition=" '$(Development)' == 'true' " DependsOnTargets="_ResolveDependencyPackages;RunPesterTests"> | |
<CreateDatabaseTask ScriptsDirectory="$(MSBuildThisFileDirectory)\Scripts" Server="$(Server)" Database="$(Database)"/> | |
</Target> | |
<Target Name="DropDatabase" Condition=" '$(Development)' == 'true' " DependsOnTargets="_ResolveDependencyPackages;RunPesterTests"> | |
<DropDatabaseTask ScriptsDirectory="$(MSBuildThisFileDirectory)\Scripts" Server="$(Server)" Database="$(Database)"/> | |
</Target> | |
<Target Name="RunPesterTests" DependsOnTargets="_ResolveDependencyPackages;"> | |
<ItemGroup> | |
<execute Include="powershell -NonInteractive -NoProfile -ExecutionPolicy unrestricted -command ""/> | |
<execute Include="Import-Module '$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\packages\Pester\tools\Pester.psm1))'%3B"/> | |
<execute Include="Invoke-Pester -relative_path '$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)Scripts))' -EnableExit;" /> | |
<execute Include="""/> | |
</ItemGroup> | |
<Exec Command="@(execute -> '%(Identity)', '')" CustomErrorRegularExpression="\[-\]"/> | |
</Target> | |
<Target Name="UpdateTestingRollback" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="updateTestingRollback"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="Update" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="update"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="Status" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="status"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="ClearCheckSums" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="clearCheckSums"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="ChangeLogSync" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="changeLogSync"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="TagDatabase" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="tag "$(Tag)""/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="Rollback" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="rollback "$(Tag)""/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="RollbackToDate" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="rollbackToDate "$(RollbackToDate)""/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="RollbackCount" DependsOnTargets="Validate;CreateDatabase"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=INFO" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="rollbackCount $(RollbackCount)"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="ExtractFromDatabase" DependsOnTargets="Validate"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=WARNING" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="generateChangeLog"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -Xmx1000m -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="ExportData" DependsOnTargets="Validate"> | |
<ItemGroup> | |
<executable Include="liquibase.integration.commandline.Main" /> | |
<executable Include="--changeLogFile=%(ChangeLogFile.Identity)"/> | |
<executable Include="--classpath=$(sqljdbcDriver)"/> | |
<executable Include="--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver"/> | |
<executable Include="--logLevel=WARNING" /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BUsername=$(Username)%3BPassword=$(Password);"" | |
Condition=" '$(UseIS)' == 'false' " /> | |
<executable Include=""--url=jdbc:sqlserver://$(Server)%3BdatabaseName=$(Database)%3BintegratedSecurity=true;"" | |
Condition=" '$(UseIS)' == 'true' " /> | |
<executable Include="--diffTypes="data""/> | |
<executable Include="generateChangeLog"/> | |
</ItemGroup> | |
<ItemGroup> | |
<executableProperties Include="java.library.path=%(sqljdbcAuth.FullPath)" /> | |
<executableProperties Include="$(ChangeLogProperties)" | |
Condition=" '$(ChangeLogProperties)' != '' "/> | |
</ItemGroup> | |
<Exec Command="java -Xmx1000m -cp %(LiquibaseJar.Identity) @(executableProperties -> '"-D%(Identity)"', ' ') @(executable,' ')" | |
CustomErrorRegularExpression="SEVERE" /> | |
</Target> | |
<Target Name="CleanDatabase" DependsOnTargets="Validate;DropDatabase" /> | |
<Target Name="Build" DependsOnTargets="UpdateTestingRollback"/> | |
<Target Name="Clean" DependsOnTargets="CleanDatabase"/> | |
<Target Name="Rebuild" DependsOnTargets="Clean;Build"/> | |
<Import Project="$(MSBuildThisFileDirectory)\NuGet.targets" Condition=" '$(NuGet_Targets)' == '' " /> | |
<Import Project="$(MSBuildThisFileDirectory)\Liquibase.Common.tasks"/> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project InitialTargets="" DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | |
<PropertyGroup> | |
<AssemblyFile>$(MSBuildThisFileDirectory)\..\packages\MSBuild.Extension.Pack\tools\net40\MSBuild.ExtensionPack.TaskFactory.PowerShell.dll</AssemblyFile> | |
</PropertyGroup> | |
<UsingTask TaskFactory="PowershellTaskFactory" TaskName="CreateDatabaseTask" AssemblyFile="$(AssemblyFile)"> | |
<ParameterGroup> | |
<ScriptsDirectory Required="true" ParameterType="System.String" /> | |
<Server Required="true" ParameterType="System.String" /> | |
<Database Required="true" ParameterType="System.String" /> | |
</ParameterGroup> | |
<Task> | |
<![CDATA[ | |
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"normal", "Loading required Scripts...") | |
. (join-path $ScriptsDirectory "DoesDatabaseExist.ps1") | |
. (join-path $ScriptsDirectory "CreateDatabase.ps1") | |
if(-Not (DoesDatabaseExist $Server $Database)) | |
{ | |
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"normal", "Creating {0} on {1}", $Database, $Server) | |
CreateDatabase $Server $Database | |
} | |
else | |
{ | |
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"normal", "{0} already exists on {1}. Skipping...", $Database, $Server) | |
} | |
]]> | |
</Task> | |
</UsingTask> | |
<UsingTask TaskFactory="PowershellTaskFactory" TaskName="DropDatabaseTask" AssemblyFile="$(AssemblyFile)"> | |
<ParameterGroup> | |
<ScriptsDirectory Required="true" ParameterType="System.String" /> | |
<Server Required="true" ParameterType="System.String" /> | |
<Database Required="true" ParameterType="System.String" /> | |
</ParameterGroup> | |
<Task> | |
<![CDATA[ | |
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"normal", "Loading required Scripts...") | |
. (join-path $ScriptsDirectory "DoesDatabaseExist.ps1") | |
. (join-path $ScriptsDirectory "DropDatabase.ps1") | |
if(DoesDatabaseExist $Server $Database) | |
{ | |
$log.LogMessage([Microsoft.Build.Framework.MessageImportance]"normal", "{0} does exist, dropping...", $Database) | |
DropDatabase $Server $Database | |
} | |
]]> | |
</Task> | |
</UsingTask> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment