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 | 75cf93e | 2024-02-04 14:50:37 +0100 | [diff] [blame] | 22 | <ThriftVersion>0.21.0</ThriftVersion> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 23 | <ThriftVersionOutput>Thrift version $(ThriftVersion)</ThriftVersionOutput> |
Jens Geyer | 4115e95 | 2023-11-21 23:00:01 +0100 | [diff] [blame] | 24 | <TargetFramework>net8.0</TargetFramework> |
| 25 | <LangVersion>latestMajor</LangVersion> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 26 | <Version>$(ThriftVersion).0</Version> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 27 | <AssemblyName>Thrift.PublicInterfaces.Compile.Tests</AssemblyName> |
| 28 | <PackageId>Thrift.PublicInterfaces.Compile.Tests</PackageId> |
| 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> |
| 37 | <ProjectReference Include="../../Thrift/Thrift.csproj" /> |
| 38 | </ItemGroup> |
| 39 | |
| 40 | <ItemGroup> |
Jens Geyer | 0341323 | 2024-05-01 18:49:15 +0200 | [diff] [blame] | 41 | <PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" /> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 42 | </ItemGroup> |
| 43 | |
| 44 | <ItemGroup> |
Jens Geyer | 51fc54f | 2023-02-14 23:51:16 +0100 | [diff] [blame] | 45 | <PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 46 | </ItemGroup> |
| 47 | |
| 48 | <Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile"> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 49 | <CreateProperty Condition="'$(OS)' == 'Windows_NT'" Value=".exe"> |
| 50 | <Output TaskParameter="Value" PropertyName="EXECUTABLE_SUFFIX" /> |
| 51 | </CreateProperty> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 52 | <!-- Check on the path --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 53 | <Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 54 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 55 | </Exec> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 56 | <Exec Condition="'$(OS)' != 'Windows_NT'" Command="which thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 57 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 58 | </Exec> |
| 59 | <!-- Check in the current directory --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 60 | <CreateProperty Condition="Exists('thrift$(EXECUTABLE_SUFFIX)')" Value="thrift$(EXECUTABLE_SUFFIX)"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 61 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 62 | </CreateProperty> |
| 63 | <!-- Check for the root projects output --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 64 | <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] | 65 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 66 | </CreateProperty> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 67 | <Error Condition="!Exists('$(PathToThrift)')" Text="Thrift executable could not be found." /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 68 | <!-- Make sure the thrift version found is the same as the projects version --> |
| 69 | <Exec Command="$(PathToThrift) -version" ConsoleToMSBuild="true"> |
| 70 | <Output TaskParameter="ConsoleOutput" PropertyName="ThriftBinaryVersion" /> |
| 71 | </Exec> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 72 | <Error Condition="$('$(ThriftBinaryVersion)'::StartsWith('$(ThriftVersionOutput)')) == true" Text="Thrift version returned: '$(ThriftBinaryVersion)' is not equal to the projects version '$(ThriftVersionOutput)'." /> |
| 73 | <Message Importance="high" Text="Generating tests with thrift binary: '$(PathToThrift)'" /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 74 | <!-- Generate the thrift test files --> |
Jens Geyer | 4115e95 | 2023-11-21 23:00:01 +0100 | [diff] [blame] | 75 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./CassandraTest.thrift" /> |
| 76 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./optional_required_default.thrift" /> |
| 77 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./name_conflicts.thrift" /> |
| 78 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./../../../../test/ThriftTest.thrift" /> |
| 79 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./../../../../contrib/fb303/if/fb303.thrift" /> |
| 80 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5253.thrift" /> |
| 81 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5320.thrift" /> |
| 82 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5382.thrift" /> |
Jens Geyer | 5b9ae5e | 2024-07-18 03:20:40 +0200 | [diff] [blame] | 83 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5795.thrift" /> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 84 | <!-- special options (see ticket) --> |
Jens Geyer | 4ea20aa | 2024-07-19 00:49:03 +0200 | [diff] [blame^] | 85 | <!-- wil be reacivated later |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 86 | <Exec Command="$(PathToThrift) -gen netstd -r ./Thrift5794-netstd.thrift" /> |
| 87 | <Exec Command="$(PathToThrift) -gen netstd:net6 -r ./Thrift5794-net6.thrift" /> |
Jens Geyer | 4ea20aa | 2024-07-19 00:49:03 +0200 | [diff] [blame^] | 88 | --> |
Sven Roederer | 3caf963 | 2024-07-16 14:46:18 +0200 | [diff] [blame] | 89 | <Exec Command="$(PathToThrift) -gen netstd:net8 -r ./Thrift5794-net8.thrift" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 90 | </Target> |
| 91 | |
| 92 | </Project> |