|
59 | 59 | Text="BaselinePackageVersion is required. Specify the published MDS NuGet package version to compare against, e.g.: /p:BaselinePackageVersion=6.1.4" /> |
60 | 60 | </Target> |
61 | 61 |
|
| 62 | + <!-- ================================================================== --> |
| 63 | + <!-- _CheckApiCompatToolRestored --> |
| 64 | + <!-- ================================================================== --> |
| 65 | + <Target Name="_CheckApiCompatToolRestored"> |
| 66 | + <Exec Command="dotnet tool run apicompat -- --version" |
| 67 | + WorkingDirectory="$(RepoRoot)" |
| 68 | + ConsoleToMsBuild="true" |
| 69 | + IgnoreExitCode="true"> |
| 70 | + <Output TaskParameter="ExitCode" PropertyName="_ApiCompatExitCode" /> |
| 71 | + </Exec> |
| 72 | + <Error Condition="'$(_ApiCompatExitCode)' != '0'" |
| 73 | + Text="The 'apicompat' dotnet local tool is not available. Run 'dotnet tool restore' from the repository root before running this target." /> |
| 74 | + </Target> |
| 75 | + |
62 | 76 | <!-- ================================================================== --> |
63 | 77 | <!-- _DownloadBaselinePackage --> |
64 | 78 | <!-- ================================================================== --> |
65 | | - <Target Name="_DownloadBaselinePackage" DependsOnTargets="_ValidateBaselineVersion;_SetApiCompatProperties"> |
| 79 | + <Target Name="_DownloadBaselinePackage" DependsOnTargets="_ValidateBaselineVersion;_CheckApiCompatToolRestored;_SetApiCompatProperties"> |
66 | 80 | <!-- Skip download if already extracted --> |
67 | 81 | <Message |
68 | 82 | Condition="Exists('$(BaselineExtractDir)')" |
|
90 | 104 | Text="Baseline ref assemblies available at $(BaselineExtractDir)ref\" /> |
91 | 105 | </Target> |
92 | 106 |
|
93 | | - <!-- ================================================================== --> |
94 | | - <!-- _RestoreTools --> |
95 | | - <!-- ================================================================== --> |
96 | | - <Target Name="_RestoreTools" DependsOnTargets="_SetApiCompatProperties"> |
97 | | - <Exec Command="dotnet tool restore" WorkingDirectory="$(RepoRoot)" /> |
98 | | - </Target> |
99 | | - |
100 | 107 | <!-- ================================================================== --> |
101 | 108 | <!-- _BuildRefProject --> |
102 | 109 | <!-- ================================================================== --> |
|
111 | 118 | <!-- _RunRefApiCompat --> |
112 | 119 | <!-- ================================================================== --> |
113 | 120 | <Target Name="_RunRefApiCompat" |
114 | | - DependsOnTargets="_DownloadBaselinePackage;_RestoreTools;_BuildRefProject"> |
| 121 | + DependsOnTargets="_DownloadBaselinePackage;_BuildRefProject"> |
115 | 122 |
|
116 | 123 | <!-- |
117 | 124 | For each TFM, compare the consolidated ref output against the baseline |
|
134 | 141 | Text="--- Comparing %(_RefTfm.Identity) ref vs baseline $(BaselinePackageVersion) ---" /> |
135 | 142 |
|
136 | 143 | <Exec |
137 | | - Command="dotnet apicompat -l "$(BaselineExtractDir)ref/%(_RefTfm.Identity)/Microsoft.Data.SqlClient.dll" -r "$(RefOutputDir)%(_RefTfm.Identity)/Microsoft.Data.SqlClient.dll" --strict-mode > "$(ApiCompatResultsDir)%(_RefTfm.Identity).txt" 2>&1" |
| 144 | + Command="dotnet tool run apicompat -- -l "$(BaselineExtractDir)ref/%(_RefTfm.Identity)/Microsoft.Data.SqlClient.dll" -r "$(RefOutputDir)%(_RefTfm.Identity)/Microsoft.Data.SqlClient.dll" --strict-mode > "$(ApiCompatResultsDir)%(_RefTfm.Identity).txt" 2>&1" |
138 | 145 | WorkingDirectory="$(RepoRoot)" |
139 | 146 | ContinueOnError="ErrorAndContinue" /> |
140 | 147 |
|
|
0 commit comments