Skip to content

Commit 965b277

Browse files
authored
Merge pull request #262 from microsoft/andrueastman/monoRepoMigration
Kiota Dotnet Mono repo migration
2 parents 95bc067 + 08090db commit 965b277

222 files changed

Lines changed: 12650 additions & 625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure-pipelines/ci-build.yml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ pr:
1212
include:
1313
- main
1414

15-
1615
variables:
1716
buildPlatform: 'Any CPU'
1817
buildConfiguration: 'Release'
19-
ProductBinPath: '$(Build.SourcesDirectory)\src\bin\$(BuildConfiguration)'
2018

2119
resources:
2220
repositories:
@@ -25,7 +23,6 @@ resources:
2523
name: 1ESPipelineTemplates/1ESPipelineTemplates
2624
ref: refs/tags/release
2725

28-
2926
extends:
3027
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
3128
parameters:
@@ -54,10 +51,19 @@ extends:
5451
inputs:
5552
targetType: filePath
5653
filePath: 'scripts\EnableSigning.ps1'
57-
arguments: '-projectPath "$(Build.SourcesDirectory)/src/Microsoft.Kiota.Abstractions.csproj"'
54+
arguments: '-projectPath "$(Build.SourcesDirectory)/Directory.Build.props"'
5855
pwsh: true
5956
enabled: true
60-
57+
58+
- task: PowerShell@2
59+
displayName: 'Validate project version has been incremented'
60+
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded())
61+
inputs:
62+
targetType: 'filePath'
63+
filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1
64+
arguments: '-projectPath "$(Build.SourcesDirectory)/Directory.Build.props" -packageName "Microsoft.Kiota.Abstractions"'
65+
pwsh: true
66+
6167
# Install the nuget tool.
6268
- task: NuGetToolInstaller@1
6369
displayName: 'Install Nuget dependency manager'
@@ -67,25 +73,25 @@ extends:
6773

6874
# Build the Product project
6975
- task: DotNetCoreCLI@2
70-
displayName: 'Build Microsoft.Kiota.Abstractions'
76+
displayName: 'Build projects in Microsoft.Kiota'
7177
inputs:
72-
projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln'
78+
projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.sln'
7379
arguments: '--configuration $(BuildConfiguration) --no-incremental'
7480

7581
# Run the Unit test
7682
- task: DotNetCoreCLI@2
77-
displayName: 'Test Microsoft.Kiota.Abstractions'
83+
displayName: 'Test projects in Microsoft.Kiota'
7884
inputs:
7985
command: test
80-
projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln'
86+
projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.sln'
8187
arguments: '--configuration $(BuildConfiguration) --no-build --framework net8.0'
8288

83-
- task: EsrpCodeSigning@2
89+
- task: EsrpCodeSigning@3
8490
displayName: 'ESRP DLL Strong Name'
8591
inputs:
8692
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
87-
FolderPath: $(ProductBinPath)
88-
Pattern: '**\*Microsoft.Kiota.Abstractions.dll'
93+
FolderPath: src # This path should already omit test dlls as they exist in the `tests` folder
94+
Pattern: '**\*Microsoft.Kiota.*.dll'
8995
signConfigType: inlineSignParams
9096
UseMinimatch: true
9197
inlineOperation: |
@@ -107,14 +113,14 @@ extends:
107113
]
108114
SessionTimeout: 20
109115

110-
- task: EsrpCodeSigning@2
116+
- task: EsrpCodeSigning@3
111117
displayName: 'ESRP DLL CodeSigning'
112118
inputs:
113119
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
114-
FolderPath: src
120+
FolderPath: src # This path should already omit test dlls as they exist in the `tests` folder
115121
signConfigType: inlineSignParams
116122
UseMinimatch: true
117-
Pattern: '**\*Microsoft.Kiota.Abstractions.dll'
123+
Pattern: '**\*Microsoft.Kiota.*.dll'
118124
inlineOperation: |
119125
[
120126
{
@@ -156,21 +162,12 @@ extends:
156162
SessionTimeout: 20
157163

158164
# arguments are not parsed in DotNetCoreCLI@2 task for `pack` command, that's why we have a custom pack command here
159-
- 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
165+
- pwsh: dotnet pack /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY --configuration $env:BUILD_CONFIGURATION
160166
env:
161167
BUILD_CONFIGURATION: $(BuildConfiguration)
162168
displayName: Dotnet pack
163169

164-
- task: PowerShell@2
165-
displayName: 'Validate project version has been incremented'
166-
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded())
167-
inputs:
168-
targetType: 'filePath'
169-
filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1
170-
arguments: '-projectPath "$(Build.SourcesDirectory)/src/Microsoft.Kiota.Abstractions.csproj" -packageName "Microsoft.Kiota.Abstractions"'
171-
pwsh: true
172-
173-
- task: EsrpCodeSigning@2
170+
- task: EsrpCodeSigning@3
174171
displayName: 'ESRP CodeSigning Nuget Packages'
175172
inputs:
176173
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
@@ -215,7 +212,7 @@ extends:
215212
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded())
216213
dependsOn: build
217214
jobs:
218-
- deployment: deploy_dotnet_abstractions
215+
- deployment: deploy_dotnet_kiota_libs
219216
dependsOn: []
220217
environment: nuget-org
221218
strategy:
@@ -243,10 +240,10 @@ extends:
243240
pwsh: true
244241
arguments: '-packageDirPath "$(Pipeline.Workspace)/"'
245242
- task: 1ES.PublishNuget@1
246-
displayName: 'NuGet push'
243+
displayName: 'Push Nuget for Kiota libraries'
247244
inputs:
248245
command: push
249-
packagesToPush: '$(Pipeline.Workspace)/Microsoft.Kiota.Abstractions.*.nupkg'
246+
packagesToPush: '$(Pipeline.Workspace)/Microsoft.Kiota.*.nupkg'
250247
packageParentPath: '$(Pipeline.Workspace)'
251248
nuGetFeedType: external
252249
publishFeedCredentials: 'Kiota Nuget Connection'

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
build-and-test:
1717
runs-on: windows-latest
1818
env:
19-
solutionName: Microsoft.Kiota.Abstractions.sln
19+
solutionName: Microsoft.Kiota.sln
2020
steps:
2121
- uses: actions/checkout@v4
2222
- name: Setup .NET
@@ -30,10 +30,10 @@ jobs:
3030
- name: Restore dependencies
3131
run: dotnet restore ${{ env.solutionName }}
3232
- name: Build
33-
run: dotnet build ${{ env.solutionName }} --no-restore -c Release /p:UseSharedCompilation=false
33+
run: dotnet build ${{ env.solutionName }} --no-restore /p:UseSharedCompilation=false
3434
- name: Test for net462
35-
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release --framework net462
35+
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal --framework net462
3636
- name: Test for net8.0 and collect coverage
37-
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover --framework net8.0
37+
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover --framework net8.0
3838
- name: Perform CodeQL Analysis
3939
uses: github/codeql-action/analyze@v3

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ jobs:
6262
CoverletOutputFormat: "opencover" # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
6363
shell: pwsh
6464
run: |
65-
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Abstractions.Tests/coverage.net8.0.opencover.xml"
65+
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="tests/abstractions/coverage.net8.0.opencover.xml,tests/authentication/azure/coverage.net8.0.opencover.xml,tests/http/httpClient/coverage.net8.0.opencover.xml,tests/serialization/json/coverage.net8.0.opencover.xml,tests/serialization/text/coverage.net8.0.opencover.xml,tests/serialization/form/coverage.net8.0.opencover.xml,tests/serialization/multipart/coverage.net8.0.opencover.xml"
6666
dotnet workload restore
6767
dotnet build
68-
dotnet test Microsoft.Kiota.Abstractions.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0
68+
dotnet test Microsoft.Kiota.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0
6969
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
// Use IntelliSense to find out which attributes exist for C# debugging
66
// Use hover for the description of the existing attributes
77
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8-
"name": ".NET Core Launch (console)",
8+
"name": "Test - Abstractions",
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests/bin/Debug/net8.0/Microsoft.Kiota.Abstractions.Tests.dll",
13+
"program": "${workspaceFolder}/tests/abstractions/bin/Debug/net8.0/Microsoft.Kiota.Abstractions.Tests.dll",
1414
"args": [],
15-
"cwd": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests",
15+
"cwd": "${workspaceFolder}",
1616
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
1717
"console": "internalConsole",
1818
"stopAtEntry": false
@@ -23,4 +23,4 @@
2323
"request": "attach"
2424
}
2525
]
26-
}
26+
}

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "process",
1010
"args": [
1111
"build",
12-
"${workspaceFolder}/Microsoft.Kiota.Abstractions.sln",
12+
"${workspaceFolder}/Microsoft.Kiota.sln",
1313
// Ask dotnet build to generate full paths for file names.
1414
"/property:GenerateFullPaths=true",
1515
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
@@ -24,7 +24,7 @@
2424
"type": "process",
2525
"args": [
2626
"test",
27-
"${workspaceFolder}/Microsoft.Kiota.Abstractions.sln",
27+
"${workspaceFolder}/Microsoft.Kiota.sln",
2828
// Ask dotnet build to generate full paths for file names.
2929
"/property:GenerateFullPaths=true",
3030
// Do not generate summary otherwise it leads to duplicate errors in Problems panel

0 commit comments

Comments
 (0)