Skip to content

Incorporate MinorVersionPrefix with multi-TFM #11224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: in-proc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions eng/build/Version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Project>

<PropertyGroup Condition="'$(MinorVersionPrefix)' == ''">
<MinorVersionPrefix Condition="'$(TargetFramework)' == 'net6.0'">6</MinorVersionPrefix>
<MinorVersionPrefix Condition="'$(TargetFramework)' == 'net8.0'">8</MinorVersionPrefix>
</PropertyGroup>

<!--
Import the first 'Directory.Version.props' seen from project being built up.
This allows each directory cone to set its own versioning at the time this file needs it set.
Expand All @@ -24,13 +29,9 @@
<AssemblyVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.')))).0.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' != 'true'">
<!-- Constant file version for local dev. -->
<FileVersion>42.42.42.4242</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'true'">
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
<PropertyGroup>
<FileVersion Condition="'$(CI)' != 'true'">42.42.42.4242</FileVersion> <!-- Constant file version for local dev. -->
<FileVersion Condition="'$(CI)' == 'true'">$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions eng/build/Version.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(MinorVersionPrefix)' != ''">
<!-- Removing MinorVersionPrefix from the package version. -->
<!-- NOTE: this relies on minor version being 1 digit. -->
<PackageVersion>$(Version.Remove(2, $(MinorVersionPrefix.Length)))</PackageVersion>
</PropertyGroup>

<!-- When building in Azure pipelines, update the build number. -->
<!-- Specifically use '$(TF_BUILD)' and not '$(CI)' to ensure we are in Azure pipelines. -->
<Target Name="UpdateAzDoBuildNumber" Condition="'$(TF_BUILD)' == 'true' AND '$(UpdateBuildNumber)' == 'true'" BeforeTargets="BeforeBuild">
Expand Down
3 changes: 1 addition & 2 deletions src/WebJobs.Script.Grpc/WebJobs.Script.Grpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<PackageId>Microsoft.Azure.WebJobs.Script.Grpc</PackageId>
<AssemblyName>Microsoft.Azure.WebJobs.Script.Grpc</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Script.Grpc</RootNamespace>
<PackageId>$(AssemblyName).InProc</PackageId>
<Ext Condition="'$(OS)' == 'Windows_NT'">bat</Ext>
<Ext Condition="'$(OS)' != 'Windows_NT'">sh</Ext>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<AssemblyName>Microsoft.Azure.WebJobs.Script.WebHost</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Script.WebHost</RootNamespace>
<PackageId>Microsoft.Azure.WebJobs.Script.WebHost.InProc</PackageId>
<PackageId>$(AssemblyName).InProc</PackageId>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TieredCompilation>false</TieredCompilation>
<NoWarn>NU5104</NoWarn>
Expand Down
3 changes: 1 addition & 2 deletions src/WebJobs.Script/WebJobs.Script.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PackageId>Microsoft.Azure.WebJobs.Script</PackageId>
<AssemblyName>Microsoft.Azure.WebJobs.Script</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Script</RootNamespace>
<PackageId>$(AssemblyName).InProc</PackageId>
<NoWarn>NU5104</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading