Use correct version number for ManagedBatchParser nuget package (#2024)

* Pass in patch version from pipeline

* Correct patch version

* Fix packaging

* Fix nuget version

* Revert nuget package changes

* Only use build ID for ManagedBatchParser

* Add back assembly version

* fix package nuspec
This commit is contained in:
Charles Gagnon
2023-04-20 16:38:27 -07:00
committed by GitHub
parent dec4f2d4b9
commit 2496e17515
3 changed files with 10 additions and 18 deletions

View File

@@ -21,24 +21,13 @@
<Major Condition="$(Major) == ''">99</Major>
<Minor Condition="$(Minor) == ''">99</Minor>
<Patch Condition="$(Patch) == ''">99</Patch>
<Build_BuildNumber Condition="'$(Build_BuildNumber)' == ''">99.99</Build_BuildNumber>
<StableRelease Condition="$(StableRelease) == ''">false</StableRelease>
<!-- AssemblyVersion should not change for non-major releases. -->
<AssemblyVersion>$(Major).0.0.0</AssemblyVersion>
<Version>$(Major).$(Minor).$(Patch).$(Revision)</Version>
<FileVersion>$(Version)</FileVersion>
<InformationalVersion>$(Version)</InformationalVersion>
<!-- AssemblyFileVersion should change for every build. -->
<!-- For preview releases, sample Version = 3.0.20221104.1-preview -->
<!-- For stable releases, sample Version = 3.0.0 -->
<VersionPrefix>$(Major).$(Minor).$(Patch).$(Revision)</VersionPrefix>
<VersionPrefix Condition="$(StableRelease.Equals('true'))">$(Major).$(Minor).0</VersionPrefix>
<VersionSuffix Condition="!$(StableRelease.Equals('true'))">preview</VersionSuffix>
<AssemblyFileVersion>$(VersionPrefix)-$(VersionSuffix)</AssemblyFileVersion>
<Version>$(VersionPrefix)</Version>
<FileVersion>$(VersionPrefix)</FileVersion>
<InformationalVersion>$(VersionPrefix)</InformationalVersion>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
<ToolsServiceTargetRuntimes>win-x64;win-x86;win-arm64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;osx-x64;osx-arm64;linux-x64;linux-arm64</ToolsServiceTargetRuntimes>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>

View File

@@ -108,11 +108,11 @@ steps:
inputs:
targetType: 'inline'
script: |
$propsFile = '$(Build.SourcesDirectory)\Directory.Build.Props'
$projectFile = '$(Build.SourcesDirectory)\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj'
$props = New-Object XML
$props.Load($propsFile)
$props.Load($projectFile)
$propGroup = $props.Project.PropertyGroup;
$versionPre = $env:Major + '.' + $env:Minor + '.'
$versionPre = $env:ManagedBatchParserMajor + '.' + $env:ManagedBatchParserMinor + '.'
if($env:StableRelease.Equals('true')) {
$version = $versionPre + '0';
} else {

View File

@@ -15,7 +15,9 @@
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<Product>Microsoft SqlTools Managed batch parser</Product>
<!-- Defaults-->
<!-- Defaults -->
<Build_BuildNumber Condition="'$(Build_BuildNumber)' == ''">99.99</Build_BuildNumber>
<StableRelease Condition="$(StableRelease) == ''">false</StableRelease>
<Major Condition="$(ManagedBatchParserMajor) != ''">$(ManagedBatchParserMajor)</Major>
<Minor Condition="$(ManagedBatchParserMinor) != ''">$(ManagedBatchParserMinor)</Minor>
@@ -32,6 +34,7 @@
<Version>$(VersionPrefix)</Version>
<FileVersion>$(VersionPrefix)</FileVersion>
<InformationalVersion>$(VersionPrefix)</InformationalVersion>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
<!-- Disable CA1852 (Seal internal types) as it depends on SrGen Tool -->
<NoWarn>$(NoWarn);CA1852</NoWarn>
</PropertyGroup>