Skip to content

Commit b6bc500

Browse files
mergify[bot]kazo0
andauthored
chore: update from canary (#1381) (#1382)
Co-authored-by: Steve Bilogan <[email protected]>
1 parent c700d45 commit b6bc500

File tree

12 files changed

+72
-37
lines changed

12 files changed

+72
-37
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<UnoEnableXamlFuzzyMatching>false</UnoEnableXamlFuzzyMatching>
4+
<!-- Required by uno 6.0 (WinRT.Runtime.dll >= 2.2.0) -->
5+
<WindowsSdkPackageVersion>10.0.19041.57</WindowsSdkPackageVersion>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
47
</PropertyGroup>
58
</Project>

build/updaterconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"PackageId": "Uno.Wasm.Bootstrap",
4+
"UpdatedVersion": "0.0.0.0",
5+
"UpgradePolicy": "Minor"
6+
},
7+
{
8+
"PackageId": "Uno.Wasm.Bootstrap.DevServer",
9+
"UpdatedVersion": "0.0.0.0",
10+
"UpgradePolicy": "Minor"
11+
}
12+
]

build/workflow/scripts/android-uitest-run.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ then
1616
export TEST_FILTERS="FullyQualifiedName ~ Uno.Toolkit.UITest.RuntimeTests";
1717
fi
1818

19+
if [ "$XAML_FLAVOR_BUILD" == 'UWP' ];
20+
then
21+
export SAMPLEAPP_NAME="uno.platform.toolkit_uwp";
22+
elif [ "$XAML_FLAVOR_BUILD" == 'WinUI' ];
23+
then
24+
export SAMPLEAPP_NAME="uno.platform.toolkit";
25+
fi
26+
1927
export UNO_UITEST_PLATFORM=Android
2028
export BASE_ARTIFACTS_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/android/$UITEST_TEST_MODE_NAME
2129
export UNO_UITEST_SCREENSHOT_PATH=$BASE_ARTIFACTS_PATH/screenshots
@@ -113,7 +121,7 @@ then
113121
$ANDROID_HOME/platform-tools/adb devices
114122

115123
# Start emulator in background
116-
nohup $ANDROID_HOME/emulator/emulator -avd "$AVD_NAME" -skin 1280x800 -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim > $UNO_UITEST_SCREENSHOT_PATH/android-emulator-log.txt 2>&1 &
124+
nohup $ANDROID_HOME/emulator/emulator -avd "$AVD_NAME" -skin 1280x800 -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -prop ro.debuggable=1 > $UNO_UITEST_SCREENSHOT_PATH/android-emulator-log.txt 2>&1 &
117125

118126
# Wait for the emulator to finish booting
119127
source $BUILD_SOURCESDIRECTORY/build/workflow/scripts/android-uitest-wait-systemui.sh 500
@@ -152,8 +160,11 @@ dotnet test \
152160
-v m \
153161
|| true
154162

155-
## Copy the results file to the results folder
156-
cp $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH $BASE_ARTIFACTS_PATH
163+
164+
if [[ -f $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH ]]; then
165+
## Copy the results file to the results folder
166+
cp $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH $BASE_ARTIFACTS_PATH
167+
fi
157168

158169
## Dump the emulator's system log
159170
$ANDROID_HOME/platform-tools/adb shell logcat -d > $UNO_UITEST_SCREENSHOT_PATH/android-device-log.txt

build/workflow/scripts/ios-uitest-run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ dotnet test \
9797
echo "Current system date"
9898
date
9999

100-
## Copy the results file to the results folder
101-
cp $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH $BASE_ARTIFACTS_PATH
100+
if [[ -f $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH ]]; then
101+
## Copy the results file to the results folder
102+
cp $UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH $BASE_ARTIFACTS_PATH
103+
fi
102104

103105
# export the simulator logs
104106
export LOG_FILEPATH=$UNO_UITEST_SCREENSHOT_PATH/_logs

build/workflow/stage-build-ios.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ jobs:
104104
parameters:
105105
UnoCheckParameters: '--tfm net9.0-ios'
106106

107-
- template: templates/xcode-select.yml
108-
parameters:
109-
xCodeRoot: $(XCODE_ROOT)
110-
111107
- template: templates/canary-updater.yml
112108

113109
- template: templates/xcode-select.yml

build/workflow/stage-build-packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
vmImage: windows-2022
66

77
steps:
8+
- template: templates/canary-updater.yml
89
- template: templates/gitversion.yml
910
- template: templates/dotnet-workload-install-windows.yml
1011

build/workflow/stage-uitests-ios.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
- checkout: self
3131
clean: true
3232

33+
- template: templates/dotnet-workload-install-mac.yml
34+
- template: templates/canary-updater.yml
35+
3336
- task: DownloadBuildArtifacts@0
3437
displayName: 'Download iOS Samples App'
3538
inputs:

build/workflow/templates/canary-updater.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,14 @@ steps:
44
retryCountOnTaskFailure: 3
55
condition: eq(variables['IsCanaryBranch'], true)
66
inputs:
7-
solution: 'src/Uno.Toolkit.sln'
7+
solution: '$(build.sourcesdirectory)'
88
branchToMerge: main
99
summaryFile: '$(Build.ArtifactStagingDirectory)/Canary.md'
1010
resultFile: '$(Build.ArtifactStagingDirectory)/result.json'
11-
nugetUpdaterVersion: 1.1.1
11+
nugetUpdaterVersion: '1.2.10'
1212
packageAuthor: 'Uno Platform,unoplatform'
1313
additionalPublicSources: 'https://pkgs.dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_packaging/unoplatformdev/nuget/v3/index.json'
1414

1515
- powershell: |
1616
dotnet tool uninstall uno.nuget.updater.tool --tool-path $(Agent.TempDirectory)
17-
condition: eq(variables['IsCanaryBranch'], true)
18-
19-
- pwsh: |
20-
gci -r -include "info.plist" |
21-
foreach-object {
22-
$a = $_.fullname; ( get-content $a ) |
23-
foreach-object { $_ -replace "<string>uno.platform.toolkit-uwp</string>","<string>uno.platform.toolkit-uwp-canary</string>" -replace "<string>uno.platform.toolkit</string>","<string>uno.platform.toolkit-canary</string>" } |
24-
set-content $a }
25-
displayName: 'Adjust info.plist bundle name'
26-
condition: eq(variables['IsCanaryBranch'], true)
27-
28-
- pwsh: |
29-
gci -r -include AndroidManifest.xml |
30-
foreach-object {
31-
$a = $_.fullname; ( get-content $a ) |
32-
foreach-object { $_ -replace 'package="uno.platform.toolkit-uwp"','package="uno.platform.toolkit-uwp-canary"' -replace 'package="uno.platform.toolkit"','package="uno.platform.toolkit-canary"' } |
33-
set-content $a }
34-
displayName: 'Adjust AndroidManifest.xml package name'
3517
condition: eq(variables['IsCanaryBranch'], true)

samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.csproj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Uno.Sdk.Private">
1+
<Project Sdk="Uno.Sdk.Private">
22
<PropertyGroup>
33
<TargetFrameworks Condition="'$(SamplesTargetFrameworkOverride)'!=''">$(SamplesTargetFrameworkOverride)</TargetFrameworks>
44
<TargetFrameworks Condition="'$(SamplesTargetFrameworkOverride)'==''">net9.0-android;net9.0-ios;net9.0-maccatalyst;net9.0-windows10.0.26100;net9.0-browserwasm;net9.0-desktop</TargetFrameworks>
@@ -10,6 +10,7 @@
1010
<ApplicationTitle>Uno Toolkit Samples</ApplicationTitle>
1111
<!-- App Identifier -->
1212
<ApplicationId>uno.platform.toolkit</ApplicationId>
13+
<ApplicationId Condition="'$(IsCanaryBranch)'=='true'">$(ApplicationId)-canary</ApplicationId>
1314
<!-- Versions -->
1415
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
1516
<ApplicationVersion>1</ApplicationVersion>
@@ -72,4 +73,18 @@
7273
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
7374
</PropertyGroup>
7475

76+
<ItemGroup Condition="$(IsWinAppSdk)">
77+
<!--
78+
If you encounter this error message:
79+
80+
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll. Please update to a newer .NET SDK in order to reference this assembly.
81+
82+
This means that the two packages below must be aligned with the "build" version number of
83+
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
84+
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
85+
-->
86+
87+
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.22621.57" />
88+
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.22621.57" />
89+
</ItemGroup>
7590
</Project>

src/Uno.Toolkit.RuntimeTests/Tests/AutoLayoutTest.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,16 +760,20 @@ public async Task When_Hug_With_CounterAlignment()
760760
SUT.Children.Add(textBlock);
761761
SUT.Children.Add(button);
762762

763-
await UnitTestUIContentHelperEx.SetContentAndWait(SUT);
763+
#if __ANDROID__
764+
// TODO: Remove workaround after this issue is fixed https://github.com/unoplatform/uno.toolkit.ui/issues/1051
765+
var border = new Border();
766+
border.Child = SUT;
764767

768+
await UnitTestUIContentHelperEx.SetContentAndWait(border);
769+
#else
770+
await UnitTestUIContentHelperEx.SetContentAndWait(SUT);
771+
#endif
765772

766773
var textBlockTransform = textBlock.TransformToVisual(SUT).TransformPoint(new Windows.Foundation.Point(0, 0));
767774
var buttonTransform = button.TransformToVisual(SUT).TransformPoint(new Windows.Foundation.Point(0, 0));
768775

769-
var autoLayoutAcutalWidth = SUT.ActualWidth / 2;
770-
var textBlockCenter = textBlock.ActualWidth / 2;
771-
772-
textBlockTransform.X.Should().BeApproximately(autoLayoutAcutalWidth - textBlockCenter, precision: 1d);
776+
textBlockTransform.X.Should().BeApproximately((SUT.ActualWidth / 2) - (textBlock.ActualWidth / 2), precision: 1d);
773777
buttonTransform.X.Should().BeApproximately(SUT.ActualWidth - button.ActualWidth, precision: 1d);
774778
}
775779

src/Uno.Toolkit.UI/Controls/NavigationBar/NavigationBarRenderer.Android.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected override void Render()
187187
}
188188
var native = Native;
189189
var element = Element;
190-
if (element == null)
190+
if (element == null || native == null)
191191
{
192192
return;
193193
}

src/Uno.Toolkit.UI/Controls/SafeArea/SafeArea.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ private static Rect GetVisibleBounds(Rect? safeAreaOverride = null, bool withSof
224224
var visibleBounds = safeAreaOverride?.IsEmptyOrZero() ?? true
225225
? ApplicationView.GetForCurrentView().VisibleBounds
226226
: safeAreaOverride.GetValueOrDefault();
227+
228+
if (!(XamlWindow.Current is { } xamlWindow))
229+
{
230+
return new();
231+
}
232+
227233
#if __ANDROID__
228234
var statusBarOffset = 0d;
229235
if (!XamlWindow.Current!.IsStatusBarTranslucent())
@@ -636,7 +642,7 @@ internal void OnSafeAreaOverrideChanged(Thickness? oldValue, Thickness? newValue
636642

637643
internal void UpdateSafeAreaOverride()
638644
{
639-
if (Owner is { } owner)
645+
if (Owner is { } owner && XamlWindow.Current is { } xamlWindow)
640646
{
641647
var safeAreaOverride = GetSafeAreaOverride(owner);
642648

0 commit comments

Comments
 (0)