| Jens Geyer | 2f214c2 | 2025-11-13 23:24: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 |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 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> |
| 22 | <ThriftVersion>0.23.0</ThriftVersion> |
| 23 | <ThriftVersionOutput>Thrift version $(ThriftVersion)</ThriftVersionOutput> |
| 24 | <TargetFramework>net10.0</TargetFramework> |
| 25 | <LangVersion>latestMajor</LangVersion> |
| 26 | <Version>$(ThriftVersion).0</Version> |
| 27 | <AssemblyName>Thrift.Compile.net10</AssemblyName> |
| 28 | <PackageId>Thrift.Compile.net10</PackageId> |
| 29 | <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
| 30 | <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
| 31 | <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
| 32 | <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> |
| 33 | <Nullable>enable</Nullable> |
| 34 | </PropertyGroup> |
| 35 | |
| 36 | <ItemGroup> |
| 37 | <ProjectReference Include="../../../Thrift/Thrift.csproj" /> |
| 38 | </ItemGroup> |
| 39 | |
| 40 | <ItemGroup> |
| 41 | <PackageReference Include="System.ServiceModel.Primitives" Version="8.1.2" /> |
| 42 | </ItemGroup> |
| 43 | |
| 44 | <ItemGroup> |
| 45 | <PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" /> |
| 46 | </ItemGroup> |
| 47 | |
| 48 | <Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile"> |
| 49 | <CreateProperty Condition="'$(OS)' == 'Windows_NT'" Value=".exe"> |
| 50 | <Output TaskParameter="Value" PropertyName="EXECUTABLE_SUFFIX" /> |
| 51 | </CreateProperty> |
| 52 | <!-- Check on the path --> |
| 53 | <Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
| 54 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 55 | </Exec> |
| 56 | <Exec Condition="'$(OS)' != 'Windows_NT'" Command="which thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> |
| 57 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 58 | </Exec> |
| 59 | <!-- Check in the current directory --> |
| 60 | <CreateProperty Condition="Exists('thrift$(EXECUTABLE_SUFFIX)')" Value="thrift$(EXECUTABLE_SUFFIX)"> |
| 61 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 62 | </CreateProperty> |
| 63 | <!-- Check for the root projects output --> |
| 64 | <CreateProperty Condition="Exists('$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)')" Value="$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)"> |
| 65 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 66 | </CreateProperty> |
| 67 | <Error Condition="!Exists('$(PathToThrift)')" Text="Thrift executable could not be found." /> |
| 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> |
| 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)'" /> |
| 74 | <!-- Generate the thrift test files --> |
| 75 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../CassandraTest.thrift" /> |
| 76 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../optional_required_default.thrift" /> |
| 77 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../name_conflicts.thrift" /> |
| 78 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../../../../../test/ThriftTest.thrift" /> |
| 79 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../../../../../test/ExceptionStruct.thrift" /> |
| 80 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../../../../../contrib/fb303/if/fb303.thrift" /> |
| 81 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../Thrift5253.thrift" /> |
| 82 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../Thrift5320.thrift" /> |
| 83 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../Thrift5382.thrift" /> |
| 84 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net10 -r ../Thrift5795.thrift" /> |
| 85 | <!-- special options (see ticket) --> |
| 86 | <Exec Command="$(PathToThrift) -gen netstd:net10 -r ../Thrift5794.thrift" /> |
| 87 | </Target> |
| 88 | |
| 89 | </Project> |