From 154245b845638fb8f000f14d6ddb2b8da6606b3c Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 23 Oct 2024 16:07:34 -0500 Subject: [PATCH 1/8] Add conditionals to enable TFM overrides per MultiTarget --- MultiTarget/AvailableTargetFrameworks.props | 26 ++++++++++----------- MultiTarget/EnabledTargetFrameworks.props | 22 ++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/MultiTarget/AvailableTargetFrameworks.props b/MultiTarget/AvailableTargetFrameworks.props index 93b77afb..5d99cbd5 100644 --- a/MultiTarget/AvailableTargetFrameworks.props +++ b/MultiTarget/AvailableTargetFrameworks.props @@ -1,23 +1,23 @@ - uap10.0.17763 - net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0; + uap10.0.17763 + net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0; - net8.0 - net8.0 - net8.0 + net8.0 + net8.0 + net8.0 - net8.0-android34.0 - net8.0-maccatalyst - net8.0-ios + net8.0-android34.0 + net8.0-maccatalyst + net8.0-ios - net8.0 - net8.0 - net8.0 + net8.0 + net8.0 + net8.0 - netstandard2.0 - net8.0 + netstandard2.0 + net8.0 \ No newline at end of file diff --git a/MultiTarget/EnabledTargetFrameworks.props b/MultiTarget/EnabledTargetFrameworks.props index ee92d5c9..9dd89a26 100644 --- a/MultiTarget/EnabledTargetFrameworks.props +++ b/MultiTarget/EnabledTargetFrameworks.props @@ -1,23 +1,23 @@ - uap10.0.17763 - net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0; + uap10.0.17763 + net8.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net6.0-windows10.0.22621.0; + + net8.0 + net8.0 + net8.0 - net8.0 - net8.0 - net8.0 - - net8.0 - net8.0 - net8.0 + net8.0 + net8.0 + net8.0 - netstandard2.0 - net8.0 + netstandard2.0 + net8.0 From 9689653fa1535045d6998d88b7afac15155e9180 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 17:14:56 -0500 Subject: [PATCH 2/8] Update wasm-linux job to only generate solution for wasm multitargets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e19ef14b..2b32462e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -283,7 +283,7 @@ jobs: - name: Generate solution shell: pwsh working-directory: ./ - run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} + run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -MultiTargets wasm # Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38 # See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj From af729382e2369e7a25190eff44bb8f7da94fb9e9 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 17:39:55 -0500 Subject: [PATCH 3/8] Enable build diagnostics, fix binlog output --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b32462e..1fae0dac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ on: env: DOTNET_VERSION: ${{ '8.0.x' }} - ENABLE_DIAGNOSTICS: false + ENABLE_DIAGNOSTICS: true #COREHOST_TRACE: 1 COREHOST_TRACEFILE: corehosttrace.log @@ -285,11 +285,10 @@ jobs: working-directory: ./ run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -MultiTargets wasm - # Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38 - # See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj - name: dotnet build - working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/ - run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false + shell: pwsh + working-directory: ./ + run: ./tooling/Build-Toolkit-Components.ps1 -Release -MultiTargets wasm ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -BinlogOutput ./ -EnableBinLogs' || '' }} # TODO: Do we want to run tests here? Can we do that on linux easily? From 40d2a218748325e5e6459171bc1fa2820826df70 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 17:51:50 -0500 Subject: [PATCH 4/8] Update SDK version in global.json --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index e4e1a5f4..91187a7c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.201", + "version": "8.0.403", "rollForward": "latestFeature" }, "msbuild-sdks": From 7b112b4b026f8e4954294bf5393106452d967ec3 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 18:27:52 -0500 Subject: [PATCH 5/8] Build components with dotnet instead of msbuild when running on linux. --- Build-Toolkit-Components.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Build-Toolkit-Components.ps1 b/Build-Toolkit-Components.ps1 index 4b9d0f8a..38b0d7fb 100644 --- a/Build-Toolkit-Components.ps1 +++ b/Build-Toolkit-Components.ps1 @@ -170,7 +170,13 @@ function Invoke-MSBuildWithBinlog { $msbuildArgs += "/v:detailed" } - msbuild $msbuildArgs $TargetHeadPath + # If platform is linux, use dotnet instead of msbuild + if ($($PSVersionTable.Platform) -eq "Unix") { + dotnet build $msbuildArgs $TargetHeadPath + } + else { + msbuild $msbuildArgs $TargetHeadPath + } } # Components are built individually From b1dca37bde8b29aafc73da1fd9a27c5ee6365603 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 19:05:44 -0500 Subject: [PATCH 6/8] Further fixes for running Build-Toolkit-Components.ps1 on Linux --- Build-Toolkit-Components.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Build-Toolkit-Components.ps1 b/Build-Toolkit-Components.ps1 index 38b0d7fb..2dea5d3a 100644 --- a/Build-Toolkit-Components.ps1 +++ b/Build-Toolkit-Components.ps1 @@ -124,7 +124,21 @@ function Invoke-MSBuildWithBinlog { ) # Reset build args to default - $msbuildArgs = @("-r", "-m", "/p:DebugType=Portable") + $msbuildArgs = @("/p:DebugType=Portable") + + # Add "-r" parameter if not running on linux + if ($($PSVersionTable.Platform) -ne "Unix") { + $msbuildArgs += "-r" + } + # Otherwise, add "-restore" parameter + else { + $msbuildArgs += "-restore" + } + + # Add "-m" parameter if not running on linux + if ($($PSVersionTable.Platform) -ne "Unix") { + $msbuildArgs += "-m" + } # Add packing to the msbuild arguments if NupkgOutput is supplied if ($NupkgOutput) { From d0e7d0c03ca9a3685f0815704877a9b4a800606f Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 19:05:59 -0500 Subject: [PATCH 7/8] Fixed regex, now accounts for xml parameters --- MultiTarget/UseTargetFrameworks.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MultiTarget/UseTargetFrameworks.ps1 b/MultiTarget/UseTargetFrameworks.ps1 index 544c2b5a..54a1aa0a 100644 --- a/MultiTarget/UseTargetFrameworks.ps1 +++ b/MultiTarget/UseTargetFrameworks.ps1 @@ -107,7 +107,7 @@ $targetFrameworksToRemove = @( $targetFrameworksToRemoveRegexPartial = $targetFrameworksToRemove -join "|"; -$newFileContents = $fileContents -replace "<(?:$targetFrameworksToRemoveRegexPartial)>.+?>", ''; +$newFileContents = $fileContents -replace "<(?:$targetFrameworksToRemoveRegexPartial).+?>.+?>", ''; Set-Content -Force -Path $PSScriptRoot/EnabledTargetFrameworks.props -Value $newFileContents; From 623ad018e842ed8a64f12f8a073b274315b4a515 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 24 Oct 2024 19:11:50 -0500 Subject: [PATCH 8/8] Disable build diagnostics in GitHub workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fae0dac..47051943 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ on: env: DOTNET_VERSION: ${{ '8.0.x' }} - ENABLE_DIAGNOSTICS: true + ENABLE_DIAGNOSTICS: false #COREHOST_TRACE: 1 COREHOST_TRACEFILE: corehosttrace.log