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