-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.props
90 lines (76 loc) · 4.84 KB
/
common.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!--
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>
</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>
<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=""/>
</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>