From f72f2388ca535ed0f99cb6b7ed9695f4768f1a5a Mon Sep 17 00:00:00 2001 From: Travis Walker Date: Thu, 6 Jul 2023 13:35:45 -0700 Subject: [PATCH] OneBranch Fixes (#4193) * Updating android sdk installer * Adding windows install script * Add Windows Install * Script fix for winSDK install * PS Update * Revert "Adding windows install script" This reverts commit 79aa5289ebeab1f790c964588c572f6edad3fcf6. * Moving uap behind maui support porperty * Adding maui flag * Updating UAP property conditins * Suppressing UAP error * Adding OneBranch suppression * Adding OneBranch workaround * Removing workaround * Adding roslyn suppression * updating file path * Updating roslyn task * Updating suppressions * Roslyn parameter update * Adding OneBranch workaround * Workaround update * fix * suppression update * OneBranch Fix * update * build update * disabling roslyn for OneBranch * removing binskim * Removing TSA Upload * removing workaround * fix * Updating System.Drawing.Common package * removing dead code removing mobile targets from cloud build * PR Feedback * Update Microsoft.Identity.Client.csproj * Update Microsoft.Identity.Client.csproj * Update Microsoft.Identity.Client.csproj --------- Co-authored-by: trwalke Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com> --- build/InstallAndroid.ps1 | 6 +++++- build/pipeline-perf-tests-automation.yaml | 4 ++-- build/template-OneBranch-libsandsamples.yaml | 8 +------- build/template-postbuild-code-analysis.yaml | 6 +++++- build/template-publish-analysis-and-cleanup.yaml | 7 ------- build/template-sign-binary.yaml | 15 +-------------- .../Microsoft.Identity.Client.Broker.csproj | 2 +- .../Microsoft.Identity.Client.csproj | 16 ++++++++-------- .../Platforms/net6/MsalJsonSerializerContext.cs | 2 ++ .../MSIHelperService/MSIHelperService.csproj | 3 ++- tests/devapps/WAM/UWPWam/MainPage.xaml.cs | 1 + 11 files changed, 28 insertions(+), 42 deletions(-) diff --git a/build/InstallAndroid.ps1 b/build/InstallAndroid.ps1 index 9ecb5054db..e466c0a82f 100644 --- a/build/InstallAndroid.ps1 +++ b/build/InstallAndroid.ps1 @@ -3,6 +3,7 @@ $fileName = "AndroidTools.zip" $source = "C:\Downloads\$fileName" $destination = "C:\Downloads\AndroidSdkTools" $androidSdk = "C:\Program Files (x86)\Android\android-sdk" +$androidSdkVersion28 = "platforms;android-28" $androidSdkVersion29 = "platforms;android-29" $androidSdkVersion30 = "platforms;android-30" @@ -31,8 +32,11 @@ Copy-Item -Path microsoft-authentication-library-for-dotnet\build\AndroidSdkLice dir "$androidSdk\licenses" -echo "installing android 29" +echo "installing android 28" C:\Downloads\AndroidSdkTools\cmdline-tools\bin\.\sdkmanager --licenses --sdk_root="$androidSdk" +echo y y y y y y y |C:\Downloads\AndroidSdkTools\cmdline-tools\bin\.\sdkmanager "$androidSdkVersion28" --sdk_root="$androidSdk" + +echo "installing android 29" echo y y y y y y y |C:\Downloads\AndroidSdkTools\cmdline-tools\bin\.\sdkmanager "$androidSdkVersion29" --sdk_root="$androidSdk" echo "installing android 30" diff --git a/build/pipeline-perf-tests-automation.yaml b/build/pipeline-perf-tests-automation.yaml index f0030a01f3..aa02e13367 100644 --- a/build/pipeline-perf-tests-automation.yaml +++ b/build/pipeline-perf-tests-automation.yaml @@ -16,7 +16,7 @@ pool: variables: BuildPlatform: 'any cpu' BuildConfiguration: 'release' - MSAL_DESKTOP_ONLY_DEV: 'true' # skips building mobile and legacy targets + INCLUDE_MOBILE_AND_LEGACY_TFM: 'true' # skips building mobile and legacy targets jobs: - job: 'BuildJob' @@ -49,7 +49,7 @@ jobs: msbuildArchitecture: x64 platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration)' - msbuildArguments: '/p:RunCodeAnalysis=false /p:MSAL_DESKTOP_ONLY_DEV=$(MSAL_DESKTOP_ONLY_DEV)' + msbuildArguments: '/p:RunCodeAnalysis=false /p:INCLUDE_MOBILE_AND_LEGACY_TFM =$(INCLUDE_MOBILE_AND_LEGACY_TFM )' clean: true # The parameters currently are not used, but can be uploaded into the reporting system in the future. diff --git a/build/template-OneBranch-libsandsamples.yaml b/build/template-OneBranch-libsandsamples.yaml index 76fff857a0..fe99111949 100644 --- a/build/template-OneBranch-libsandsamples.yaml +++ b/build/template-OneBranch-libsandsamples.yaml @@ -32,10 +32,4 @@ steps: platform: ${{ parameters.BuildPlatform }} configuration: ${{ parameters.BuildConfiguration }} -# Run Post-build code analysis (e.g. Roslyn) -- template: template-postbuild-code-analysis.yaml - -- template: template-pack-and-sign-all-nugets.yaml - -# Publish analysis and cleanup -- template: template-publish-analysis-and-cleanup.yaml \ No newline at end of file +- template: template-pack-and-sign-all-nugets.yaml \ No newline at end of file diff --git a/build/template-postbuild-code-analysis.yaml b/build/template-postbuild-code-analysis.yaml index 1607cf1ee6..3212bf0b59 100644 --- a/build/template-postbuild-code-analysis.yaml +++ b/build/template-postbuild-code-analysis.yaml @@ -6,6 +6,10 @@ steps: displayName: 'Run Roslyn Analyzers' inputs: userProvideBuildInfo: auto + suppressionFileForCompilerWarnings: 'microsoft-authentication-library-for-dotnet\RoslynSuppressions.txt' + msBuildCommandline: 'dotnet build' + rulesetName: Recommended + rulesetVersion: Latest env: system_accesstoken: $(System.AccessToken) continueOnError: true @@ -13,4 +17,4 @@ steps: - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2 displayName: 'Check Roslyn Results ' inputs: - GdnBreakGdnToolRoslynAnalyzers: true + GdnBreakGdnToolRoslynAnalyzers: true \ No newline at end of file diff --git a/build/template-publish-analysis-and-cleanup.yaml b/build/template-publish-analysis-and-cleanup.yaml index 8f404998b9..7fe105420b 100644 --- a/build/template-publish-analysis-and-cleanup.yaml +++ b/build/template-publish-analysis-and-cleanup.yaml @@ -6,12 +6,5 @@ steps: - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3 displayName: 'Publish Security Analysis Logs' -- task: securedevelopmentteam.vss-secure-development-tools.build-task-uploadtotsa.TSAUpload@2 - displayName: 'TSA upload to Codebase: Unified .NET Core Stamp: Azure' - inputs: - GdnPublishTsaOnboard: false - GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)/build/tsaConfig.json' - continueOnError: true - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: 'Clean Agent Directories' diff --git a/build/template-sign-binary.yaml b/build/template-sign-binary.yaml index 672bb1fcb4..fa924ef6e1 100644 --- a/build/template-sign-binary.yaml +++ b/build/template-sign-binary.yaml @@ -57,17 +57,4 @@ steps: ] SessionTimeout: 20 VerboseLogin: true - timeoutInMinutes: 10 - -- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4 - displayName: 'Run BinSkim ${{ parameters.Pattern }}' - inputs: - InputType: Basic - AnalyzeTargetGlob: ${{ parameters.Pattern }} - AnalyzeVerbose: true - AnalyzeHashes: true - -- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2 - displayName: 'Check BinSkim Results' - inputs: - GdnBreakGdnToolBinSkim: true + timeoutInMinutes: 10 \ No newline at end of file diff --git a/src/client/Microsoft.Identity.Client.Broker/Microsoft.Identity.Client.Broker.csproj b/src/client/Microsoft.Identity.Client.Broker/Microsoft.Identity.Client.Broker.csproj index 499fc95c11..81e8c7c149 100644 --- a/src/client/Microsoft.Identity.Client.Broker/Microsoft.Identity.Client.Broker.csproj +++ b/src/client/Microsoft.Identity.Client.Broker/Microsoft.Identity.Client.Broker.csproj @@ -2,7 +2,7 @@ netstandard2.0 - net461 + net461 8.0 AnyCPU diff --git a/src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj b/src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj index 7ab0aa0819..b07673068c 100644 --- a/src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj +++ b/src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj @@ -11,21 +11,21 @@ Debug;Release;Debug + MobileApps - - + + net45 - uap10.0.17763 Xamarin.iOS10 MonoAndroid9.0 MonoAndroid10.0 - - - - net6.0-android net6.0-ios15.4 + + + uap10.0.17763 + + $(DefineConstants);MAUI @@ -236,7 +236,7 @@ - + diff --git a/src/client/Microsoft.Identity.Client/Platforms/net6/MsalJsonSerializerContext.cs b/src/client/Microsoft.Identity.Client/Platforms/net6/MsalJsonSerializerContext.cs index c1c4483d4b..9e74633860 100644 --- a/src/client/Microsoft.Identity.Client/Platforms/net6/MsalJsonSerializerContext.cs +++ b/src/client/Microsoft.Identity.Client/Platforms/net6/MsalJsonSerializerContext.cs @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using System.Text.Json.Serialization.Metadata; using Microsoft.Identity.Client.Cache; using Microsoft.Identity.Client.Instance.Discovery; using Microsoft.Identity.Client.Instance.Oidc; diff --git a/tests/devapps/Managed Identity apps/MSIHelperService/MSIHelperService.csproj b/tests/devapps/Managed Identity apps/MSIHelperService/MSIHelperService.csproj index f9d5aa06b8..57be3c0bd9 100644 --- a/tests/devapps/Managed Identity apps/MSIHelperService/MSIHelperService.csproj +++ b/tests/devapps/Managed Identity apps/MSIHelperService/MSIHelperService.csproj @@ -9,10 +9,11 @@ - + + diff --git a/tests/devapps/WAM/UWPWam/MainPage.xaml.cs b/tests/devapps/WAM/UWPWam/MainPage.xaml.cs index fe2a247be6..97b4cfdf1c 100644 --- a/tests/devapps/WAM/UWPWam/MainPage.xaml.cs +++ b/tests/devapps/WAM/UWPWam/MainPage.xaml.cs @@ -17,6 +17,7 @@ // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 namespace UWP_standalone { +#pragma warning disable CS0618 // Type or member is obsolete /// /// An empty page that can be used on its own or navigated to within a Frame. ///