diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-27 10:04:01 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-27 10:05:20 -0700 |
commit | ff20455cc888677446ba57af558e983404fa5a40 (patch) | |
tree | 0194b79744eb204c71babd9c62a6d26996c3a6fc | |
parent | 26503b8670452d59b27c36984a00c49fa0aa684a (diff) | |
download | DotNetOpenAuth-ff20455cc888677446ba57af558e983404fa5a40.zip DotNetOpenAuth-ff20455cc888677446ba57af558e983404fa5a40.tar.gz DotNetOpenAuth-ff20455cc888677446ba57af558e983404fa5a40.tar.bz2 |
Fixed sqlproj sql deployment to RelyingPartyLogic assembly.
3 files changed, 20 insertions, 7 deletions
diff --git a/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj b/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj index 18626cd..ef76d9a 100644 --- a/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj +++ b/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj @@ -21,13 +21,12 @@ <DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure> <RootNamespace>RelyingPartyDatabase</RootNamespace> <DefaultSchema>dbo</DefaultSchema> - <DeployScriptFileName>..\..\..\RelyingPartyLogic\CreateDatabase.sql</DeployScriptFileName> <PreviousProjectVersion>4.0</PreviousProjectVersion> <ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{08a938b6-ebbd-4036-880e-ce7ba2d14510}</ProjectGuid> <GenerateDatabaseFile>False</GenerateDatabaseFile> - <GenerateCreateScript>False</GenerateCreateScript> + <GenerateCreateScript>True</GenerateCreateScript> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <SqlServerVerification>False</SqlServerVerification> <TargetLanguage>CS</TargetLanguage> @@ -301,8 +300,7 @@ </ItemGroup> <ItemGroup> <SqlCmdVariable Include="Path1"> - <DefaultValue> - </DefaultValue> + <DefaultValue>Path1_Placeholder</DefaultValue> <Value>$(SqlCmdVar__1)</Value> </SqlCmdVariable> </ItemGroup> @@ -316,5 +314,8 @@ <ItemGroup> <PostDeploy Include="Scripts\Post-Deployment\Script.PostDeployment.sql" /> </ItemGroup> + <Target Name="GetDeployScriptPath" + DependsOnTargets="Build" + Outputs="$(MSBuildProjectDirectory)$(OutDir)$(MSBuildProjectName)_Create.sql" /> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> </Project>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj b/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj index bdec45b..21b866e 100644 --- a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj +++ b/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj @@ -190,7 +190,7 @@ <ProjectReference Include="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj"> <Name>RelyingPartyDatabase</Name> <!-- Deploy the latest SQL script first, so that this project can embed the latest version. --> - <Targets>Build;Deploy</Targets> + <Targets>GetDeployScriptPath</Targets> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> @@ -214,6 +214,12 @@ <Install>true</Install> </BootstrapperPackage> </ItemGroup> + <Target Name="CopySqlDeployScript"> + <MSBuild Projects="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj" Targets="GetDeployScriptPath"> + <Output TaskParameter="TargetOutputs" PropertyName="SqlDeployScriptPath"/> + </MSBuild> + <Copy SourceFiles="$(SqlDeployScriptPath)" DestinationFiles="CreateDatabase.sql" /> + </Target> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. @@ -222,5 +228,11 @@ <Target Name="AfterBuild"> </Target> --> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> + <PropertyGroup> + <PrepareResourceNamesDependsOn> + CopySqlDeployScript; + $(PrepareResourceNamesDependsOn) + </PrepareResourceNamesDependsOn> + </PropertyGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> </Project>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/Utilities.cs b/projecttemplates/RelyingPartyLogic/Utilities.cs index d273881..440dbe7 100644 --- a/projecttemplates/RelyingPartyLogic/Utilities.cs +++ b/projecttemplates/RelyingPartyLogic/Utilities.cs @@ -73,7 +73,7 @@ GO" }; foreach (string remove in removeSnippets) { schemaSqlBuilder.Replace(remove, string.Empty); } - schemaSqlBuilder.Replace("$(Path1)", HttpContext.Current.Server.MapPath("~/App_Data/")); + schemaSqlBuilder.Replace("Path1_Placeholder", HttpContext.Current.Server.MapPath("~/App_Data/")); schemaSqlBuilder.Replace("WEBROOT", databasePath); schemaSqlBuilder.Replace("$(DatabaseName)", databaseName); |