| <!-- | |
| 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 | |
| https://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 --> | |
| <AvroVersionFilePath>$(MSBuildThisFileDirectory)/../../share/VERSION.txt</AvroVersionFilePath> | |
| <AvroVersion>$([System.IO.File]::ReadAllText($(AvroVersionFilePath)).Trim())</AvroVersion> | |
| <!-- Parse out parts of the version --> | |
| <MajorVersion>$(AvroVersion.Split('.')[0])</MajorVersion> | |
| <MinorVersion>$(AvroVersion.Split('.')[1])</MinorVersion> | |
| <Patch>$(AvroVersion.Split('-')[0].Split('.')[2])</Patch> | |
| <BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber> | |
| <!-- Set CSPROJ version properties --> | |
| <VersionPrefix>$(MajorVersion).$(MinorVersion).$(Patch)</VersionPrefix> | |
| <VersionSuffix Condition="'$(VersionSuffix)' == '' AND $(AvroVersion.Contains('-'))">$(AvroVersion.Split('-')[1])</VersionSuffix> | |
| <AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion> | |
| <FileVersion>$(MajorVersion).$(MinorVersion).$(BuildNumber).0</FileVersion> | |
| </PropertyGroup> | |
| <PropertyGroup> | |
| <LangVersion>14.0</LangVersion> | |
| </PropertyGroup> | |
| <PropertyGroup Label="Target Frameworks"> | |
| <!-- Exe --> | |
| <DefaultExeTargetFrameworks>net8.0;net9.0;net10.0</DefaultExeTargetFrameworks> | |
| <!-- Library --> | |
| <DefaultLibraryTargetFrameworks>netstandard2.0;netstandard2.1</DefaultLibraryTargetFrameworks> | |
| <!-- Unit Tests --> | |
| <DefaultUnitTestTargetFrameworks>$(DefaultExeTargetFrameworks)</DefaultUnitTestTargetFrameworks> | |
| </PropertyGroup> | |
| <PropertyGroup Label="Common NuGet Properties"> | |
| <!-- Reference: https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target --> | |
| <Copyright>Copyright © 2019 The Apache Software Foundation.</Copyright> | |
| <PackageIcon>logo.png</PackageIcon> | |
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |
| <PackageReadmeFile>README.md</PackageReadmeFile> | |
| <PackageProjectUrl>https://avro.apache.org/</PackageProjectUrl> | |
| <PackageTags>Avro;Apache;Serialization;Binary;Json;Schema</PackageTags> | |
| <RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/apache/avro.git</RepositoryUrl> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <None Include="$(MSBuildThisFileDirectory)\LICENSE" Pack="true" Visible="false" PackagePath=""/> | |
| <None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" Visible="false" PackagePath=""/> | |
| <None Include="$(MSBuildThisFileDirectory)\..\..\doc\assets\images\logo.png" Pack="true" Visible="false" PackagePath=""/> | |
| </ItemGroup> | |
| <PropertyGroup> | |
| <!-- Disable warning for EOL target frameworks --> | |
| <CheckEolTargetFramework>false</CheckEolTargetFramework> | |
| <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> | |
| </PropertyGroup> | |
| <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> |