blob: 0a9cf2d7afe1c51ef135964dac63d0901d23eda1 [file] [log] [blame]
<!--
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>
<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 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>
<PackageIconUrl>https://avro.apache.org/images/avro-logo.png</PackageIconUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<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=""/>
</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>