Skip to content

Commit 4e0f8e1

Browse files
committed
Add Kiota.props
1 parent 97f8b63 commit 4e0f8e1

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 &lt;LangVersion&gt;7.3&lt;/LangVersion&gt; 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 (&lt;Nullable&gt;enable&lt;/Nullable&gt;) for generated Kiota clients." />
65+
</Target>
66+
67+
</Project>

src/features/Riverside.CompilerPlatform.Features.Kiota/Riverside.CompilerPlatform.Features.Kiota.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<ProjectReference Include="$(ExtensionsDirectory)\Riverside.CompilerPlatform.Extensions\Riverside.CompilerPlatform.Extensions.csproj" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<None Include="Kiota.props" Pack="true" PackagePath="buildTransitive\$(AssemblyName).props" />
15+
<None Include="Kiota.props" Pack="true" PackagePath="build\$(AssemblyName).props" />
16+
</ItemGroup>
17+
1318
<ItemGroup>
1419
<PackageReference Include="Polyfill" Version="9.18.0">
1520
<PrivateAssets>all</PrivateAssets>

0 commit comments

Comments
 (0)