From ce80a471fa597d0764b969876ce505244d5f1785 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Fri, 5 Jul 2024 20:43:40 +0300 Subject: [PATCH 1/3] WIP: simplify project files... --- Directory.Build.props | 59 +++++++++++++++++++ .../Microsoft.Kiota.Abstractions.csproj | 45 +------------- ...icrosoft.Kiota.Authentication.Azure.csproj | 46 +-------------- src/generated/KiotaGenerated.csproj | 5 +- src/generated/KiotaVersionGenerator.cs | 8 +-- ...rosoft.Kiota.Http.HttpClientLibrary.csproj | 50 +--------------- .../Microsoft.Kiota.Serialization.Form.csproj | 47 --------------- .../Microsoft.Kiota.Serialization.Json.csproj | 49 +-------------- ...osoft.Kiota.Serialization.Multipart.csproj | 47 +-------------- .../Microsoft.Kiota.Serialization.Text.csproj | 48 +-------------- .../Microsoft.Kiota.Abstractions.Tests.csproj | 7 +-- ...ft.Kiota.Authentication.Azure.Tests.csproj | 4 +- ....Kiota.Http.HttpClientLibrary.Tests.csproj | 10 +--- ...soft.Kiota.Serialization.Form.Tests.csproj | 7 +-- ...soft.Kiota.Serialization.Json.Tests.csproj | 6 +- ...Kiota.Serialization.Multipart.Tests.csproj | 6 +- ...soft.Kiota.Serialization.Text.Tests.csproj | 9 +-- 17 files changed, 89 insertions(+), 364 deletions(-) create mode 100644 Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..cdae7f7c --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,59 @@ + + + + + 2.0.0 + + false + false + latest + + + + + Microsoft + true + http://go.microsoft.com/fwlink/?LinkID=288890 + https://github.com/microsoft/kiota-dotnet + https://aka.ms/kiota/docs + + https://github.com/microsoft/kiota-dotnet/releases + + true + MIT + README.md + true + true + true + false + false + 35MSSharedLib1024.snk + true + $(NoWarn);NU5048;NETSDK1138 + true + true + true + + + + + false + Library + + + + + + + True + + + + + + + + + + + \ No newline at end of file diff --git a/src/abstractions/Microsoft.Kiota.Abstractions.csproj b/src/abstractions/Microsoft.Kiota.Abstractions.csproj index 41d8dbac..d66637df 100644 --- a/src/abstractions/Microsoft.Kiota.Abstractions.csproj +++ b/src/abstractions/Microsoft.Kiota.Abstractions.csproj @@ -5,45 +5,13 @@ Abstractions library for the Kiota generated SDKs in dotnet. © Microsoft Corporation. All rights reserved. Kiota Abstractions Library for dotnet - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.9.7 - - true - false - false - 35MSSharedLib1024.snk - true - latest enable - true - - - - https://github.com/microsoft/kiota-dotnet/releases - - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true + true - @@ -51,15 +19,4 @@ - - - true - - - - - True - - - diff --git a/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj b/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj index 5608d79f..e2da0510 100644 --- a/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj +++ b/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj @@ -5,45 +5,13 @@ Kiota authentication provider implementation with Azure Identity. © Microsoft Corporation. All rights reserved. Kiota Azure Identity Authentication Library for dotnet - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.1.7 - - true - true - - - false - false - 35MSSharedLib1024.snk - latest enable - true - - https://github.com/microsoft/kiota-dotnet/releases - - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true + true - @@ -52,16 +20,4 @@ - - - true - - - - - True - - - - diff --git a/src/generated/KiotaGenerated.csproj b/src/generated/KiotaGenerated.csproj index da471e4f..522f32d2 100644 --- a/src/generated/KiotaGenerated.csproj +++ b/src/generated/KiotaGenerated.csproj @@ -1,9 +1,10 @@ - + netstandard2.0 - latest true + true + false diff --git a/src/generated/KiotaVersionGenerator.cs b/src/generated/KiotaVersionGenerator.cs index 73e9a92a..2205af08 100644 --- a/src/generated/KiotaVersionGenerator.cs +++ b/src/generated/KiotaVersionGenerator.cs @@ -14,17 +14,17 @@ public void Execute(GeneratorExecutionContext context) var mainSyntaxTree = context.Compilation.SyntaxTrees .First(static x => x.HasCompilationUnitRoot); - var directory = Path.GetDirectoryName(mainSyntaxTree.FilePath); + var projectDirectory = Path.GetDirectoryName(mainSyntaxTree.FilePath); var version = "unknown"; try { XmlDocument csproj = new XmlDocument(); - csproj.Load(Path.Combine(directory, "..", "Microsoft.Kiota.Http.HttpClientLibrary.csproj")); - + projectDirectory = Path.Combine(projectDirectory, "..", "..", "..", "..", "Directory.Build.props"); + csproj.Load(projectDirectory); version = csproj.GetElementsByTagName("VersionPrefix")[0].InnerText; } catch (Exception e) { - throw new FileNotFoundException("KiotaVersionGenerator expanded in an invalid project, missing 'Microsoft.Kiota.Http.HttpClientLibrary.csproj' file.", e); + throw new FileNotFoundException($"KiotaVersionGenerator expanded in an invalid project, missing 'Directory.Build.props' file in the following directory {projectDirectory}", e); } string source = $@"// diff --git a/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj b/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj index 40d5385f..2c71e135 100644 --- a/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj +++ b/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj @@ -5,68 +5,24 @@ Kiota Http provider implementation for dotnet with HttpClient. © Microsoft Corporation. All rights reserved. Kiota Http Library for dotnet - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0;net462 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.4.3 - - true - - - false - false - 35MSSharedLib1024.snk - - https://github.com/microsoft/kiota-dotnet/releases - - true - MIT - true - README.md - latest enable - true - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true + true - - - - + + - - - true - - - - - True - - - diff --git a/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj b/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj index 599005ea..fe5843df 100644 --- a/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj +++ b/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj @@ -5,58 +5,11 @@ Kiota URI form encoded serialization provider. © Microsoft Corporation. All rights reserved. Kiota URI form encoded serialization provider. - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest enable - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.2.5 - - true true - latest - true - enable - - - false - false - 35MSSharedLib1024.snk - - https://github.com/microsoft/kiota-dotnet/releases - - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true - - - - - - true - - - - - True - - - - diff --git a/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj b/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj index 7da40bc8..232c318f 100644 --- a/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj +++ b/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj @@ -5,63 +5,18 @@ Kiota JSON serialization provider implementation with System.Text.Json. © Microsoft Corporation. All rights reserved. Kiota JSON Serialization Library for dotnet using System.Text.Json - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.3.3 - - true - true - - - false - false - 35MSSharedLib1024.snk - - https://github.com/microsoft/kiota-dotnet/releases - - latest enable - true - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138;CS1591 - - - true - - - true + true + $(NoWarn);CS1591 - - - - - - true - - - - - True - - - - diff --git a/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj b/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj index 4c649cf7..d506df65 100644 --- a/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj +++ b/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj @@ -7,55 +7,10 @@ Kiota Multipart Serialization Library for dotnet Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.1.5 - - true - true - - - false - false - 35MSSharedLib1024.snk - - https://github.com/microsoft/kiota-dotnet/releases - - latest enable - true - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true - - - - - - - - true + true - - - True - - - - diff --git a/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj b/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj index 392e86ad..d274bc15 100644 --- a/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj +++ b/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj @@ -4,57 +4,11 @@ Text/plain serialization provider implementation for Kiota based SDKs. © Microsoft Corporation. All rights reserved. Text/plain serialization Kiota library for dotnet - Microsoft netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - latest - true - http://go.microsoft.com/fwlink/?LinkID=288890 - https://github.com/microsoft/kiota-dotnet - https://aka.ms/kiota/docs - true - true - 1.2.2 - - true - false - false - 35MSSharedLib1024.snk - true - latest enable - true - - - - https://github.com/microsoft/kiota-dotnet/releases - - true - MIT - README.md - $(NoWarn);NU5048;NETSDK1138 - - - true - - - true - - - - - - - - true + true - - - True - - - - diff --git a/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj b/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj index 546eaae6..1f16c914 100644 --- a/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj +++ b/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj @@ -1,11 +1,8 @@ - + - false - net462;net8.0 - latest - Library true + net8.0;net462 diff --git a/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj b/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj index c0412b9d..1776b9b8 100644 --- a/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj +++ b/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj @@ -1,9 +1,7 @@ - + net8.0;net462 - latest - false true diff --git a/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj b/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj index 955fe9aa..e54559a2 100644 --- a/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj +++ b/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj @@ -1,13 +1,8 @@ - + net8.0;net462 - false - latest - Library - false - ..\src\35MSSharedLib1024.snk - false + true @@ -33,5 +28,4 @@ - diff --git a/tests/serialization/form/Microsoft.Kiota.Serialization.Form.Tests.csproj b/tests/serialization/form/Microsoft.Kiota.Serialization.Form.Tests.csproj index 9db87b7a..dfedea5e 100644 --- a/tests/serialization/form/Microsoft.Kiota.Serialization.Form.Tests.csproj +++ b/tests/serialization/form/Microsoft.Kiota.Serialization.Form.Tests.csproj @@ -1,11 +1,10 @@ - + net8.0;net462 - enable + true + true enable - latest - false diff --git a/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj b/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj index 5d4b4a8a..5052b270 100644 --- a/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj +++ b/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj @@ -1,10 +1,8 @@ - + net8.0;net462 - false - latest - Library + true diff --git a/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj b/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj index d049cffe..0e3a367b 100644 --- a/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj +++ b/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj @@ -1,10 +1,8 @@ - + net8.0;net462 - false - latest - Library + true diff --git a/tests/serialization/text/Microsoft.Kiota.Serialization.Text.Tests.csproj b/tests/serialization/text/Microsoft.Kiota.Serialization.Text.Tests.csproj index 814a979f..c214e2b4 100644 --- a/tests/serialization/text/Microsoft.Kiota.Serialization.Text.Tests.csproj +++ b/tests/serialization/text/Microsoft.Kiota.Serialization.Text.Tests.csproj @@ -1,13 +1,8 @@ - + net8.0;net462 - enable - latest - false - false - ..\src\35MSSharedLib1024.snk - false + true From 2f72ff2e04a8d0a6620db3d00dfdca5cf520588a Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 8 Jul 2024 10:05:32 +0300 Subject: [PATCH 2/3] Cleanup project files to use common configs --- Directory.Build.props | 3 ++- src/abstractions/Microsoft.Kiota.Abstractions.csproj | 2 -- .../azure/Microsoft.Kiota.Authentication.Azure.csproj | 2 -- src/generated/KiotaGenerated.csproj | 1 + .../httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj | 2 -- .../form/Microsoft.Kiota.Serialization.Form.csproj | 3 +-- .../json/Microsoft.Kiota.Serialization.Json.csproj | 4 +--- .../multipart/Microsoft.Kiota.Serialization.Multipart.csproj | 4 +--- .../text/Microsoft.Kiota.Serialization.Text.csproj | 4 ++-- tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj | 1 + .../azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj | 1 + .../Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj | 1 + .../json/Microsoft.Kiota.Serialization.Json.Tests.csproj | 1 + .../Microsoft.Kiota.Serialization.Multipart.Tests.csproj | 1 + 14 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index cdae7f7c..2560d736 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,11 +7,13 @@ false false latest + enable Microsoft + © Microsoft Corporation. All rights reserved. true http://go.microsoft.com/fwlink/?LinkID=288890 https://github.com/microsoft/kiota-dotnet @@ -55,5 +57,4 @@ - \ No newline at end of file diff --git a/src/abstractions/Microsoft.Kiota.Abstractions.csproj b/src/abstractions/Microsoft.Kiota.Abstractions.csproj index d66637df..999ed0c8 100644 --- a/src/abstractions/Microsoft.Kiota.Abstractions.csproj +++ b/src/abstractions/Microsoft.Kiota.Abstractions.csproj @@ -3,11 +3,9 @@ Abstractions library for the Kiota generated SDKs in dotnet. - © Microsoft Corporation. All rights reserved. Kiota Abstractions Library for dotnet netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true diff --git a/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj b/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj index e2da0510..c300e798 100644 --- a/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj +++ b/src/authentication/azure/Microsoft.Kiota.Authentication.Azure.csproj @@ -3,11 +3,9 @@ Kiota authentication provider implementation with Azure Identity. - © Microsoft Corporation. All rights reserved. Kiota Azure Identity Authentication Library for dotnet netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true diff --git a/src/generated/KiotaGenerated.csproj b/src/generated/KiotaGenerated.csproj index 522f32d2..6ed1f276 100644 --- a/src/generated/KiotaGenerated.csproj +++ b/src/generated/KiotaGenerated.csproj @@ -1,6 +1,7 @@  + Source Generator project to assembly info as source such as package version. netstandard2.0 true true diff --git a/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj b/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj index 2c71e135..21ff350b 100644 --- a/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj +++ b/src/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.csproj @@ -3,11 +3,9 @@ Kiota Http provider implementation for dotnet with HttpClient. - © Microsoft Corporation. All rights reserved. Kiota Http Library for dotnet netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0;net462 - enable true diff --git a/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj b/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj index fe5843df..554f9392 100644 --- a/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj +++ b/src/serialization/form/Microsoft.Kiota.Serialization.Form.csproj @@ -3,10 +3,9 @@ Kiota URI form encoded serialization provider. - © Microsoft Corporation. All rights reserved. Kiota URI form encoded serialization provider. + netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true diff --git a/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj b/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj index 232c318f..0a0cd3f6 100644 --- a/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj +++ b/src/serialization/json/Microsoft.Kiota.Serialization.Json.csproj @@ -3,13 +3,11 @@ Kiota JSON serialization provider implementation with System.Text.Json. - © Microsoft Corporation. All rights reserved. Kiota JSON Serialization Library for dotnet using System.Text.Json netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true - $(NoWarn);CS1591 + $(NoWarn);CS1591 diff --git a/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj b/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj index d506df65..ebaf50ca 100644 --- a/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj +++ b/src/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.csproj @@ -3,11 +3,9 @@ Kiota Multipart serialization provider implementation. - © Microsoft Corporation. All rights reserved. Kiota Multipart Serialization Library for dotnet - Microsoft + netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true diff --git a/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj b/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj index d274bc15..1dd40038 100644 --- a/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj +++ b/src/serialization/text/Microsoft.Kiota.Serialization.Text.csproj @@ -1,11 +1,11 @@ + Text/plain serialization provider implementation for Kiota based SDKs. - © Microsoft Corporation. All rights reserved. Text/plain serialization Kiota library for dotnet + netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 - enable true diff --git a/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj b/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj index 1f16c914..df8027cf 100644 --- a/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj +++ b/tests/abstractions/Microsoft.Kiota.Abstractions.Tests.csproj @@ -3,6 +3,7 @@ true net8.0;net462 + disable diff --git a/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj b/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj index 1776b9b8..da531069 100644 --- a/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj +++ b/tests/authentication/azure/Microsoft.Kiota.Authentication.Azure.Tests.csproj @@ -3,6 +3,7 @@ net8.0;net462 true + disable diff --git a/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj b/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj index e54559a2..9dd2aa46 100644 --- a/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj +++ b/tests/http/httpClient/Microsoft.Kiota.Http.HttpClientLibrary.Tests.csproj @@ -3,6 +3,7 @@ net8.0;net462 true + disable diff --git a/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj b/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj index 5052b270..0735661d 100644 --- a/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj +++ b/tests/serialization/json/Microsoft.Kiota.Serialization.Json.Tests.csproj @@ -3,6 +3,7 @@ net8.0;net462 true + disable diff --git a/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj b/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj index 0e3a367b..70a3e0ce 100644 --- a/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj +++ b/tests/serialization/multipart/Microsoft.Kiota.Serialization.Multipart.Tests.csproj @@ -3,6 +3,7 @@ net8.0;net462 true + disable From 47e64f59456c033fac7064f1df8f58599e5254c6 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 8 Jul 2024 11:03:48 +0300 Subject: [PATCH 3/3] Testing pipelines and validating artifacts --- .azure-pipelines/ci-build.yml | 20 ++++++++---------- .github/workflows/build-and-test.yml | 6 +++--- ...SharedLib1024.snk => 35MSSharedLib1024.snk | Bin Directory.Build.props | 19 +++++++---------- scripts/EnableSigning.ps1 | 8 ++++++- .../azure/35MSSharedLib1024.snk | Bin 160 -> 0 bytes src/http/httpClient/35MSSharedLib1024.snk | Bin 160 -> 0 bytes .../httpClient/Properties/AssemblyInfo.cs | 6 +++++- src/serialization/form/35MSSharedLib1024.snk | Bin 160 -> 0 bytes src/serialization/json/35MSSharedLib1024.snk | Bin 160 -> 0 bytes .../multipart/35MSSharedLib1024.snk | Bin 160 -> 0 bytes src/serialization/text/35MSSharedLib1024.snk | Bin 160 -> 0 bytes 12 files changed, 32 insertions(+), 27 deletions(-) rename src/abstractions/35MSSharedLib1024.snk => 35MSSharedLib1024.snk (100%) delete mode 100644 src/authentication/azure/35MSSharedLib1024.snk delete mode 100644 src/http/httpClient/35MSSharedLib1024.snk delete mode 100644 src/serialization/form/35MSSharedLib1024.snk delete mode 100644 src/serialization/json/35MSSharedLib1024.snk delete mode 100644 src/serialization/multipart/35MSSharedLib1024.snk delete mode 100644 src/serialization/text/35MSSharedLib1024.snk diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index a0c00a7a..92ac8087 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -12,7 +12,6 @@ pr: include: - main - variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' @@ -25,7 +24,6 @@ resources: name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release - extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates parameters: @@ -54,7 +52,7 @@ extends: inputs: targetType: filePath filePath: 'scripts\EnableSigning.ps1' - arguments: '-projectPath "$(Build.SourcesDirectory)/src/Microsoft.Kiota.Abstractions.csproj"' + arguments: '-projectPath "$(Build.SourcesDirectory)/Directory.Build.props"' pwsh: true enabled: true @@ -67,17 +65,17 @@ extends: # Build the Product project - task: DotNetCoreCLI@2 - displayName: 'Build Microsoft.Kiota.Abstractions' + displayName: 'Build projects in Microsoft.Kiota' inputs: - projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln' + projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.sln' arguments: '--configuration $(BuildConfiguration) --no-incremental' # Run the Unit test - task: DotNetCoreCLI@2 - displayName: 'Test Microsoft.Kiota.Abstractions' + displayName: 'Test projects in Microsoft.Kiota' inputs: command: test - projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln' + projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.sln' arguments: '--configuration $(BuildConfiguration) --no-build --framework net8.0' - task: EsrpCodeSigning@2 @@ -85,7 +83,7 @@ extends: inputs: ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' FolderPath: $(ProductBinPath) - Pattern: '**\*Microsoft.Kiota.Abstractions.dll' + Pattern: '**\*Microsoft.Kiota.*.dll' signConfigType: inlineSignParams UseMinimatch: true inlineOperation: | @@ -114,7 +112,7 @@ extends: FolderPath: src signConfigType: inlineSignParams UseMinimatch: true - Pattern: '**\*Microsoft.Kiota.Abstractions.dll' + Pattern: '**\*Microsoft.Kiota.*.dll' inlineOperation: | [ { @@ -156,7 +154,7 @@ extends: SessionTimeout: 20 # arguments are not parsed in DotNetCoreCLI@2 task for `pack` command, that's why we have a custom pack command here - - pwsh: dotnet pack $env:BUILD_SOURCESDIRECTORY/src/Microsoft.Kiota.Abstractions.csproj /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY --configuration $env:BUILD_CONFIGURATION + - pwsh: dotnet pack /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY --configuration $env:BUILD_CONFIGURATION env: BUILD_CONFIGURATION: $(BuildConfiguration) displayName: Dotnet pack @@ -167,7 +165,7 @@ extends: inputs: targetType: 'filePath' filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 - arguments: '-projectPath "$(Build.SourcesDirectory)/src/Microsoft.Kiota.Abstractions.csproj" -packageName "Microsoft.Kiota.Abstractions"' + arguments: '-projectPath "$(Build.SourcesDirectory)/Directory.Build.props" -packageName "Microsoft.Kiota.Abstractions"' pwsh: true - task: EsrpCodeSigning@2 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0cfda892..1e2d881f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -30,10 +30,10 @@ jobs: - name: Restore dependencies run: dotnet restore ${{ env.solutionName }} - name: Build - run: dotnet build ${{ env.solutionName }} --no-restore -c Release /p:UseSharedCompilation=false + run: dotnet build ${{ env.solutionName }} --no-restore /p:UseSharedCompilation=false - name: Test for net462 - run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release --framework net462 + run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal --framework net462 - name: Test for net8.0 and collect coverage - run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover --framework net8.0 + run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover --framework net8.0 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/src/abstractions/35MSSharedLib1024.snk b/35MSSharedLib1024.snk similarity index 100% rename from src/abstractions/35MSSharedLib1024.snk rename to 35MSSharedLib1024.snk diff --git a/Directory.Build.props b/Directory.Build.props index 2560d736..a53219f2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,15 +1,16 @@ - 2.0.0 - - false - false + + + + false + + false latest enable - Microsoft @@ -36,25 +37,21 @@ true true - false Library - - True - + + - - \ No newline at end of file diff --git a/scripts/EnableSigning.ps1 b/scripts/EnableSigning.ps1 index b17ac820..ace3bf18 100644 --- a/scripts/EnableSigning.ps1 +++ b/scripts/EnableSigning.ps1 @@ -28,6 +28,12 @@ $delaySign.'#text' = "true" $signAssembly = $doc.SelectSingleNode("//SignAssembly"); $signAssembly.'#text' = "true" +# Set the AssemblyOriginatorKeyFile to an absolute path to resolve any path resolution issues. +# Assumption: The key file is in the same directory as the project file. +$dirName = [System.IO.Path]::GetDirectoryName([System.IO.Path]::GetFullPath($projectPath)) +$assemblyOriginatorKeyFile = $doc.SelectSingleNode("//AssemblyOriginatorKeyFile"); +$assemblyOriginatorKeyFile.'#text' = Join-Path $dirName $assemblyOriginatorKeyFile.'#text' + $doc.Save($projectPath); -Write-Host "Updated the .csproj file so that we can sign the built assemblies." -ForegroundColor Green \ No newline at end of file +Write-Host "Updated the project file so that we can sign the built assemblies." -ForegroundColor Green \ No newline at end of file diff --git a/src/authentication/azure/35MSSharedLib1024.snk b/src/authentication/azure/35MSSharedLib1024.snk deleted file mode 100644 index 695f1b38774e839e5b90059bfb7f32df1dff4223..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa50098C{E+7Ye`kjtcRG*W zi8#m|)B?I?xgZ^2Sw5D;l4TxtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZ