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 |
| 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> |
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 | ac2deed | 2023-11-25 09:55:58 +0100 | [diff] [blame] | 41 | <PackageReference Include="System.ServiceModel.Primitives" Version="6.2.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"> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 49 | <!-- Check on the path --> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 50 | <Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true"> |
| 51 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 52 | </Exec> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 53 | <Exec Condition="'$(OS)' != 'Windows_NT'" Command="which thrift || true" ConsoleToMSBuild="true"> |
| 54 | <Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> |
| 55 | </Exec> |
| 56 | <!-- Check in the current directory --> |
| 57 | <CreateProperty Condition="Exists('thrift')" Value="thrift"> |
| 58 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 59 | </CreateProperty> |
| 60 | <!-- Check for the root projects output --> |
| 61 | <CreateProperty Condition="Exists('$(ProjectDir)/../../../../compiler/cpp/thrift')" Value="$(ProjectDir)/../../../../compiler/cpp/thrift"> |
| 62 | <Output TaskParameter="Value" PropertyName="PathToThrift" /> |
| 63 | </CreateProperty> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 64 | <Error Condition="!Exists('$(PathToThrift)')" Text="Thrift executable could not be found." /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 65 | <!-- Make sure the thrift version found is the same as the projects version --> |
| 66 | <Exec Command="$(PathToThrift) -version" ConsoleToMSBuild="true"> |
| 67 | <Output TaskParameter="ConsoleOutput" PropertyName="ThriftBinaryVersion" /> |
| 68 | </Exec> |
Jens Geyer | 4c7b9fd | 2021-12-04 22:48:37 +0100 | [diff] [blame] | 69 | <Error Condition="$('$(ThriftBinaryVersion)'::StartsWith('$(ThriftVersionOutput)')) == true" Text="Thrift version returned: '$(ThriftBinaryVersion)' is not equal to the projects version '$(ThriftVersionOutput)'." /> |
| 70 | <Message Importance="high" Text="Generating tests with thrift binary: '$(PathToThrift)'" /> |
Thomas | 638ffbc | 2021-03-26 22:06:05 +0900 | [diff] [blame] | 71 | <!-- Generate the thrift test files --> |
Jens Geyer | 4115e95 | 2023-11-21 23:00:01 +0100 | [diff] [blame] | 72 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./CassandraTest.thrift" /> |
| 73 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./optional_required_default.thrift" /> |
| 74 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./name_conflicts.thrift" /> |
| 75 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./../../../../test/ThriftTest.thrift" /> |
| 76 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./../../../../contrib/fb303/if/fb303.thrift" /> |
| 77 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5253.thrift" /> |
| 78 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5320.thrift" /> |
| 79 | <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net8 -r ./Thrift5382.thrift" /> |
Jens Geyer | aa0c8b3 | 2019-01-28 23:27:45 +0100 | [diff] [blame] | 80 | </Target> |
| 81 | |
| 82 | </Project> |