| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <Project> |
| <Import Project="$(MSBuildThisFileDirectory)/versions.props" /> |
| |
| <PropertyGroup Label="Common Versions"> |
| <!-- Read version from shared VERSION.txt file --> |
| <ProtonVersionFilePath>$(MSBuildThisFileDirectory)/VERSION.txt</ProtonVersionFilePath> |
| <ProtonVersion>$([System.IO.File]::ReadAllText($(ProtonVersionFilePath)).Trim())</ProtonVersion> |
| |
| <!-- Parse out parts of the version --> |
| <MajorVersion>$(ProtonVersion.Split('.')[0])</MajorVersion> |
| <MinorVersion>$(ProtonVersion.Split('.')[1])</MinorVersion> |
| <Patch>$(ProtonVersion.Split('-')[0].Split('.')[2])</Patch> |
| <BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber> |
| |
| <!-- Set CSPROJ version properties --> |
| <VersionPrefix>$(MajorVersion).$(MinorVersion).$(Patch)</VersionPrefix> |
| <VersionSuffix Condition="'$(VersionSuffix)' == '' AND $(ProtonVersion.Contains('-'))">$(ProtonVersion.Split('-')[1])</VersionSuffix> |
| <AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion> |
| <FileVersion>$(MajorVersion).$(MinorVersion).$(BuildNumber).0</FileVersion> |
| </PropertyGroup> |
| |
| <PropertyGroup Label="Target Frameworks"> |
| <DefaultTargetFrameworkVersion>net5.0</DefaultTargetFrameworkVersion> |
| <!-- Exe which is mainly examples for this project --> |
| <DefaultExeTargetFrameworks>$(DefaultTargetFrameworkVersion)</DefaultExeTargetFrameworks> |
| <!-- Library --> |
| <DefaultLibraryTargetFrameworks>$(DefaultTargetFrameworkVersion)</DefaultLibraryTargetFrameworks> |
| <!-- Unit Tests --> |
| <DefaultUnitTestTargetFrameworks>$(DefaultTargetFrameworkVersion)</DefaultUnitTestTargetFrameworks> |
| <!-- Rolling policies--> |
| <DefaultRollForwardPolicy>LatestMajor</DefaultRollForwardPolicy> |
| <DefaultExeRollForwardPolicy>$(DefaultRollForwardPolicy)</DefaultExeRollForwardPolicy> |
| <DefaultUnitTestsRollForwardPolicy>$(DefaultRollForwardPolicy)</DefaultUnitTestsRollForwardPolicy> |
| </PropertyGroup> |
| |
| <PropertyGroup Label="Common NuGet Properties"> |
| <!-- Reference: https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target --> |
| <Copyright>Copyright © 2022 The Apache Software Foundation.</Copyright> |
| <PackageIcon>qpid.png</PackageIcon> |
| <PackageLicenseFile>LICENSE</PackageLicenseFile> |
| <PackageReadmeFile>README.md</PackageReadmeFile> |
| <PackageProjectUrl>https://qpid.apache.org/</PackageProjectUrl> |
| <PackageTags>Qpid;Apache;AMQP;Messaging;Protocol</PackageTags> |
| <RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/apache/qpid-proton-dotnet.git</RepositoryUrl> |
| </PropertyGroup> |
| |
| <ItemGroup> |
| <None Include="$(MSBuildThisFileDirectory)\LICENSE" Pack="true" Visible="false" PackagePath=""/> |
| <None Include="$(MSBuildThisFileDirectory)\NOTICE" Pack="true" Visible="false" PackagePath=""/> |
| <None Include="$(MSBuildThisFileDirectory)\qpid.png" Pack="true" Visible="false" PackagePath=""/> |
| <None Include="README.md" Pack="true" PackagePath="\"/> |
| </ItemGroup> |
| |
| <PropertyGroup> |
| <IsTestProject Condition="'$(IsTestProject)' == ''">false</IsTestProject> |
| <IsTestProject Condition="$(MSBuildProjectName.ToLower().EndsWith('.test')) or $(MSBuildProjectName.ToLower().StartsWith('.test'))">true</IsTestProject> |
| |
| <RunAnalyzers Condition="'$(RunAnalyzers)' == ''">true</RunAnalyzers> |
| <RunAnalyzers Condition="'$(IsTestProject)' != 'true' and '$(IsSourceProject)' != 'true'">false</RunAnalyzers> |
| </PropertyGroup> |
| |
| <ItemGroup> |
| <EditorConfigFiles Condition="'$(IsTestProject)' != 'true'" Include="$(MSBuildThisFileDirectory)/CodeAnalysis.src.globalconfig" /> |
| <EditorConfigFiles Condition="'$(IsTestProject)' == 'true'" Include="$(MSBuildThisFileDirectory)/CodeAnalysis.test.globalconfig" /> |
| </ItemGroup> |
| |
| <ItemGroup Condition="'$(RunAnalyzers)' != 'false'"> |
| <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftCodeAnalysisNetAnalyzersVersion)" PrivateAssets="all" /> |
| <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="$(MicrosoftCodeAnalysisCSharpCodeStyleVersion)" PrivateAssets="all" /> |
| <PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)" PrivateAssets="all" /> |
| </ItemGroup> |
| |
| <Target Name="PrintVersionInfo"> |
| <Message Importance="high" Text="VersionPrefix: $(VersionPrefix)" /> |
| <Message Importance="high" Text="VersionSuffix: $(VersionSuffix)" /> |
| <Message Importance="high" Text="AssemblyVersion: $(AssemblyVersion)" /> |
| <Message Importance="high" Text="FileVersion: $(FileVersion)" /> |
| </Target> |
| </Project> |