Skip to content

Commit

Permalink
Merge pull request #17062 from Youssef1313/net9-sdk
Browse files Browse the repository at this point in the history
ci: Always use .NET 9 SDK
  • Loading branch information
jeromelaban committed Jun 21, 2024
2 parents 29237fe + f9c2b6a commit e43bbeb
Show file tree
Hide file tree
Showing 36 changed files with 143 additions and 133 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/uwp-autoconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UnoCheck_Version: '1.20.2'
UnoCheck_Version: '1.24.0-dev.12'

# Only convert using NetPrevious
UnoDisableNetCurrentMobile: true
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Pin .NET Version
run: |
cp build/ci/net8/global.json global.json
cp build/ci/net9/global.json global.json
- name: Setup .NET SDK
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
& dotnet tool update --global uno.check --version $env:UnoCheck_Version --add-source https://api.nuget.org/v3/index.json
name: Install Uno Check
- run: |
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --pre-major
name: Run uno-check
- name: Convert source tree to UWP
Expand Down
2 changes: 2 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<packageSources>
<clear />
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<!-- Needed for .NET 9 preview 4 as we need to reference roslyn 4.11 which isn't (yet) published to NuGet.org -->
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="Solution Packages" value="src/PackageCache" />
</packageSources>
</configuration>
4 changes: 1 addition & 3 deletions build/ci/.azure-devops-package-netcoremobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:

- template: templates/gitversion.yml

# Building with .NET 9 SDK for net8.0-ios17.0 to work.
# It looks like building net8.0-ios17.0 with .NET 8 SDK will end up using Microsoft.iOS 17.2 assembly.
- template: templates/dotnet9-mobile-install-windows.yml
- template: templates/dotnet-mobile-install-windows.yml

# This task is required to run in separately to avoid hitting targets file
# caching issues with msbuild 17.3 or later
Expand Down
8 changes: 0 additions & 8 deletions build/ci/.azure-devops-project-template-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ jobs:

- template: templates/gitversion.yml

- bash: |
sed -i.bu 's/8.0.100/8.0.200/' build/ci/net8/global.json
displayName: Replace global.json with .NET 8.0.200
- template: templates/ios-build-select-version.yml
parameters:
xCodeRoot: ${{ parameters.xCodeRoot }}
Expand Down Expand Up @@ -116,10 +112,6 @@ jobs:
inputs:
artifactName: NugetPackages

- script: |
sed -i 's/8.0.100/8.0.200/g' build/ci/net8/global.json
displayName: Replace global.json with .NET 8.0.200
- template: templates/dotnet-mobile-install-linux.yml

- template: templates/gitversion.yml
Expand Down
7 changes: 7 additions & 0 deletions build/ci/.azure-devops-skia-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ jobs:
dotnet build -c Debug -p:UnoDisableNetCurrent=true
displayName: Build HR dependencies
# We need just the .NET 8 runtime (not the SDK).
# Building with .NET 9 SDK is fine, but running the app when the TFM is net8.0 requires the .NET 8 runtime
- task: UseDotNet@2
inputs:
packageType: 'runtime'
version: '8.x'

- script: |
cd $(SamplesAppArtifactPath)
dotnet SamplesApp.Skia.Gtk.dll --runtime-tests=$(build.sourcesdirectory)/build/skia-gtk-runtime-tests-results.xml
Expand Down
7 changes: 7 additions & 0 deletions build/ci/.azure-devops-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ jobs:
- template: templates/dotnet-install.yml
- template: templates/jdk-setup.yml

# We need just the .NET 8 runtime (not the SDK).
# Building with .NET 9 SDK is fine, but running the app when the TFM is net8.0 requires the .NET 8 runtime
- task: UseDotNet@2
inputs:
packageType: 'runtime'
version: '8.x'

- task: DownloadBuildArtifacts@0
displayName: Download build artifact
inputs:
Expand Down
14 changes: 0 additions & 14 deletions build/ci/net7/global.json

This file was deleted.

14 changes: 0 additions & 14 deletions build/ci/net8/global.json

This file was deleted.

5 changes: 2 additions & 3 deletions build/ci/net9/global.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"sdk": {
"version": "9.0.100-preview.3.24204.13",
// Change to false once we have stable 9.0 SDK
"version": "9.0.100-preview.4.24267.66",
"allowPrerelease": true,
"rollForward": "disable"
},
"tools": {
"dotnet": "9.0.100-preview.3.24204.13"
"dotnet": "9.0.100-preview.4.24267.66"
},
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.44",
Expand Down
7 changes: 0 additions & 7 deletions build/ci/templates/dotnet-install.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
steps:

- bash: |
rm global.json
cp build/ci/net8/global.json global.json
displayName: "Using .NET 8 global.json"
condition: and(succeeded(), eq(variables.UnoDisableNetCurrent, 'true'))
- bash: |
rm global.json
cp build/ci/net9/global.json global.json
displayName: "Using .NET 9 global.json"
condition: and(succeeded(), ne(variables.UnoDisableNetCurrent, 'true'))
- task: UseDotNet@2
displayName: 'Use .NET SDK'
Expand Down
7 changes: 2 additions & 5 deletions build/ci/templates/dotnet-mobile-install-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
parameters:
UnoCheck_Version: '1.20.2'
UnoCheck_Manifest: 'https://raw.githubusercontent.com/unoplatform/uno.check/bd121b30a0044fd80df18618dd7915fe8ccf4503/manifests/uno.ui.manifest.json'
UnoCheck_Version: '1.24.0-dev.12'

steps:

Expand All @@ -14,13 +13,11 @@ steps:
sudo apt-get update
sudo apt-get install -y msopenjdk-11
displayName: Install OpenJDK 11
condition: and(succeeded(), ne(variables.UnoDisableNet7Mobile, 'true'))
retryCountOnTaskFailure: 3
- bash: |
dotnet tool update --global uno.check --version ${{ parameters.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json
# androidsdk disabled for https://github.com/unoplatform/uno.check/issues/241
uno-check --ci --non-interactive --fix --skip androidsdk --skip gtk3 --manifest ${{ parameters.UnoCheck_Manifest }}
uno-check --ci --non-interactive --fix --skip androidsdk --skip gtk3 --pre-major
displayName: Install .NET Workloads
condition: and(succeeded(), ne(variables.UnoDisableNet7Mobile, 'true'))
retryCountOnTaskFailure: 3
20 changes: 3 additions & 17 deletions build/ci/templates/dotnet-mobile-install-mac.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
parameters:
UnoCheck_Version_Previous: '1.20.2'
UnoCheck_Manifest_Previous: 'https://raw.githubusercontent.com/unoplatform/uno.check/bd121b30a0044fd80df18618dd7915fe8ccf4503/manifests/uno.ui.manifest.json'
UnoCheck_Version_Current: '1.22.0'
UnoCheck_Manifest_Current: 'https://raw.githubusercontent.com/unoplatform/uno.check/f2ba48c5cb67d59d8025ca96e436e1a9f6f3012c/manifests/uno.ui-preview-major.manifest.json'
UnoCheck_Version: '1.24.0-dev.12'

steps:

Expand All @@ -11,20 +8,9 @@ steps:
- template: jdk-setup.yml

- powershell: |
& dotnet tool update --global uno.check --version ${{ parameters.UnoCheck_Version_Previous }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest ${{ parameters.UnoCheck_Manifest_Previous }}
& dotnet tool update --global uno.check --version ${{ parameters.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --pre-major
displayName: Install .NET Workloads
errorActionPreference: continue
ignoreLASTEXITCODE: true
retryCountOnTaskFailure: 3
condition: and(succeeded(), eq(variables.UnoDisableNetCurrentMobile, 'true'))
- powershell: |
& dotnet tool update --global uno.check --version ${{ parameters.UnoCheck_Version_Current }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest ${{ parameters.UnoCheck_Manifest_Current }}
displayName: Install .NET Workloads
errorActionPreference: continue
ignoreLASTEXITCODE: true
retryCountOnTaskFailure: 3
condition: and(succeeded(), ne(variables.UnoDisableNetCurrentMobile, 'true'))
17 changes: 5 additions & 12 deletions build/ci/templates/dotnet-mobile-install-windows.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
parameters:
UnoCheck_Version: '1.24.0-dev.12'

steps:

- template: dotnet-install.yml

- template: jdk-setup.yml

- powershell: |
& dotnet tool update --global uno.check --version 1.22.0 --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest https://raw.githubusercontent.com/unoplatform/uno.check/f2ba48c5cb67d59d8025ca96e436e1a9f6f3012c/manifests/uno.ui-preview-major.manifest.json
displayName: Install .NET Workloads
errorActionPreference: continue
ignoreLASTEXITCODE: true
retryCountOnTaskFailure: 3
condition: and(succeeded(), eq(variables.UnoDisableNetPreviousMobile, 'true'))
- powershell: |
& dotnet tool update --global uno.check --version 1.20.2 --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest https://raw.githubusercontent.com/unoplatform/uno.check/bd121b30a0044fd80df18618dd7915fe8ccf4503/manifests/uno.ui.manifest.json
& dotnet tool update --global uno.check --version ${{ parameters.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip androidsdk --skip androidemulator --skip xcode --skip gtk3 --skip vswin --skip vsmac --pre-major
displayName: Install .NET Workloads
errorActionPreference: continue
ignoreLASTEXITCODE: true
retryCountOnTaskFailure: 3
condition: and(succeeded(), ne(variables.UnoDisableNetPreviousMobile, 'true'))
25 changes: 0 additions & 25 deletions build/ci/templates/dotnet9-mobile-install-windows.yml

This file was deleted.

15 changes: 15 additions & 0 deletions build/test-scripts/wasm-run-automated-uitests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ dotnet tool uninstall dotnet-serve --tool-path $BUILD_SOURCESDIRECTORY/build/too
dotnet tool install dotnet-serve --version 1.10.140 --tool-path $BUILD_SOURCESDIRECTORY/build/tools || true
export PATH="$PATH:$BUILD_SOURCESDIRECTORY/build/tools"

# Workaround an issue where dotnet test gets stuck.
# If this is removed and everything works, then remove it! :)
export MSBUILDENSURESTDOUTFORTASKPROCESSES=1

export UNO_UITEST_TARGETURI=http://localhost:8000
export UNO_UITEST_DRIVERPATH_CHROME=$BUILD_SOURCESDIRECTORY/build/wasm-uitest-binaries/node_modules/chromedriver/lib/chromedriver
export UNO_UITEST_CHROME_BINARY_PATH=~/.cache/puppeteer/chrome/linux-119.0.6045.105/chrome-linux64/chrome
Expand Down Expand Up @@ -83,9 +87,15 @@ dotnet test \
-v m \
|| true

echo "Killing dotnet serve"

jobs

## terminate dotnet serve
kill %%

echo "Killed!"

## Copy the results file to the results folder
cp --backup=t $UNO_ORIGINAL_TEST_RESULTS $UNO_UITEST_SCREENSHOT_PATH

Expand All @@ -102,8 +112,13 @@ cp $BUILD_SOURCESDIRECTORY/src/SamplesApp/SamplesApp.UITests/TestResults/*/*.xml
pushd $BUILD_SOURCESDIRECTORY/src/Uno.NUnitTransformTool
mkdir -p $(dirname ${UNO_TESTS_FAILED_LIST})

echo "Running NUnitTransformTool"

dotnet run list-failed $UNO_ORIGINAL_TEST_RESULTS $UNO_TESTS_FAILED_LIST

## Fail the build when no test results could be read
dotnet run fail-empty $UNO_ORIGINAL_TEST_RESULTS

echo "Ran NUnitTransformTool"

popd
5 changes: 4 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</PropertyGroup>

<PropertyGroup>
<MicrosoftNetCompilersToolsetVersion>4.10.0-3.final</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>4.11.0-3.24307.3</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -248,6 +248,9 @@
<!-- Disable warning about cross platform call sites -->
<NoWarn>$(NoWarn);CA1416</NoWarn>

<!-- Workaround for https://github.com/dotnet/runtime/issues/103205 -->
<NoWarn>$(NoWarn);CS0436</NoWarn>

<!-- On CI, UWP source is generated in a job running on Windows (CRLF EOLs). -->
<!-- When the artifacts are downloaded in a job running on Linux, IDE0055 will complain (expecting LF EOLs) -->
<!-- For now, we skip formatting in CI UWP builds not running on Windows -->
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
<PackageReference Update="Uno.Core.Extensions.Disposables" Version="4.0.1" />
<PackageReference Update="Uno.Core.Extensions.Compatibility" Version="4.0.1" />
<PackageReference Update="Uno.Diagnostics.Eventing" Version="2.0.1" />
<PackageReference Update="Uno.Wasm.Bootstrap" Version="8.0.0-dev.252" />
<PackageReference Update="Uno.Wasm.Bootstrap.DevServer" Version="8.0.0-dev.252" />
<PackageReference Update="Uno.Wasm.Bootstrap" Version="9.0.0-dev.86" />
<PackageReference Update="Uno.Wasm.Bootstrap.DevServer" Version="9.0.0-dev.86" />
<PackageReference Update="MSTest" Version="3.3.1" />
<PackageReference Update="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Update="MSTest.TestAdapter" Version="3.3.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetPrevious)</TargetFramework>
<TargetFramework>$(NetCurrent)</TargetFramework>

<DefineConstants Condition="$(UnoTargetFrameworkOverride.ToLowerInvariant().EndsWith('-android'))">$(DefineConstants);TARGET_FRAMEWORK_OVERRIDE_ANDROID</DefineConstants>

Expand Down
6 changes: 3 additions & 3 deletions src/SolutionTemplate/5.1/uno51blank/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<PackageVersion Include="Uno.Resizetizer" Version="1.3.0" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.WinUI" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.WinUI.Lottie" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.WinUI.DevServer" Version="$(UnoVersion)" />
Expand Down
3 changes: 3 additions & 0 deletions src/SolutionTemplate/5.1/uno51blank/global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"sdk": {
"allowPrerelease": true
},
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
"Uno.Sdk.Private": "5.1.50",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
<PackageVersion Include="Uno.Resizetizer" Version="1.3.0" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="8.0.8" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="9.0.0-dev.86" />
<PackageVersion Include="Uno.WinUI" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.WinUI.Lottie" Version="$(UnoVersion)" />
<PackageVersion Include="Uno.WinUI.DevServer" Version="$(UnoVersion)" />
Expand Down
3 changes: 3 additions & 0 deletions src/SolutionTemplate/5.1/uno51recommended/global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"sdk": {
"allowPrerelease": true
},
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
"Uno.Sdk.Private": "5.1.50",
Expand Down
3 changes: 3 additions & 0 deletions src/SolutionTemplate/5.2/uno52AppWithLib/global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"sdk": {
"allowPrerelease": true
},
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
"Uno.Sdk.Private": "5.2.0-dev.2002"
Expand Down
Loading

0 comments on commit e43bbeb

Please sign in to comment.