Skip to content

Commit 8dacba9

Browse files
committed
Incorporate MinorVersionPrefix with multi-TFM
1 parent 478d0f9 commit 8dacba9

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

eng/build/Version.props

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<Project>
22

3+
<PropertyGroup Condition="'$(MinorVersionPrefix)' == ''">
4+
<MinorVersionPrefix Condition="'$(TargetFramework)' == 'net6.0'">6</MinorVersionPrefix>
5+
<MinorVersionPrefix Condition="'$(TargetFramework)' == 'net8.0'">8</MinorVersionPrefix>
6+
</PropertyGroup>
7+
38
<!--
49
Import the first 'Directory.Version.props' seen from project being built up.
510
This allows each directory cone to set its own versioning at the time this file needs it set.
@@ -24,13 +29,9 @@
2429
<AssemblyVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.')))).0.0</AssemblyVersion>
2530
</PropertyGroup>
2631

27-
<PropertyGroup Condition="'$(CI)' != 'true'">
28-
<!-- Constant file version for local dev. -->
29-
<FileVersion>42.42.42.4242</FileVersion>
30-
</PropertyGroup>
31-
32-
<PropertyGroup Condition="'$(CI)' == 'true'">
33-
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
32+
<PropertyGroup>
33+
<FileVersion Condition="'$(CI)' != 'true'">42.42.42.4242</FileVersion> <!-- Constant file version for local dev. -->
34+
<FileVersion Condition="'$(CI)' == 'true'">$(VersionPrefix).$(BuildNumber)</FileVersion>
3435
</PropertyGroup>
3536

3637
</Project>

eng/build/Version.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
1515
</PropertyGroup>
1616

17+
<PropertyGroup Condition="'$(MinorVersionPrefix)' != ''">
18+
<!-- Removing MinorVersionPrefix from the package version. -->
19+
<!-- NOTE: this relies on minor version being 1 digit. -->
20+
<PackageVersion>$(Version.Remove(2, $(MinorVersionPrefix.Length)))</PackageVersion>
21+
</PropertyGroup>
22+
1723
<!-- When building in Azure pipelines, update the build number. -->
1824
<!-- Specifically use '$(TF_BUILD)' and not '$(CI)' to ensure we are in Azure pipelines. -->
1925
<Target Name="UpdateAzDoBuildNumber" Condition="'$(TF_BUILD)' == 'true' AND '$(UpdateBuildNumber)' == 'true'" BeforeTargets="BeforeBuild">

src/WebJobs.Script.Grpc/WebJobs.Script.Grpc.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
5-
<PackageId>Microsoft.Azure.WebJobs.Script.Grpc</PackageId>
65
<AssemblyName>Microsoft.Azure.WebJobs.Script.Grpc</AssemblyName>
7-
<RootNamespace>Microsoft.Azure.WebJobs.Script.Grpc</RootNamespace>
6+
<PackageId>$(AssemblyName).InProc</PackageId>
87
<Ext Condition="'$(OS)' == 'Windows_NT'">bat</Ext>
98
<Ext Condition="'$(OS)' != 'Windows_NT'">sh</Ext>
109
</PropertyGroup>

src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
55
<AssemblyName>Microsoft.Azure.WebJobs.Script.WebHost</AssemblyName>
6-
<RootNamespace>Microsoft.Azure.WebJobs.Script.WebHost</RootNamespace>
7-
<PackageId>Microsoft.Azure.WebJobs.Script.WebHost.InProc</PackageId>
6+
<PackageId>$(AssemblyName).InProc</PackageId>
87
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
98
<TieredCompilation>false</TieredCompilation>
109
<NoWarn>NU5104</NoWarn>

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.1</TargetFramework>
4-
<PackageId>Microsoft.Azure.WebJobs.Script</PackageId>
54
<AssemblyName>Microsoft.Azure.WebJobs.Script</AssemblyName>
6-
<RootNamespace>Microsoft.Azure.WebJobs.Script</RootNamespace>
5+
<PackageId>$(AssemblyName).InProc</PackageId>
76
<NoWarn>NU5104</NoWarn>
87
</PropertyGroup>
98
<ItemGroup>

0 commit comments

Comments
 (0)