Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI support #486

Merged
merged 4 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions .github/workflows/validatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,42 @@ on:
jobs:
build:
name: Build and Test
runs-on: windows-2019 # windows-latest does not currently support code-QL
runs-on: windows-latest
env:
solutionName: Microsoft.Graph.Core.sln
relativePath: ./src/Microsoft.Graph.Core
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3.0.2

- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x

- uses: nuget/setup-nuget@v1
- name: Setup JDK for android targets
uses: actions/setup-java@v3
with:
nuget-version: '5.x'
distribution: 'microsoft'
java-version: '11'

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: csharp

- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
- name: Install needed dotnet workloads
run: dotnet workload restore ${{ env.solutionName }}

- name : Nuget Restore
run: msbuild -t:restore -m
- name: Restore nuget dependencies
run: dotnet restore ${{ env.solutionName }}

- name: Build Project
run: msbuild ${{ env.solutionName }} -m
- name: Build
run: dotnet build ${{ env.solutionName }} --no-restore -c Debug /p:UseSharedCompilation=false

- name: Test Project
run: vstest.console.exe ./tests/Microsoft.Graph.DotnetCore.Core.Test/bin/Debug/netcoreapp3.1/Microsoft.Graph.DotnetCore.Core.Test.dll
- name: Test
run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Debug /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2


31 changes: 2 additions & 29 deletions Microsoft.Graph.Core.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.352
# Visual Studio Version 17
VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5E0B65FC-67B7-41F8-87BF-96D6A342C438}"
EndProject
Expand All @@ -10,8 +10,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Graph.Core", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Graph.DotnetCore.Core.Test", "tests\Microsoft.Graph.DotnetCore.Core.Test\Microsoft.Graph.DotnetCore.Core.Test.csproj", "{A337BD4B-5C76-4BC5-8EC2-2EE7B834D030}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Graph.Core.XamarinAndroid.Test", "tests\Microsoft.Graph.Core.XamarinAndroid.Test\Microsoft.Graph.Core.XamarinAndroid.Test.csproj", "{41E25C28-021A-4CFB-B02D-DB901021E720}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -56,38 +54,13 @@ Global
{A337BD4B-5C76-4BC5-8EC2-2EE7B834D030}.Release|x64.Build.0 = Release|Any CPU
{A337BD4B-5C76-4BC5-8EC2-2EE7B834D030}.Release|x86.ActiveCfg = Release|Any CPU
{A337BD4B-5C76-4BC5-8EC2-2EE7B834D030}.Release|x86.Build.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|ARM.ActiveCfg = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|ARM.Build.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|ARM.Deploy.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x64.ActiveCfg = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x64.Build.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x64.Deploy.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x86.ActiveCfg = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x86.Build.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Debug|x86.Deploy.0 = Debug|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|Any CPU.Build.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|Any CPU.Deploy.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|ARM.ActiveCfg = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|ARM.Build.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|ARM.Deploy.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x64.ActiveCfg = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x64.Build.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x64.Deploy.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x86.ActiveCfg = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x86.Build.0 = Release|Any CPU
{41E25C28-021A-4CFB-B02D-DB901021E720}.Release|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9F04608C-D845-4445-83B1-E6D4EEE38CBC} = {5E0B65FC-67B7-41F8-87BF-96D6A342C438}
{A337BD4B-5C76-4BC5-8EC2-2EE7B834D030} = {6496B661-8321-4D07-ACC2-B6602649293C}
{41E25C28-021A-4CFB-B02D-DB901021E720} = {6496B661-8321-4D07-ACC2-B6602649293C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0DB06E6E-58F0-497F-9ECC-00DD03BA9357}
Expand Down
78 changes: 28 additions & 50 deletions pipelines/previewBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ variables:
PROJECT_PATH: '.\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj'

pool:
name: Hosted Windows 2019 with VS2019
demands:
- msbuild
- vstest
vmImage: 'windows-latest'

steps:
- checkout: self
Expand All @@ -54,29 +51,30 @@ steps:
arguments: '-packageName "$(PACKAGE_NAME)" -projectPath "$(PROJECT_PATH)"'
enabled: true

- task: NuGetToolInstaller@1
- task: PowerShell@2
displayName: 'Set or increment preview version.'
inputs:
targetType: filePath
filePath: 'scripts\IncrementPreviewVersion.ps1'
arguments: '-packageName "$(PACKAGE_NAME)" -projectPath "$(PROJECT_PATH)"'
enabled: true

- task: NuGetCommand@2
displayName: 'NuGet restore'
- powershell: |
dotnet workload restore $(Build.SourcesDirectory)\Microsoft.Graph.Core.sln
displayName: 'dotnet workload restore'

- task: MSBuild@1
displayName: 'Build solution to run tests'
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
configuration: debug
clean: true
command: restore
projects: '**/*.csproj'

- task: VSTest@2
displayName: 'Run enabled tests'
- task: DotNetCoreCLI@2
displayName: 'run tests'
inputs:
testAssemblyVer2: |
**/netcoreapp3.1/Microsoft.Graph.DotnetCore.Core.Test.dll
!**/*TestAdapter.dll
!**/obj/**
diagnosticsEnabled: true
configuration: debug
searchFolder: 'tests'
platform: AnyCPU
otherConsoleOptions: '/Framework:.NETCoreApp,Version=v3.1'
command: 'test'
projects: '$(Build.SourcesDirectory)\tests\Microsoft.Graph.DotnetCore.Core.Test\Microsoft.Graph.DotnetCore.Core.Test.csproj'
arguments: '--configuration Debug --verbosity normal'

- task: PowerShell@2
displayName: 'Enable signing'
Expand All @@ -86,20 +84,11 @@ steps:
arguments: '-projectPath "$(PROJECT_PATH)"'
enabled: true

- task: PowerShell@2
displayName: 'Set or increment preview version.'
inputs:
targetType: filePath
filePath: 'scripts\IncrementPreviewVersion.ps1'
arguments: '-packageName "$(PACKAGE_NAME)" -projectPath "$(PROJECT_PATH)"'
enabled: true

- task: MSBuild@1
displayName: 'Build solution for preview release signing'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
solution: src/**/Microsoft.Graph.Core.csproj
configuration: release
clean: true
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj'
arguments: '-c Release --no-incremental'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP DLL Strong Name (Microsoft.Graph.Core)'
Expand Down Expand Up @@ -174,12 +163,10 @@ steps:
]
SessionTimeout: 20

- task: MSBuild@1
displayName: 'Create NuGet package for preview release'
inputs:
solution: '**/Microsoft.Graph.Core.csproj'
configuration: 'release'
msbuildArguments: '-t:pack /p:NoBuild=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg'
# arguments are not parsed in DotNetCoreCLI@2 task for `pack` command, that's why we have a custom pack command here
- powershell: |
dotnet pack $env:BUILD_SOURCESDIRECTORY/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY --configuration Release
displayName: dotnet pack

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP NuGet CodeSigning'
Expand Down Expand Up @@ -222,12 +209,3 @@ steps:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: PreviewReleaseArtifact

- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
displayName: 'Graph Client Tooling pipeline fail notification'
inputs:
addressType: serviceEndpoint
serviceEndpointName: 'microsoftgraph pipeline status'
title: '$(Build.DefinitionName) failure notification'
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure.'
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
enabled: true
62 changes: 21 additions & 41 deletions pipelines/productionBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ variables:
PROJECT_PATH: '.\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj'

pool:
name: Hosted Windows 2019 with VS2019
demands:
- msbuild
- vstest
vmImage: 'windows-latest'

steps:
- checkout: self
Expand All @@ -53,27 +50,22 @@ steps:
arguments: '-packageName "$(PACKAGE_NAME)" -projectPath "$(PROJECT_PATH)"'
enabled: true

- task: NuGetCommand@2
displayName: 'NuGet restore'
- powershell: |
dotnet workload restore $(Build.SourcesDirectory)\Microsoft.Graph.Core.sln
displayName: 'dotnet workload restore'

- task: MSBuild@1
displayName: 'Build solution to run tests'
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
configuration: debug
clean: true
command: restore
projects: '**/*.csproj'

- task: VSTest@2
displayName: 'Run enabled tests'
- task: DotNetCoreCLI@2
displayName: 'run tests'
inputs:
testAssemblyVer2: |
**/netcoreapp3.1/Microsoft.Graph.DotnetCore.Core.Test.dll
!**/*TestAdapter.dll
!**/obj/**
diagnosticsEnabled: true
configuration: debug
searchFolder: 'tests'
platform: AnyCPU
otherConsoleOptions: '/Framework:.NETCoreApp,Version=v3.1'
command: 'test'
projects: '$(Build.SourcesDirectory)\tests\Microsoft.Graph.DotnetCore.Core.Test\Microsoft.Graph.DotnetCore.Core.Test.csproj'
arguments: '--configuration Debug --verbosity normal'

- task: PowerShell@2
displayName: 'Enable signing'
Expand All @@ -83,12 +75,11 @@ steps:
arguments: '-projectPath "$(PROJECT_PATH)"'
enabled: true

- task: MSBuild@1
displayName: 'Build solution for production release signing'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
solution: src/**/Microsoft.Graph.Core.csproj
configuration: release
clean: true
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj'
arguments: '-c Release --no-incremental'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP DLL Strong Name (Microsoft.Graph.Core) (AKV)'
Expand Down Expand Up @@ -163,12 +154,10 @@ steps:
]
SessionTimeout: 20

- task: MSBuild@1
displayName: 'Create NuGet package for production release'
inputs:
solution: '**/Microsoft.Graph.Core.csproj'
configuration: 'release'
msbuildArguments: '-t:pack /p:NoBuild=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg'
# arguments are not parsed in DotNetCoreCLI@2 task for `pack` command, that's why we have a custom pack command here
- powershell: |
dotnet pack $env:BUILD_SOURCESDIRECTORY/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY --configuration Release
displayName: dotnet pack

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP NuGet CodeSigning'
Expand Down Expand Up @@ -211,12 +200,3 @@ steps:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: ProductionReleaseArtifact

- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
displayName: 'Graph Client Tooling pipeline fail notification'
inputs:
addressType: serviceEndpoint
serviceEndpointName: 'microsoftgraph pipeline status'
title: '$(Build.DefinitionName) failure notification'
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure.'
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
enabled: true
Loading