* Update azure-pipelines.yml

* Fix build

---------

Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
This commit is contained in:
Gerald Versluis 2023-02-10 23:17:15 +01:00 коммит произвёл GitHub
Родитель b55322ac95
Коммит 6d2d2d90ba
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 29 добавлений и 21 удалений

Просмотреть файл

@ -17,7 +17,6 @@ variables:
PathToSamplesSln: 'samples/XCT.Sample.sln'
PathToCommunityToolkitUnitTestCsproj: 'src/CommunityToolkit/Xamarin.CommunityToolkit.UnitTests/Xamarin.CommunityToolkit.UnitTests.csproj'
PathToMarkupUnitTestCsproj: 'src/Markup/Xamarin.CommunityToolkit.Markup.UnitTests/Xamarin.CommunityToolkit.Markup.UnitTests.csproj'
PathToMsBuildOnMacOS: 'mono /Applications/Visual\ studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/MSBuild.dll'
Codeql.Enabled: true
resources:
@ -349,15 +348,34 @@ jobs:
version: $(NETCORE_TEST_VERSION_2_1)
includePreviewVersions: false
- task: CmdLine@2
displayName: 'Build Markup'
# restore, build and pack the packages
- task: MSBuild@1
displayName: Build Xamarin.CommunityToolkit.csproj
inputs:
script: '$(PathToMsBuildOnMacOS) $(PathToMarkupCsproj) /p:Configuration=Release /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
solution: $(PathToCommunityToolkitCsproj)
configuration: Release
msbuildArguments: '/restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
- task: CmdLine@2
displayName: 'Build Community Toolkit'
- task: MSBuild@1
displayName: Pack Community Toolkit NuGets
inputs:
script: '$(PathToMsBuildOnMacOS) $(PathToCommunityToolkitCsproj) /p:Configuration=Release /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
solution: $(PathToCommunityToolkitCsproj)
configuration: Release
msbuildArguments: '/t:Pack /p:PackageVersion=$(NugetPackageVersion)'
- task: MSBuild@1
displayName: Build Markup Project
inputs:
solution: $(PathToMarkupCsproj)
configuration: Release
msbuildArguments: '/restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
- task: MSBuild@1
displayName: Pack Markup NuGet
inputs:
solution: $(PathToMarkupCsproj)
configuration: Release
msbuildArguments: '/t:Pack /p:PackageVersion=$(NugetPackageVersion)'
- task: CmdLine@2
displayName: 'Run Markup Unit Tests'
@ -369,16 +387,6 @@ jobs:
inputs:
script: 'dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release -p:BuildInParallel=false'
- task: CmdLine@2
displayName: 'Pack Markup NuGets'
inputs:
script: '$(PathToMsBuildOnMacOS) $(PathToMarkupUnitTestCsproj) /p:Configuration=Release /t:Pack /p:PackageVersion=$(NugetPackageVersion)'
- task: CmdLine@2
displayName: 'Pack CommunityToolkit NuGets'
inputs:
script: '$(PathToMsBuildOnMacOS) $(PathToCommunityToolkitCsproj) /p:Configuration=Release /t:Pack /p:PackageVersion=$(NugetPackageVersion)'
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: sign-artifacts/jobs/v2.yml@internal-templates
parameters:

Просмотреть файл

@ -78,7 +78,7 @@ namespace Xamarin.CommunityToolkit.UI.Views
}
else if (uriSource.Uri != null)
{
asset = AVUrlAsset.Create(NSUrl.FromString(uriSource.Uri.AbsoluteUri));
asset = AVUrlAsset.Create(NSUrl.FromString(uriSource.Uri.AbsoluteUri) ?? throw new ArgumentException("Invalid Uri", "Source"));
}
else
{
@ -88,7 +88,7 @@ namespace Xamarin.CommunityToolkit.UI.Views
else
{
if (Element.Source is XCT.FileMediaSource fileSource)
asset = AVAsset.FromUrl(NSUrl.FromFilename(fileSource.File));
asset = AVAsset.FromUrl(NSUrl.FromFilename(fileSource.File ?? throw new ArgumentException("Invalid file", "Source")));
}
_ = asset ?? throw new NullReferenceException();