|
12 | 12 | <!-- dotnet binary in the PATH variable. The provided path should end with a `\` (or --> |
13 | 13 | <!-- `/`) character. Eg. C:\x86\ --> |
14 | 14 | <DotnetPath Condition="'$(DotnetPath)' == ''" /> |
| 15 | + |
| 16 | + <!-- NugetPath: Path to folder containing `nuget` binary. Override this if a specific --> |
| 17 | + <!-- version is required. Othrwise, this defaults to the `nuget` binary in the PATH --> |
| 18 | + <!-- variable. The provided path should end with a `\` (or `/` character. Eg, --> |
| 19 | + <!-- `C:\x86\`. In majority of cases, this is not necessary. --> |
| 20 | + <!-- This argument is only used in Pack* targets --> |
| 21 | + <NugetPath Condition="'$(NugetPath)' == ''" /> |
15 | 22 | </PropertyGroup> |
16 | 23 |
|
17 | 24 | <!-- Imports ======================================================= --> |
|
20 | 27 | <!-- =============================================================== --> |
21 | 28 | <!-- Microsoft.Data.SqlClient Build Targets --> |
22 | 29 | <PropertyGroup> |
23 | | - <MdsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj</MdsProjectPath> |
| 30 | + <MdsNuspecPath>$(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec</MdsNuspecPath> |
| 31 | + <MdsProjectPath>$(RepoRoot)src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj</MdsProjectPath> |
24 | 32 | </PropertyGroup> |
25 | 33 |
|
26 | 34 | <!-- BuildMds: Builds all binaries for MDS --> |
|
58 | 66 |
|
59 | 67 | <!-- PackMds: Packages MDS binaries into a NuGet package --> |
60 | 68 | <Target Name="PackMds"> |
61 | | - <!-- @TODO --> |
| 69 | + <PropertyGroup> |
| 70 | + <GitCommand> |
| 71 | + git rev-parse HEAD |
| 72 | + </GitCommand> |
| 73 | + </PropertyGroup> |
| 74 | + <Message Text=">>> Fetching git commit hash via command: $(GitCommand)" /> |
| 75 | + <Exec Command="$(GitCommand)" ConsoleToMsBuild="true"> |
| 76 | + <Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" /> |
| 77 | + </Exec> |
| 78 | + |
| 79 | + <PropertyGroup> |
| 80 | + <NugetCommand> |
| 81 | + $(NugetPath)nuget pack $(MdsNuspecPath) |
| 82 | + -OutputDirectory $ @TODO: |
| 83 | + -Version $(MdsPackageVersion) |
| 84 | + -Properties "COMMITID=$(CommitHash);Configuration=$(Configuration);" |
| 85 | + -Symbols |
| 86 | + -SymbolPackageFormat snupkg |
| 87 | + </NugetCommand> |
| 88 | + <!-- Convert more than one whitespace character into one space --> |
| 89 | + <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> |
| 90 | + </PropertyGroup> |
| 91 | + <Message Text=">>> Packageing MDS via command: $(NugetCommand)" /> |
| 92 | + <Exec ConsoleToMsBuild="true" Command="$(NugetCommand)" /> |
62 | 93 | </Target> |
63 | 94 |
|
64 | 95 | <!-- TestMds: Runs all test projects for MDS --> |
|
0 commit comments