-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow sql projects to publish on build (PublishOnBuild). #286
base: master
Are you sure you want to change the base?
Conversation
This is triggered with a new msbuild property: PublishOnBuild.
@@ -302,4 +305,4 @@ | |||
</ItemGroup> | |||
<Message Importance="Low" Text="CopyDacpacFiles: @(CopyDacpacFiles)" /> | |||
</Target> | |||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I blame GitHub for this line.
cc: @jmezach |
@@ -258,6 +258,9 @@ | |||
<Delete Files="@(SqlArtifacts -> '$(TargetDir)%(Filename)%(Extension)')" /> | |||
</Target> | |||
|
|||
<!-- Allows a project to set to publish on build for their sql project (so they can deploy it on build that is if they want). --> | |||
<Target Name="PublishSqlProject" BeforeTargets="CoreCompile" DependsOnTargets="Publish" Condition="'$(PublishOnBuild)' != 'False' And '$(DeployOnPublish)' != 'False'" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Condition
here I get the feeling that it is an opt-out now, rather than an opt-in. To be honest I think this should be an opt-in.
Additionally it seems we have two separate properties that achieve the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do it with only checking PublishOnBuild
however it seems the Publish target runs when DeployOnPublish
is true
, while this might try to run the target it might not run if the user sets DeployOnPublish
to false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed DeployOnPublish
from this line. I wonder if it should also be removed from the publish target (and probably removed entirely).
How is this different from
especially since we support publish for local development only |
It allows this to be published even if the sqlproj just happens to be part of a solution where publishing those projects might fail (because they depend on runtimes for which the only supported form of publish is FDD). Also, it acts as a shortcut for when you only want to run |
I do not understand this sentence: because they depend on runtimes for which the only supported form of publish is FDD - what is FDD?
How is that very different from just
|
Framework dependent deployment (or FDD). I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old and new code snippets appear to serve similar purposes, focusing on publishing a SQL project during the build process based on certain conditions (PublishOnBuild and DeployOnPublish variables). Here’s a breakdown of the changes:
Simplification: The new code has removed the condition And '$(DeployOnPublish)' != 'False' from the PublishSqlProject target, simplifying the logic. This change suggests a streamlined approach, potentially reducing complexity and making the code easier to understand.
Functionality Retention: Both versions retain functionality related to publishing the .dacpac file to a target server after the build (Publish target).
Clarity: The removal of the additional condition in the PublishSqlProject target in the new code improves clarity by focusing directly on the PublishOnBuild condition, which may enhance maintainability and readability of the build script.
Conclusion:
The new code improves upon the old code by simplifying the condition in the PublishSqlProject target while retaining the essential functionality of publishing the .dacpac file. This change not only enhances clarity but also potentially reduces the risk of unintended logic errors, making the build script more robust and easier to manage.
This is triggered with a new msbuild property: PublishOnBuild.