Skip to content

Commit 1170016

Browse files
jmezachCopilot
andauthored
Add some comments to the test projects (#806)
* Add some comments to the test projects Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Updates on CONTRIBUTING.md Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Fix PR comments Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com> * Apply suggestions from code review 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 cd13b90 commit 1170016

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
2525
# Getting started
2626
In order to get started contributing code, make sure you have the following installed on your machine:
2727

28-
* .NET 6 SDK
28+
* .NET SDK (you can get it from [here](https://dotnet.microsoft.com/en-us/download))
2929
* Optionally: A local [SQL Server](https://www.microsoft.com/en-us/sql-server/sql-server-2022) (possibly as a [Docker container](https://hub.docker.com/_/microsoft-mssql-server))
3030

3131
This project is made up of a [command line tool](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/tree/master/src/DacpacTool) that does most of the heavy lifting and an [accompanying NuGet package](https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/tree/master/src/MSBuild.Sdk.SqlProj) that puts it all together. The command line tool is accompanied with a set of unit tests in the `test/DacpacTool.Tests` folder.
3232

33-
In order to test your changes on your development machine you should first run `dotnet build` from the `src/MSBuild.Sdk.SqlProj` folder. This will build the command line tool for the supported target frameworks (`net6.0`, `net7.0` as of this writing) and copy those outputs to the `src/MSBuild.Sdk.SqlProj/tools/<target-framework>` folders. You can then build any of the test projects in the `test` folder to try out your changes without having to build the SDK package and push it a NuGet package feed. This works because these projects reference the `Sdk.props` and `Sdk.targets` files directly like for example `TestProjectWithPackageReference.csproj`:
33+
In order to test your changes on your development machine you should first run `dotnet build` from the `src/MSBuild.Sdk.SqlProj` folder. This will build the command line tool for the supported target frameworks and copy those outputs to the `src/MSBuild.Sdk.SqlProj/tools/<target-framework>` folders. You can then build any of the test projects in the `test` folder to try out your changes without having to build the SDK package and push it a NuGet package feed. This works because these projects reference the `Sdk.props` and `Sdk.targets` files directly like for example `TestProjectWithPackageReference.csproj`:
3434

3535
```xml
3636
<Project>
@@ -42,7 +42,7 @@ In order to test your changes on your development machine you should first run `
4242
</Project>
4343
```
4444

45-
> Note: The `TestProjectWithSDKRef.csproj` is an exception in that it references the SDK as a NuGet package. In order to test this project locally you will need to run `dotnet pack` in the `src/MSBuild.Sdk.SqlProj` folder and push the resulting NuGet package to a NuGet feed or place it in a directory on your system somewhere and add that folder as a NuGet package source.
45+
> Note: The `TestProjectWithSDKRef.csproj` and `TestProjectWithPackageReference.csproj` are an exception in that they reference NuGet packages. Check the comments at the top of those files for instructions on how to build and test those projects locally.
4646
4747
If you want to debug your local changes, you can pass the `MSBuildSdkSqlProjDebug` property with a value of `True` on the command line using `dotnet build /p:MSBuildSdkSqlProjDebug=True` when you build any of the test projects mentioned above. This will ensure that the command line tool will wait for a debugger to attach before it will do any actual work.
4848

test/TestProjectWithPackageReference/TestProjectWithPackageReference.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
This test project is designed to test a MSBuild.Sdk.SqlProj project with a PackageReference pointing to another project build using MSBuild.Sdk.SqlProj.
3+
In order to test this functionality locally you will need to run dotnet pack from the test/TestProject folder. This creates a .nupkg in the bin folder.
4+
You can then reference this folder as a local NuGet source using dotnet nuget add source -n TestFeed <path-to-bin-folder>. Finally you will need
5+
to change the Version attribute here to match the created version.
6+
-->
17
<Project>
28
<Import Project="$(MSBuildThisFileDirectory)../../src/MSBuild.Sdk.SqlProj/Sdk/Sdk.props" />
39

test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
This test project is designed to test a MSBuild.Sdk.SqlProj project with an explicit SDK reference. In order to build this project locally you will need to first
3+
run dotnet pack from the src/MSBuild.Sdk.SqlProj folder. This will create a .nupkg file containing the SDK in the bin folder. You will then have to add this folder
4+
as local NuGet source using dotnet nuget add source -n LocalSdkFeed <path-to-bin-folder>. Finally you will need to change the SDK version below to match the created version.
5+
6+
Note: This project is automatically built as part of CI so you'll rarely need to do this locally.
7+
-->
18
<Project Sdk="MSBuild.Sdk.SqlProj/#{NBGV_NuGetPackageVersion}#">
29
<PropertyGroup>
310
<TargetFramework>net8.0</TargetFramework>

0 commit comments

Comments
 (0)