Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
| 2 | <!-- |
| 3 | Licensed to the Apache Software Foundation(ASF) under one |
| 4 | or more contributor license agreements.See the NOTICE file |
| 5 | distributed with this work for additional information |
| 6 | regarding copyright ownership.The ASF licenses this file |
| 7 | to you under the Apache License, Version 2.0 (the |
| 8 | "License"); you may not use this file except in compliance |
| 9 | with the License. You may obtain a copy of the License at |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 10 | |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 11 | http://www.apache.org/licenses/LICENSE-2.0 |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 12 | |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 13 | Unless required by applicable law or agreed to in writing, |
| 14 | software distributed under the License is distributed on an |
| 15 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | KIND, either express or implied. See the License for the |
| 17 | specific language governing permissions and limitations |
| 18 | under the License. |
| 19 | --> |
| 20 | |
| 21 | <PropertyGroup> |
Jens Geyer | ef199cc | 2024-09-03 01:28:31 +0200 | [diff] [blame] | 22 | <ThriftVersion>0.22.0</ThriftVersion> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 23 | <ThriftVersionOutput>Thrift version $(ThriftVersion)</ThriftVersionOutput> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 24 | <TargetFramework>net6.0</TargetFramework> |
Jens Geyer | 4115e95 | 2023-11-21 23:00:01 +0100 | [diff] [blame] | 25 | <LangVersion>latestMajor</LangVersion> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 26 | <Version>$(ThriftVersion).0</Version> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 27 | <AssemblyName>Thrift.Compile.net6</AssemblyName> |
| 28 | <PackageId>Thrift.Compile.net6</PackageId> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 29 | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
| 30 | <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
| 31 | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
| 32 | <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> |
Jens Geyer | 98a2325 | 2022-01-09 16:50:52 +0100 | [diff] [blame] | 33 | <Nullable>enable</Nullable> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 34 | </PropertyGroup> |
| 35 | |
| 36 | <ItemGroup> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 37 | <ProjectReference Include="../../../Thrift/Thrift.csproj" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 38 | </ItemGroup> |
| 39 | |
| 40 | <ItemGroup> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 41 | <PackageReference Include="System.Formats.Asn1" Version="6.0.1" /> |
| 42 | <PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.4" /> |
| 43 | <PackageReference Include="System.ServiceModel.Primitives" Version="6.0.0" /> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 44 | </ItemGroup> |
| 45 | |
| 46 | <ItemGroup> |
Jens Geyer | 51fc54f | 2023-02-14 23:51:16 +0100 | [diff] [blame] | 47 | <PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 48 | </ItemGroup> |
| 49 | |
| 50 | <Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile"> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 51 | <CreateProperty Condition="'$(OS)' == 'Windows_NT'" Value=".exe"> |
| 52 | <Output TaskParameter="Value" PropertyName="EXECUTABLE_SUFFIX" /> |
| 53 | </CreateProperty> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 54 | <!-- Check on the path --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 55 | <Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 56 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 57 | </Exec> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 58 | <Exec Condition="'$(OS)' != 'Windows_NT'" Command="which thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 59 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 60 | </Exec> |
| 61 | <!-- Check in the current directory --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 62 | <CreateProperty Condition="Exists('thrift$(EXECUTABLE_SUFFIX)')" Value="thrift$(EXECUTABLE_SUFFIX)"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 63 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 64 | </CreateProperty> |
| 65 | <!-- Check for the root projects output --> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 66 | <CreateProperty Condition="Exists('$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)')" Value="$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 67 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 68 | </CreateProperty> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 69 | <Error Condition="!Exists('$(PathToThrift)')" Text="Thrift executable could not be found." /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 70 | <!-- Make sure the thrift version found is the same as the projects version --> |
| 71 | <Exec Command="$(PathToThrift) -version" ConsoleToMSBuild="true"> |
| 72 | <Output TaskParameter="ConsoleOutput" PropertyName="ThriftBinaryVersion" /> |
| 73 | </Exec> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 74 | <Error Condition="$('$(ThriftBinaryVersion)'::StartsWith('$(ThriftVersionOutput)')) == true" Text="Thrift version returned: '$(ThriftBinaryVersion)' is not equal to the projects version '$(ThriftVersionOutput)'." /> |
| 75 | <Message Importance="high" Text="Generating tests with thrift binary: '$(PathToThrift)'" /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 76 | <!-- Generate the thrift test files --> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 77 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../CassandraTest.thrift" /> |
| 78 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../optional_required_default.thrift" /> |
| 79 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../name_conflicts.thrift" /> |
| 80 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../../../../../test/ThriftTest.thrift" /> |
| 81 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../../../../../contrib/fb303/if/fb303.thrift" /> |
| 82 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5253.thrift" /> |
| 83 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5320.thrift" /> |
| 84 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5382.thrift" /> |
| 85 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5795.thrift" /> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 86 | <!-- special options (see ticket) --> |
Jens Geyer | 0f0e11f | 2024-07-19 00:44:43 +0200 | [diff] [blame] | 87 | <Exec Command="$(PathToThrift) -gen netstd:net6 -r ../Thrift5794.thrift" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 88 | </Target> |
| 89 | |
| 90 | </Project> |