Skip to content

refactor: Move to net9, single project, nbgv #92

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

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a33a20c
refactor: Move to net9, single project, nbgv
jeromelaban Mar 6, 2025
ac0d42f
chore: Adjust package build
jeromelaban Mar 6, 2025
0845975
chore Adjust wasm test
jeromelaban Mar 6, 2025
46660d2
chore: Update references, include sbom
jeromelaban Mar 6, 2025
ff53a7b
chore: Adjust uno.check
jeromelaban Mar 6, 2025
5ec0059
chore: Adjust template name
jeromelaban Mar 6, 2025
c619eef
chore: Adjust for jdk setup
jeromelaban Mar 6, 2025
a5b0933
chore: Adjust wasm tests
jeromelaban Mar 6, 2025
3e5c37c
chore: Adjust android, ios builds, net9 for uitest project
jeromelaban Mar 6, 2025
7ba1ff6
chore: Bump xcode
jeromelaban Mar 6, 2025
854b0a6
chore: Adjust android and ios builds
jeromelaban Mar 6, 2025
e32b200
chore: Adjust android tools location, ios project path
jeromelaban Mar 6, 2025
1fa0870
chore: Adjuste android and ios test runs
jeromelaban Mar 6, 2025
dc5f3a3
chore: Adjust android install
jeromelaban Mar 6, 2025
46c2778
chore: Adjust android project path
jeromelaban Mar 6, 2025
f661ce1
chore: Adjust ios emulator
jeromelaban Mar 6, 2025
5759b34
chore: Adjust result files
jeromelaban Mar 6, 2025
bc26bfd
chore: Adjust readme, android log
jeromelaban Mar 6, 2025
ec34fd4
chore: Adjust platform
jeromelaban Mar 6, 2025
38fa910
chore: Adjust ios path
jeromelaban Mar 6, 2025
7b53972
chore: publish binlogs
jeromelaban Mar 6, 2025
269b38b
chore: Adjust android apk path, bump xamarin.uitest
jeromelaban Mar 6, 2025
e3e8048
chore: Bump nunit
jeromelaban Mar 6, 2025
4c220ea
chore: Adjust android build
jeromelaban Mar 6, 2025
4119df7
chore: Adjust android test
jeromelaban Mar 6, 2025
9c00d7b
chore: Adjust android/ios tests
jeromelaban Mar 6, 2025
ebb318f
chore: Always fail step on dotnet test failure
jeromelaban Mar 6, 2025
07f4534
chore: Terminate background test processes
jeromelaban Mar 6, 2025
d782672
chore: update exit code tests
jeromelaban Mar 6, 2025
f95bbbe
chore: log more
jeromelaban Mar 6, 2025
ae1a722
chore: Add failure for empty device
jeromelaban Mar 6, 2025
7273f65
chore: Adjust android failures
jeromelaban Mar 6, 2025
5023075
chore: Adjust app install
jeromelaban Mar 6, 2025
ffe6ebf
chore: Adjust ios selector
jeromelaban Mar 6, 2025
69874d6
chore: Adjust build order
jeromelaban Mar 6, 2025
f3d7496
chore: Adjust iOS simulator
jeromelaban Mar 7, 2025
566b5fd
chore: Adjust android, ios tests
jeromelaban Mar 7, 2025
5985eab
chore: Adjust android, ios tests
jeromelaban Mar 7, 2025
40e2ba8
chore: Adjust screenshot folder
jeromelaban Mar 7, 2025
a944769
chore: Adjust simulator start
jeromelaban Mar 7, 2025
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
<!-- - Feature request -->
<!-- - Sample app request -->
<!-- - Documentation issue or request -->
<!-- - Question of Support request => Please do not submit support request here, instead see https://github.com/nventive/Uno.Core/blob/master/Readme.md#have-questions-feature-requests-issues -->
<!-- - Question of Support request => Please do not submit support request here, instead see https://github.com/unoplatform/Uno.Core/blob/master/Readme.md#have-questions-feature-requests-issues -->

## Current behavior
<!-- Describe how the issue manifests. -->
Expand Down
89 changes: 43 additions & 46 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ pr:
- stable
- release/stable/*

resources:
containers:
- container: nv-bionic-wasm
image: unoplatform/wasm-build:3.0

jobs:
- job: Windows

Expand All @@ -34,42 +29,33 @@ jobs:
- checkout: self
clean: true

- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'
- pwsh: |
dotnet tool uninstall nbgv -g
dotnet tool install nbgv -g --version 3.6.139
nbgv cloud -a
displayName: Version with NBGV
name: NBGV

- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: gitversion.yml
displayName: Use GitVersion
- pwsh: |
$InformationalVersion="$(NBGV_SemVer2)+$(NBGV_GitCommitId)-$(NBGV_BuildingRef)".Replace("refs/heads/","").Replace("/","-")
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;]$InformationalVersion"
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;isOutput=true;]$InformationalVersion"
echo "Informational Version: $InformationalVersion"

displayName: Generate Informational Version
name: NBGV_InformationalVersion

- task: UseDotNet@2
displayName: 'Use .NET SDK'
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 7.0.302
version: 9.0.200

- task: MSBuild@1
inputs:
solution: src/uno.uitest.sln
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /p:Configuration=Release /detailedsummary "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$(GITVERSION.FullSemVer)" "/p:InformationalVersion=$(GITVERSION.InformationalVersion)" /detailedsummary

clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false

- task: DotNetCoreInstaller@0
inputs:
version: '2.1.504'
- pwsh: |
cd src/Uno.UITest.Helpers
dotnet build -c Release /p:PackageVersion=$(NBGV_SemVer2) /p:InformationalVersion=$(NBGV_InformationalVersion) /p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget /bl:$(build.artifactstagingdirectory)/package.binlog
displayName: 'Build packages'

- task: PowerShell@2
displayName: Authenticode Sign Packages
Expand All @@ -91,7 +77,6 @@ jobs:
ArtifactType: Container

- job: Wasm_UITests
container: nv-bionic-wasm

pool:
vmImage: 'ubuntu-latest'
Expand All @@ -108,7 +93,12 @@ jobs:
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 7.0.302
version: 9.0.200

- template: build/templates/dotnet-install-linux.yml
parameters:
# android SDK is skipped because we're installing it in the test script
UnoCheckParameters: '--tfm net9.0-browserwasm'

- bash: |
chmod +x build/wasm-uitest-run.sh
Expand All @@ -126,9 +116,10 @@ jobs:
inputs:
testRunTitle: 'WebAssembly Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
failTaskOnFailedTests: true
testResultsFiles: '$(build.artifactstagingdirectory)/test-results/uitest-wasm.xml'
searchFolder: '$(System.DefaultWorkingDirectory)' # https://github.com/microsoft/azure-pipelines-tasks/issues/10072
failTaskOnMissingResultsFile: true
failTaskOnFailedTests: true

- task: PublishBuildArtifacts@1
condition: always()
Expand All @@ -143,14 +134,15 @@ jobs:
SourceLinkEnabled: false

pool:
vmImage: 'macOS-12'
vmImage: 'macOS-14'

steps:
- checkout: self
clean: true

- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_12_18"
displayName: Select Xamarin Version
- template: build/templates/dotnet-install-mac.yml
parameters:
UnoCheckParameters: '--tfm net9.0-android --skip androidsdk'

- bash: |
chmod +x $(build.sourcesdirectory)/build/android-uitest-run.sh
Expand All @@ -167,7 +159,9 @@ jobs:
inputs:
testRunTitle: 'Android Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
testResultsFiles: '$(build.artifactstagingdirectory)/test-results/uitest-android.xml'
failTaskOnMissingResultsFile: true
failTaskOnFailedTests: true

- task: PublishBuildArtifacts@1
condition: always()
Expand All @@ -180,17 +174,18 @@ jobs:
variables:
CI_Build: true
SourceLinkEnabled: false
XCODE_ROOT: /Applications/Xcode_13.4.1.app
XCODE_ROOT: /Applications/Xcode_16.2.app

pool:
vmImage: 'macOS-12'
vmImage: 'macOS-14'

steps:
- checkout: self
clean: true

- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_12_18"
displayName: Select Xamarin Version
- template: build/templates/dotnet-install-mac.yml
parameters:
UnoCheckParameters: '--tfm net9.0-ios'

- bash: /bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'${XCODE_ROOT};sudo xcode-select --switch ${XCODE_ROOT}/Contents/Developer"
displayName: Select Xcode
Expand All @@ -210,7 +205,9 @@ jobs:
inputs:
testRunTitle: 'iOS Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
testResultsFiles: '$(build.artifactstagingdirectory)/test-results/uitest-ios.xml'
failTaskOnMissingResultsFile: true
failTaskOnFailedTests: true

- task: PublishBuildArtifacts@1
condition: always()
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ To better foster an open, innovative and inclusive community please refer to our

### Report a bug

If you think you've found a bug, please log a new issue in the [Uno Core GitHub issue tracker](https://github.com/nventive/Uno.Core/issues). When filing issues, please use our [bug filing template](.github/ISSUE_TEMPLATE.md).
If you think you've found a bug, please log a new issue in the [Uno Core GitHub issue tracker](https://github.com/unoplatform/Uno.Core/issues). When filing issues, please use our [bug filing template](.github/ISSUE_TEMPLATE.md).
The best way to get your bug fixed is to be as detailed as you can be about the problem.
Providing a minimal project with steps to reproduce the problem is ideal.
Here are questions you can answer before you file a bug to make sure you're not missing any important information.

1. Did you read the [documentation](https://github.com/nventive/Uno.Core/blob/master/doc)?
1. Did you read the [documentation](https://github.com/unoplatform/Uno.Core/blob/master/doc)?
2. Did you include the snippet of broken code in the issue?
3. What are the *EXACT* steps to reproduce this problem?
4. What specific version or build are you using?
Expand All @@ -23,11 +23,11 @@ GitHub supports [markdown](https://help.github.com/articles/github-flavored-mark

### Make a suggestion

If you have an idea for a new feature or enhancement let us know by filing an [issue](https://github.com/nventive/Uno.Core/issues). To help us understand and prioritize your idea please provide as much detail about your scenario and why the feature or enhancement would be useful.
If you have an idea for a new feature or enhancement let us know by filing an [issue](https://github.com/unoplatform/Uno.Core/issues). To help us understand and prioritize your idea please provide as much detail about your scenario and why the feature or enhancement would be useful.

### Ask questions

If you have a question be sure to first checkout our [documentation](https://github.com/nventive/Uno.Core/blob/master/doc). But if you are still stuck, you'll have a better chance of getting help on [StackOverflow](https://stackoverflow.com/questions/tagged/uno-platform) and we'll do our best to answer it. Questions asked there should be tagged with `uno-platform`.
If you have a question be sure to first checkout our [documentation](https://github.com/unoplatform/Uno.Core/blob/master/doc). But if you are still stuck, you'll have a better chance of getting help on [StackOverflow](https://stackoverflow.com/questions/tagged/uno-platform) and we'll do our best to answer it. Questions asked there should be tagged with `uno-platform`.

For a more direct conversation, [our gitter is also a good place to visit](https://gitter.im/uno-platform/Lobby).

Expand Down
4 changes: 2 additions & 2 deletions License.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Uno.Core

Copyright (c) nventive
Copyright (c) Uno Platform, Inc.

All rights reserved.

Expand Down Expand Up @@ -206,4 +206,4 @@ All rights reserved.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
10 changes: 3 additions & 7 deletions build/android-uitest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

## Adjust those variables for your project
export UNO_UITEST_SCREENSHOT_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/screenshots/android
export UNO_UITEST_ANDROIDAPK_PATH=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.Droid/bin/Release/uno.platform.uitestsample.apk
export UNO_UITEST_ANDROIDAPK_PATH=$BUILD_SOURCESDIRECTORY/src/Sample/Sample/bin/Release/net8.0-android/uno.platform.uitestsample-Signed.apk
export UNO_UITEST_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.UITests/Sample.UITests.csproj
export UNO_UITEST_ANDROID_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.Droid/Sample.Droid.csproj
export UNO_UITEST_BINARY=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.UITests/bin/Release/net47/Sample.UITests.dll
export UNO_UITEST_ANDROID_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample/Sample.csproj
export UNO_UITEST_ANDROID_API_LEVEL=28

## Less commonly modified variables
export UNO_TEST_RESULTS_FILE=$BUILD_ARTIFACTSTAGINGDIRECTORY/test-results/uitest-android.xml
export UNO_UITEST_PLATFORM=Android
export UNO_UITEST_NUNIT_VERSION=3.10.0
export UNO_UITEST_NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.7.0/nuget.exe

cd $BUILD_SOURCESDIRECTORY/build
scripts/android-uitest.sh
13 changes: 6 additions & 7 deletions build/ios-uitest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ set -euo pipefail
IFS=$'\n\t'

## Adjust those variables for your project
export UNO_UITEST_IOSBUNDLE_PATH=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.iOS/bin/iPhoneSimulator/Release/Sample.app
export UNO_UITEST_IOSBUNDLE_PATH=$BUILD_SOURCESDIRECTORY/src/Sample/Sample/bin/Release/net8.0-ios/iossimulator-x64/Sample.app
export UNO_UITEST_SCREENSHOT_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/screenshots/ios
export UNO_UITEST_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.UITests/Sample.UITests.csproj
export UNO_UITEST_BINARY=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.UITests/bin/Release/net47/Sample.UITests.dll
export UNO_UITEST_IOS_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample.iOS/Sample.iOS.csproj

## Less commonly modified variables
export UNO_UITEST_IOS_PROJECT=$BUILD_SOURCESDIRECTORY/src/Sample/Sample/Sample.csproj
export UNO_TEST_RESULTS_FILE=$BUILD_ARTIFACTSTAGINGDIRECTORY/test-results/uitest-ios.xml
export UNO_UITEST_PLATFORM=iOS
export UNO_UITEST_NUNIT_VERSION=3.10.0
export UNO_UITEST_NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.7.0/nuget.exe

export UNO_UITEST_SIMULATOR_VERSION="com.apple.CoreSimulator.SimRuntime.iOS-18-1"
export UNO_UITEST_SIMULATOR_NAME="iPad Pro 13-inch (M4)"

cd $BUILD_SOURCESDIRECTORY/build
scripts/ios-uitest.sh
42 changes: 34 additions & 8 deletions build/scripts/android-uitest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,33 @@
set -euo pipefail
IFS=$'\n\t'

cd $BUILD_SOURCESDIRECTORY/build

# This block allows to override the Android SDK
# disabled until hosted agents move to macOS 11
#
export ANDROID_HOME=$BUILD_SOURCESDIRECTORY/build/android-sdk
export ANDROID_SDK_ROOT=$BUILD_SOURCESDIRECTORY/build/android-sdk
export CMDLINETOOLS=commandlinetools-mac-8512546_latest.zip

if [[ ! -d $ANDROID_HOME ]];
then
mkdir -p $ANDROID_HOME
wget https://dl.google.com/android/repository/$CMDLINETOOLS
unzip $CMDLINETOOLS -d $ANDROID_HOME/cmdline-tools
rm $CMDLINETOOLS
mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/latest
fi

# Install AVD files
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-$UNO_UITEST_ANDROID_API_LEVEL;google_apis_playstore;x86_64"
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-$UNO_UITEST_ANDROID_API_LEVEL;google_apis_playstore;x86_64"
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install 'platform-tools' | tr '\r' '\n' | uniq
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install 'platforms;android-34' | tr '\r' '\n' | uniq
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install 'build-tools;34.0.0' | tr '\r' '\n' | uniq
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install 'tools'| tr '\r' '\n' | uniq

# Create emulator
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator --abi "x86_64" -k "system-images;android-$UNO_UITEST_ANDROID_API_LEVEL;google_apis_playstore;x86_64" --force
echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n xamarin_android_emulator --abi "x86_64" -k "system-images;android-$UNO_UITEST_ANDROID_API_LEVEL;google_apis_playstore;x86_64" --force

echo $ANDROID_HOME/emulator/emulator -list-avds

Expand All @@ -19,8 +41,7 @@ $ANDROID_HOME/platform-tools/adb devices
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot -no-window -qemu > /dev/null 2>&1 &

# build the sample, while the emulator is starting
msbuild /r /p:Configuration=Release $UNO_UITEST_PROJECT
msbuild /r /p:Configuration=Release /p:IsUiAutomationMappingEnabled=True $UNO_UITEST_ANDROID_PROJECT
dotnet build -c Release -f net8.0-android -p:TargetFrameworks=net8.0-android $UNO_UITEST_ANDROID_PROJECT -p:RunAOTCompilation=false -p:MtouchUseLlvm=false /bl:$UNO_UITEST_SCREENSHOT_PATH/logs/android-build.binlog

# Wait for the emulator to finish booting
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
Expand All @@ -29,9 +50,14 @@ $ANDROID_HOME/platform-tools/adb devices

echo "Emulator started"

wget $UNO_UITEST_NUGET_URL
mono nuget.exe install NUnit.ConsoleRunner -Version $UNO_UITEST_NUNIT_VERSION

mkdir -p $UNO_UITEST_SCREENSHOT_PATH

mono $BUILD_SOURCESDIRECTORY/build/NUnit.ConsoleRunner.$UNO_UITEST_NUNIT_VERSION/tools/nunit3-console.exe $UNO_UITEST_BINARY || true
dotnet test -c Release \
$UNO_UITEST_PROJECT \
--logger "nunit;LogFileName=$UNO_TEST_RESULTS_FILE" || true

## fail if $UNO_TEST_RESULTS_FILE does not exist
if [ ! -f $UNO_TEST_RESULTS_FILE ]; then
echo "No test results file found at $UNO_TEST_RESULTS_FILE"
exit 1
fi
Loading
Loading