Skip to content

Commit a31e7e8

Browse files
committed
Simplify SqlClient pack version flow
1 parent 8842350 commit a31e7e8

2 files changed

Lines changed: 5 additions & 28 deletions

File tree

build.proj

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -535,35 +535,12 @@
535535
<Output TaskParameter="ConsoleOutput" PropertyName="CommitId" />
536536
</Exec>
537537

538-
<!-- Evaluate package version used to stamp the nuspec-driven pack output. -->
539-
<PropertyGroup>
540-
<GetSqlClientPackageVersionCommand>
541-
"$(DotnetPath)dotnet" build "$(SqlClientProjectPath)"
542-
-nologo
543-
-verbosity:quiet
544-
-getProperty:SqlClientPackageVersion
545-
546-
<!-- Versioning arguments -->
547-
$(BuildNumberArgument)
548-
$(BuildSuffixArgument)
549-
$(PackageVersionSqlClientArgument)
550-
</GetSqlClientPackageVersionCommand>
551-
<!-- Convert more than one whitespace character into one space -->
552-
<GetSqlClientPackageVersionCommand>$([System.Text.RegularExpressions.Regex]::Replace($(GetSqlClientPackageVersionCommand), "\s+", " "))</GetSqlClientPackageVersionCommand>
553-
</PropertyGroup>
554-
<Message Text=">>> Evaluating SqlClient package version via command: $(GetSqlClientPackageVersionCommand)" />
555-
<Exec ConsoleToMsBuild="true" Command="$(GetSqlClientPackageVersionCommand)">
556-
<Output TaskParameter="ConsoleOutput" PropertyName="_EvaluatedSqlClientPackageVersion" />
557-
</Exec>
558-
<Error Text="Failed to evaluate SqlClientPackageVersion for PackSqlClient."
559-
Condition="'$(_EvaluatedSqlClientPackageVersion)' == ''" />
560-
<Error Text="PackSqlClient requires PackageVersionAbstractions. Specify -p:PackageVersionAbstractions=&lt;version&gt;."
561-
Condition="'$(PackageVersionAbstractions)' == ''" />
562-
<Error Text="PackSqlClient requires PackageVersionLogging. Specify -p:PackageVersionLogging=&lt;version&gt;."
563-
Condition="'$(PackageVersionLogging)' == ''" />
538+
<Error Text="PackSqlClient requires PackageVersionAbstractions. Specify -p:PackageVersionAbstractions=&lt;version&gt;."
539+
Condition="'$(PackageVersionAbstractions)' == ''" />
540+
<Error Text="PackSqlClient requires PackageVersionLogging. Specify -p:PackageVersionLogging=&lt;version&gt;."
541+
Condition="'$(PackageVersionLogging)' == ''" />
564542

565543
<PropertyGroup>
566-
<_EvaluatedSqlClientPackageVersion>$([System.Text.RegularExpressions.Regex]::Replace($(_EvaluatedSqlClientPackageVersion), "\s", ""))</_EvaluatedSqlClientPackageVersion>
567544
<CommitId>$([System.Text.RegularExpressions.Regex]::Replace($(CommitId), "\s", ""))</CommitId>
568545
<DotnetCommand>
569546
"$(DotnetPath)dotnet" pack "$(SqlClientProjectPath)"
@@ -583,7 +560,6 @@
583560

584561
<!-- Pack settings are defined in Microsoft.Data.SqlClient.csproj -->
585562
-p:CommitId="$(CommitId)"
586-
-p:NuspecVersion="$(_EvaluatedSqlClientPackageVersion)"
587563
-p:PackageOutputPath="$(SqlClientArtifactRoot)/$(ReferenceType)-$(Configuration)"
588564
</DotnetCommand>
589565
<!-- Convert more than one whitespace character into one space -->

src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<SqlClientPackNuspecTemplatePath Condition="'$(SqlClientPackNuspecTemplatePath)' == ''">$(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec</SqlClientPackNuspecTemplatePath>
8383
<SqlClientPackNuspecGeneratedPath Condition="'$(SqlClientPackNuspecGeneratedPath)' == ''">$(BaseIntermediateOutputPath)Microsoft.Data.SqlClient.pack.nuspec</SqlClientPackNuspecGeneratedPath>
8484

85+
<NuspecVersion Condition="'$(NuspecVersion)' == ''">$(Version)</NuspecVersion>
8586
<NuspecFile Condition="'$(NuspecFile)' == ''">$(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec</NuspecFile>
8687
<NuspecBasePath Condition="'$(NuspecBasePath)' == ''">$([System.IO.Path]::GetDirectoryName('$(SqlClientPackNuspecTemplatePath)'))</NuspecBasePath>
8788
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>

0 commit comments

Comments
 (0)