Skip to content

Commit c539e16

Browse files
jmezachCopilot
andauthored
Attempt to fix publishing in VS (#850)
* Attempt to fix publishing in VS Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Consistency Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Another attempt to fix VS publishing Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Fix publishing in VS Add test project to solution * Properly fix it now * Migrate to SLNX * Update src/MSBuild.Sdk.SqlProj/Sdk/Sdk.targets Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 261121d commit c539e16

File tree

3 files changed

+29
-81
lines changed

3 files changed

+29
-81
lines changed

MSBuild.Sdk.SqlProj.sln

Lines changed: 0 additions & 81 deletions
This file was deleted.

MSBuild.Sdk.SqlProj.slnx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Solution>
2+
<Configurations>
3+
<Platform Name="Any CPU" />
4+
<Platform Name="x64" />
5+
<Platform Name="x86" />
6+
</Configurations>
7+
<Folder Name="/Solution Items/">
8+
<File Path=".editorconfig" />
9+
<File Path=".github/workflows/main.yml" />
10+
<File Path="Directory.Build.props" />
11+
<File Path="README.md" />
12+
<File Path="version.json" />
13+
</Folder>
14+
<Folder Name="/src/">
15+
<Project Path="src/DacpacTool/DacpacTool.csproj" />
16+
<Project Path="src/MSBuild.Sdk.SqlProj/MSBuild.Sdk.SqlProj.csproj" />
17+
</Folder>
18+
<Folder Name="/test/">
19+
<Project Path="test/DacpacTool.Tests/DacpacTool.Tests.csproj" />
20+
<Project Path="test/TestProject/TestProject.csproj" />
21+
</Folder>
22+
</Solution>

src/MSBuild.Sdk.SqlProj/Sdk/Sdk.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
PostBuildEvent
5151
</CoreBuildDependsOn>
5252
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetNuSpecProperties</GenerateNuspecDependsOn>
53+
<PublishDependsOn>_PublishBuildAlternative;_PublishNoBuildAlternative</PublishDependsOn>
54+
<PublishDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(PublishDependsOn);PublishDatabase</PublishDependsOn>
5355
<PublishContainerDependsOn>$(PublishContainerDependsOn);PrepareContainer</PublishContainerDependsOn>
5456
</PropertyGroup>
5557

@@ -267,6 +269,11 @@
267269
<Delete Files="@(SqlArtifacts -> '$(TargetDir)%(Filename)%(Extension)')" />
268270
</Target>
269271

272+
<!-- This target is run when using dotnet publish / Visual Studio publish. PublishDependsOn is set above to control what happens when using Publish in Visual Studio -->
273+
<Target Name="Publish"
274+
Condition="'$(IsPublishable)' == 'true'"
275+
DependsOnTargets="$(PublishDependsOn)" />
276+
270277
<!-- Performs a publish of the .dacpac produced by build to a configurable target server -->
271278
<!-- Note: This used to contain a condition that DeployOnPublish != False. Since you now have to explicitly run the PublishDatabase target this no longer made sense. -->
272279
<Target Name="PublishDatabase" DependsOnTargets="Build">

0 commit comments

Comments
 (0)