|
| 1 | +<Project> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <Kiota_MinLangVersion>7.3</Kiota_MinLangVersion> |
| 5 | + <Kiota_AuthPackageVersion>1.21.2</Kiota_AuthPackageVersion> |
| 6 | + <Kiota_BundlePackageVersion>1.21.2</Kiota_BundlePackageVersion> |
| 7 | + </PropertyGroup> |
| 8 | + |
| 9 | + <Target Name="Kiota_EnsureDependencies" BeforeTargets="CollectPackageReferences"> |
| 10 | + <ItemGroup> |
| 11 | + <PackageReference |
| 12 | + Include="Microsoft.Kiota.Authentication.Azure" |
| 13 | + Version="$(Kiota_AuthPackageVersion)" |
| 14 | + Condition="'@(PackageReference->WithMetadataValue('Identity', 'Microsoft.Kiota.Authentication.Azure'))' == ''" /> |
| 15 | + <PackageReference |
| 16 | + Include="Microsoft.Kiota.Bundle" |
| 17 | + Version="$(Kiota_BundlePackageVersion)" |
| 18 | + Condition="'@(PackageReference->WithMetadataValue('Identity', 'Microsoft.Kiota.Bundle'))' == ''" /> |
| 19 | + </ItemGroup> |
| 20 | + </Target> |
| 21 | + |
| 22 | + <Target Name="Kiota_ValidateLanguageAndFramework" BeforeTargets="CoreCompile"> |
| 23 | + <ItemGroup> |
| 24 | + <_Kiota_TargetFramework Include="$(TargetFramework)" Condition="'$(TargetFramework)' != ''" /> |
| 25 | + <_Kiota_TargetFramework Include="$(TargetFrameworks)" Condition="'$(TargetFrameworks)' != ''" /> |
| 26 | + <_Kiota_InvalidFramework Include="@(_Kiota_TargetFramework)" |
| 27 | + Condition="!$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', '^netstandard2\.(0|1)$|^net462$|^net([8-9]|[1-9][0-9])(?:\.[0-9]+)?(?:[-.].*)?$'))" /> |
| 28 | + </ItemGroup> |
| 29 | + |
| 30 | + <Error |
| 31 | + Condition="'$(LangVersion)' == ''" |
| 32 | + Code="KG1001" |
| 33 | + Text="Riverside Kiota requires C# LangVersion 7.3 or later. Set <LangVersion>7.3</LangVersion> or newer." /> |
| 34 | + |
| 35 | + <Error |
| 36 | + Condition=" |
| 37 | + '$(LangVersion)' != '' |
| 38 | + and !($([System.String]::Copy('$(LangVersion)').Equals('latest', System.StringComparison.OrdinalIgnoreCase))) |
| 39 | + and !($([System.String]::Copy('$(LangVersion)').Equals('latestmajor', System.StringComparison.OrdinalIgnoreCase))) |
| 40 | + and !($([System.String]::Copy('$(LangVersion)').Equals('preview', System.StringComparison.OrdinalIgnoreCase))) |
| 41 | + and $([System.Text.RegularExpressions.Regex]::IsMatch('$(LangVersion)', '^[0-9]+(\.[0-9]+)?$')) |
| 42 | + and !$([MSBuild]::VersionGreaterThanOrEquals('$(LangVersion)', '$(Kiota_MinLangVersion)'))" |
| 43 | + Code="KG1002" |
| 44 | + Text="The Advanced Compiler Services for .NET library requires C# 7.3 or later. The current language version is '$(LangVersion)'." /> |
| 45 | + |
| 46 | + <Error |
| 47 | + Condition=" |
| 48 | + '$(LangVersion)' != '' |
| 49 | + and !($([System.String]::Copy('$(LangVersion)').Equals('latest', System.StringComparison.OrdinalIgnoreCase))) |
| 50 | + and !($([System.String]::Copy('$(LangVersion)').Equals('latestmajor', System.StringComparison.OrdinalIgnoreCase))) |
| 51 | + and !($([System.String]::Copy('$(LangVersion)').Equals('preview', System.StringComparison.OrdinalIgnoreCase))) |
| 52 | + and !$([System.Text.RegularExpressions.Regex]::IsMatch('$(LangVersion)', '^[0-9]+(\.[0-9]+)?$'))" |
| 53 | + Code="KG1003" |
| 54 | + Text="The Advanced Compiler Services for .NET library requires C# 7.3 or later. Unsupported LangVersion value '$(LangVersion)'." /> |
| 55 | + |
| 56 | + <Error |
| 57 | + Condition="'@(_Kiota_InvalidFramework)' != ''" |
| 58 | + Code="KG1004" |
| 59 | + Text="The Advanced Compiler Services for .NET library supports only netstandard2.0, netstandard2.1, net462, and net8.0 or later. Invalid target framework(s): @(_Kiota_InvalidFramework, ', ')." /> |
| 60 | + |
| 61 | + <Warning |
| 62 | + Condition="'$(Nullable)' == '' or $([System.String]::Copy('$(Nullable)').Equals('disable', System.StringComparison.OrdinalIgnoreCase))" |
| 63 | + Code="KG2001" |
| 64 | + Text="Nullable is disabled. Consider enabling nullable reference types (<Nullable>enable</Nullable>) for generated Kiota clients." /> |
| 65 | + </Target> |
| 66 | + |
| 67 | +</Project> |
0 commit comments