Skip to content
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

build: Few build adjustments to reduce flakiness (backport #700) #702

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 0 additions & 1 deletion build/workflow/stage-build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:

- task: MSBuild@1
displayName: 'Build solution'
retryCountOnTaskFailure: 3
inputs:
solution: src/Uno.Toolkit.sln
configuration: Release
Expand Down
4 changes: 4 additions & 0 deletions samples/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<<<<<<< HEAD
=======
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.7.0-2.final" />
>>>>>>> f622a0d (build: Few build adjustments to reduce flakiness (#700))
Xiaoy312 marked this conversation as resolved.
Show resolved Hide resolved
<!--
If, in the same solution, you are referencing a project that uses https://github.com/onovotny/MSBuildSdkExtras,
you need to make sure that the version provided here matches https://github.com/novotnyllc/MSBuildSdkExtras/blob/main/Source/MSBuild.Sdk.Extras/DefaultItems/ImplicitPackages.targets#L11.
Expand Down
9 changes: 9 additions & 0 deletions samples/Uno.Toolkit.Samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<ItemGroup>
<!-- Remove WinUI files (Ctrl+F: UWP_WinUI_Removal) -->
<Page Remove="$(MSBuildThisFileDirectory)**\*.WinUI.xaml" Condition="'$(FrameworkLineage)' == 'UWP'" />
<Compile Remove="$(MSBuildThisFileDirectory)**\*.WinUI.xaml.cs" Condition="'$(FrameworkLineage)' == 'UWP'" />
</ItemGroup>
</Project>
22 changes: 21 additions & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
<Import Project="Directory.UnoMetadata.targets" />
</Project>
<<<<<<< HEAD
</Project>
=======

<!-- This is a workaround, should be removed when this issue is fixed: https://github.com/unoplatform/uno/issues/13167 -->
<!-- Without this, the build gets flaky and sometimes fails with this error -->
<!-- C:\hostedtoolcache\windows\dotnet\sdk\7.0.306\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5019: File not found: 'D:\a\1\s\src\library\Uno.Toolkit.Cupertino\bin\Uno.Toolkit.WinUI.Cupertino\Release\net7.0-ios\Uno.Toolkit.WinUI.Cupertino.uprimarker'. [D:\a\1\s\src\library\Uno.Toolkit.Cupertino\Uno.Toolkit.WinUI.Cupertino.csproj] -->
<!-- Without this workaround target, what happens is that _UnoGeneratePriMarker was run before both _UnoAssetsGetCopyToPublishDirectory and finds ContentWithTargetPath being empty, so it does nothing -->
<!-- Then later, _UnoAssetsGetCopyToPublishDirectory is run and ContentWithTargetPath is now added, and NuGet packaging now expects the uprimarker to be present -->
<!-- Note that this error can go away with restarts, so it's a race condition -->
<Target Name="_WorkaroundBuildFlakiness"
BeforeTargets="_UnoGeneratePriMarker">
<ItemGroup>
<ContentWithTargetPath Include="@(_TransitiveItemsToCopyToOutputDirectory)">
<TargetPath>%(TargetPath)</TargetPath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ContentWithTargetPath>
</ItemGroup>
</Target>
</Project>
>>>>>>> f622a0d (build: Few build adjustments to reduce flakiness (#700))
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageVersion Include="Uno.UITest.Xamarin" Version="1.1.0-dev.32" />
<PackageVersion Include="Xamarin.UITest" Version="4.1.0" />
<PackageVersion Include="MSTest.TestFramework" Version="2.1.2" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.5.0-2.final" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.7.0-2.final" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0-preview1.22518.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ItemGroup Condition="$(_IsWindowsWinUI)">
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />

<Page Remove="Generated\*.xaml" />
</ItemGroup>

Expand Down
Loading