maui/eng/pipelines/handlers.yml

293 строки
10 KiB
YAML
Исходник Обычный вид История

trigger:
branches:
include:
- main
2021-04-24 20:06:28 +03:00
- release/*
2021-03-11 19:23:29 +03:00
tags:
include:
- '*'
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
pr:
branches:
include:
- main
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- main
variables:
- template: /eng/pipelines/common/variables.yml
Make .NET 6 Packable (#13881) * Add some common nupkg properties to everything * Remove project property refactored into directory build props * Remove properties now in common dir build props * Add net6 version of project * More net6 * Only target netstandard2.0 now net4* is no longer needed as there's no more vs2017 support * Clean up strong naming a bit * Update dependencies * Package all the things for build tasks in the -t:Pack * Add more net6 project versions * Clean up whitespace * Needed moar NET6 * Name fixes * Added meta project for packaging and package script * Remove assembly copyright (now duplicates) * Add resizetizer, add params to package script * Disable strong naming for now We need to re-evaluate how we do this a bit, we should probably use the `al` tool to do it now, and I believe the StrongNamer package may not work anymore, but we can do the same thing in a custom target at a later date. * Fix path to tasks assembly * don't build ios on android specific project * Finish rename of toolbox file * - add cake * - fix cake extras * fix the copy for the IDE * Try packing on CI * versions baby! * build release * this should od it * this * oops * Move to an empty folder * Use new symbol formats * no symbols for build tasks and the head * symbol all the things * Compiler error with commented out code XD * oopsies * only build transitive * Try this * log everything * This might work * REPORTS * previews * needed * versions * duh * Update build.cake Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-02 20:36:17 +03:00
- name: LogDirectory
value: $(Build.ArtifactStagingDirectory)/logs
- name: provisionator.xcode
value: '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx'
- name: provisionator.path
value: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
- name: provisionator.extraArguments
value: '--v'
[build] bootstrap a local .\bin\dotnet\ with .NET Workloads (#514) Based on: https://github.com/jonathanpeppers/maui-workload This adds a new `DotNet.csproj` that provisions a local .NET 6 install into `.\bin\dotnet\`. Next, it uses versions defined in `eng/Versions.props` as required by .NET version bumping infrastructure (called Darc): <Project> <PropertyGroup> <MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion> <MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion> <MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion> <MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion> </PropertyGroup> </Project> Next, we can use these versions to consume NuGet packages for workloads: <PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.iOS" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> Then the other packs they depend on: <PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.Android.Sdk.win-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" /> <PackageDownload Include="Microsoft.Android.Sdk.osx-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" /> <PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> After doing this, I can build .NET 6 projects with: > .\bin\dotnet\dotnet.exe build .\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj I can even build MacCatalyst apps on Windows! I updated `build.cake` so the following builds for .NET 6 and opens Visual Studio: > dotnet cake --target=VS-NET6 This is the equivalent of these commands if you want to run them individually: dotnet build src\DotNet\DotNet.csproj .\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks-net6.sln .\bin\dotnet\dotnet build Microsoft.Maui-net6.sln .\eng\dogfood.ps1 ~~ Other Changes ~~ * Rework CI setup to use .\bin\dotnet\dotnet * We don't need boots or URLs anymore * Fixed `MSBuildTests` to use .\bin\dotnet\dotnet if found and fall back to the system `dotnet` * Moved `.nuspec\package.ps1` to `eng\package.ps1` ~~ What problems does this solve? ~~ * MacCatalyst builds on Windows! (offline build that checks C#) * Building Maui always gets you the right things installed. * Maui becoming a .NET workload will be a breeze. We can copy files into `.\bin\dotnet\sdk-manifests` and `.\bin\dotnet\packs`. * We can use Darc to bump dependencies within .NET: https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md
2021-03-22 13:16:06 +03:00
- name: DotNet.Path
value: $(System.DefaultWorkingDirectory)/bin/dotnet/dotnet
parameters:
- name: BuildEverything
type: boolean
default: false
- name: BuildConfigurations
type: object
default:
- Debug
- Release
- name: BuildPlatforms
type: object
default:
- name: windows
poolName: 'Azure Pipelines'
vmImage: windows-latest
bootsAndroid: $(Android.Msi)
bootsiOS: $(iOS.Msi)
artifact: net6-windows
- name: macos
poolName: $(macOSXNet6VmPool)
vmImage: $(macOSXNet6VmImage)
bootsAndroid: $(Android.Pkg)
bootsiOS: $(iOS.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
artifact: net6-macos
- name: PackPlatforms
type: object
default:
- name: windows
poolName: 'Azure Pipelines'
vmImage: windows-latest
bootsAndroid: $(Android.Msi)
bootsiOS: $(iOS.Msi)
artifact: nuget
- name: macos
poolName: 'Azure Pipelines'
vmImage: macos-latest
bootsAndroid: $(Android.Pkg)
bootsiOS: $(iOS.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
artifact: nuget-macos
resources:
repositories:
- repository: xamarin-templates
type: github
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main # still defaults to master even though main is the main branch
stages:
- stage: windows
displayName: Build Windows
jobs:
- ${{ each BuildCondition in parameters.BuildConfigurations }}:
- job: win_hosted_${{ BuildCondition }}
workspace:
clean: all
displayName: Build Windows Phase (${{ BuildCondition }})
condition: or(
${{ parameters.BuildEverything }},
ne(variables['Build.Reason'], 'PullRequest'),
eq('${{ BuildCondition }}', 'Release'))
timeoutInMinutes: 60
pool:
name: $(vs2019VmPool)
vmImage: $(vs2019VmImage)
demands: [ msbuild ]
steps:
- template: common/build-windows.yml
Make .NET 6 Packable (#13881) * Add some common nupkg properties to everything * Remove project property refactored into directory build props * Remove properties now in common dir build props * Add net6 version of project * More net6 * Only target netstandard2.0 now net4* is no longer needed as there's no more vs2017 support * Clean up strong naming a bit * Update dependencies * Package all the things for build tasks in the -t:Pack * Add more net6 project versions * Clean up whitespace * Needed moar NET6 * Name fixes * Added meta project for packaging and package script * Remove assembly copyright (now duplicates) * Add resizetizer, add params to package script * Disable strong naming for now We need to re-evaluate how we do this a bit, we should probably use the `al` tool to do it now, and I believe the StrongNamer package may not work anymore, but we can do the same thing in a custom target at a later date. * Fix path to tasks assembly * don't build ios on android specific project * Finish rename of toolbox file * - add cake * - fix cake extras * fix the copy for the IDE * Try packing on CI * versions baby! * build release * this should od it * this * oops * Move to an empty folder * Use new symbol formats * no symbols for build tasks and the head * symbol all the things * Compiler error with commented out code XD * oopsies * only build transitive * Try this * log everything * This might work * REPORTS * previews * needed * versions * duh * Update build.cake Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-02 20:36:17 +03:00
- stage: build_osx
displayName: iOS
dependsOn: []
jobs:
- job: ios
workspace:
clean: all
displayName: Build ControlGallery iOS
timeoutInMinutes: 120
pool:
name: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
demands:
- sh
- Xamarin.iOS
variables:
provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx'
provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
provisionator.extraArguments : '--v'
steps:
- template: common/controlgallery-ios.yml
- stage: build_android
displayName: Android
dependsOn: []
jobs:
- job: android
workspace:
clean: all
displayName: Build ControlGallery Android
timeoutInMinutes: 120
pool:
name: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
variables:
renderers: 'FAST'
outputfolder: 'newRenderers'
provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx'
provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
provisionator.extraArguments : '--v'
steps:
- template: common/controlgallery-android.yml
- stage: pack_net6
displayName: Pack .NET 6
Make .NET 6 Packable (#13881) * Add some common nupkg properties to everything * Remove project property refactored into directory build props * Remove properties now in common dir build props * Add net6 version of project * More net6 * Only target netstandard2.0 now net4* is no longer needed as there's no more vs2017 support * Clean up strong naming a bit * Update dependencies * Package all the things for build tasks in the -t:Pack * Add more net6 project versions * Clean up whitespace * Needed moar NET6 * Name fixes * Added meta project for packaging and package script * Remove assembly copyright (now duplicates) * Add resizetizer, add params to package script * Disable strong naming for now We need to re-evaluate how we do this a bit, we should probably use the `al` tool to do it now, and I believe the StrongNamer package may not work anymore, but we can do the same thing in a custom target at a later date. * Fix path to tasks assembly * don't build ios on android specific project * Finish rename of toolbox file * - add cake * - fix cake extras * fix the copy for the IDE * Try packing on CI * versions baby! * build release * this should od it * this * oops * Move to an empty folder * Use new symbol formats * no symbols for build tasks and the head * symbol all the things * Compiler error with commented out code XD * oopsies * only build transitive * Try this * log everything * This might work * REPORTS * previews * needed * versions * duh * Update build.cake Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-02 20:36:17 +03:00
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.PackPlatforms }}:
- job: pack_net6_${{ BuildPlatform.name }}
workspace:
clean: all
displayName: Pack .NET 6 (${{ BuildPlatform.name }})
timeoutInMinutes: 120
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
steps:
- ${{ if eq(BuildPlatform.name, 'macos') }}:
- bash: |
set -x
mkdir -p ~/Library/Preferences/Xamarin
rm -f ~/Library/Preferences/Xamarin/Settings.plist
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
cat ~/Library/Preferences/Xamarin/Settings.plist || true
displayName: configure vsmac xcode
[build] Update to .NET 6 Preview 4 (#796) * [build] Update to .NET 6 Preview 4 Brings in Preview 4 updates for the Android, MaciOS, and .NET SDks. Initial build attempts were failing with hundreds of errors: D:\a\1\s\src\Essentials\src\Connectivity\Connectivity.ios.tvos.macos.cs(12,70): error BI1234: 'CTCellularData' is obsolete: 'Starting with ios14.0 Use the 'CallKit' API instead.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Essentials\src\Compass\Compass.ios.cs(31,6): error CA1416: This call site is reachable on: 'iOS' 13.6 and later. 'CLLocationManager.HeadingFilter' is only supported on: 'macos' 11.0 and later. [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Core\src\Platform\MaciOS\ColorExtensions.cs(64,13): error CA1416: This call site is reachable on: 'MacCatalyst' 13.5 and later. 'UIColor.SystemBackgroundColor.get' is supported on: 'ios' 13.0 and later. [D:\a\1\s\src\Core\src\Core-net6.csproj] CSC : error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.InteropServices.PlatformCompatibilityAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [D:\a\1\s\src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj] The [platform compatibility analyzer][0] has been disabled for now, and it can be enabled locally to work through the few hundred errors in future PRs. Once these issues were sorted, there were a handful of other breaks that I've attempted to fix: D:\a\1\s\src\Essentials\src\AssemblyInfo\AssemblyInfo.ios.tvos.watchos.macos.cs(3,12): error CS0618: 'LinkerSafeAttribute' is obsolete: 'Replace with '[assembly: System.Reflection.AssemblyMetadata ("IsTrimmable", "True")]'.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\Renderers\TabbedRenderer.cs(422,33): error CS1503: Argument 1: cannot convert from 'UIKit.UIStringAttributes' to 'UIKit.UITextAttributes' [D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(106,23): error CS0114: 'CarouselViewController.DraggingStarted(UIScrollView)' hides inherited member 'UICollectionViewController.DraggingStarted(UIScrollView)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(117,23): error CS0114: 'CarouselViewController.DraggingEnded(UIScrollView, bool)' hides inherited member 'UICollectionViewController.DraggingEnded(UIScrollView, bool)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] Finally it seems JDK 14 was being preferred on macOS machines in CI, so I've set `$(JI_JAVA_HOME)` to the [pre-installed JDK 11][1]. [0]: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416 [1]: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210419.2/images/macos/macos-10.15-Readme.md#java * Apply feedback, bump p4 bits, provision xcode 12.5 rc * Use Big Sur pool, clean up duplicate variable declaration * Revert "Use Big Sur pool, clean up duplicate variable declaration" This reverts commit b91482e10cdef99158e9060c9bf51298a74d89a8. * Disable linker for ios and catalyst Co-authored-by: Rui Marinho <me@ruimarinho.net>
2021-04-24 13:32:18 +03:00
- ${{ if eq(BuildPlatform.name, 'macos') }}:
- script: echo '##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)'
displayName: set JI_JAVA_HOME
[build] bootstrap a local .\bin\dotnet\ with .NET Workloads (#514) Based on: https://github.com/jonathanpeppers/maui-workload This adds a new `DotNet.csproj` that provisions a local .NET 6 install into `.\bin\dotnet\`. Next, it uses versions defined in `eng/Versions.props` as required by .NET version bumping infrastructure (called Darc): <Project> <PropertyGroup> <MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion> <MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion> <MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion> <MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion> </PropertyGroup> </Project> Next, we can use these versions to consume NuGet packages for workloads: <PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.iOS" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> Then the other packs they depend on: <PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.Android.Sdk.win-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" /> <PackageDownload Include="Microsoft.Android.Sdk.osx-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" /> <PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> After doing this, I can build .NET 6 projects with: > .\bin\dotnet\dotnet.exe build .\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj I can even build MacCatalyst apps on Windows! I updated `build.cake` so the following builds for .NET 6 and opens Visual Studio: > dotnet cake --target=VS-NET6 This is the equivalent of these commands if you want to run them individually: dotnet build src\DotNet\DotNet.csproj .\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks-net6.sln .\bin\dotnet\dotnet build Microsoft.Maui-net6.sln .\eng\dogfood.ps1 ~~ Other Changes ~~ * Rework CI setup to use .\bin\dotnet\dotnet * We don't need boots or URLs anymore * Fixed `MSBuildTests` to use .\bin\dotnet\dotnet if found and fall back to the system `dotnet` * Moved `.nuspec\package.ps1` to `eng\package.ps1` ~~ What problems does this solve? ~~ * MacCatalyst builds on Windows! (offline build that checks C#) * Building Maui always gets you the right things installed. * Maui becoming a .NET workload will be a breeze. We can copy files into `.\bin\dotnet\sdk-manifests` and `.\bin\dotnet\packs`. * We can use Darc to bump dependencies within .NET: https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md
2021-03-22 13:16:06 +03:00
- pwsh: ./eng/package.ps1 -configuration Release
displayName: pack nugets
errorActionPreference: stop
- task: CopyFiles@2
displayName: 'Copy SignList.xml Files'
inputs:
Contents: |
**/Microsoft.Maui.*.nupkg
**/Microsoft.Maui.*.snupkg
**/Microsoft.AspNetCore.Components.WebView.Maui.*.nupkg
**/Microsoft.AspNetCore.Components.WebView.Maui.*.snupkg
**/SignList.xml
TargetFolder: $(build.artifactstagingdirectory)
flattenFolders: true
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish artifacts
inputs:
ArtifactName: ${{ BuildPlatform.artifact }}
- stage: build_net6
displayName: Build .NET 6
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildCondition in parameters.BuildConfigurations }}:
- job: build_net6_${{ BuildPlatform.name }}_${{ BuildCondition }}
workspace:
clean: all
displayName: Build .NET 6 (${{ BuildPlatform.name }} | ${{ BuildCondition }})
timeoutInMinutes: 120
condition: or(
${{ parameters.BuildEverything }},
ne(variables['Build.Reason'], 'PullRequest'),
WinUI (#548) * WinUI3 Desktop Head * - Fix up Compatibility Proiect * - fix conditionals * - temp remove windows pack restriction * - namespace fixes * - winui * - add WinUI to SLN * - change handlers to windows * - fixes * - additional handlers * - essentials fixes * - msbuild * - add more * - fix comment * - transitive * - check for windows * - windows conditional * - vs path * - restore;build * - remove target * - build first * -remove * Building again! * - add global.json file * - set MauiPlatforms * - remove things * Make it at least run * - split out restore/build * - magic? * - 5 * Put stuff here and try more * - add restore * - fix essentials * Get it closer * Go simple or go home * diffs * - net5 checks * - winui fixes * - files * - preview versions * - maybe? * - add code back in * Update package.ps1 Fix usage of $dotnet, moved around if and try-finally * Whoops * Update package.ps1 Add /restore flag, fix double // * - fixed pri runtime paths * - copy xbf files around * - fix * - fix path * Fonts * - windows only nugets * - fix targets * Fonts now working * ws * //TODO WINUI3 * More mappings * - builds * - remove props * - props * Button has all the things done so far * - layout basics * Don't reference the build tasks, then all is well * - shims * - fix shim measuring * - fix resource loading * Uncomment the things in Forms * - tweak measure * update * Remove old code * Revert "Remove old code" This reverts commit 2b63ebab0e5fdc180360e5aa4ee04c3df964a8cc. * Add image for goodness * - measure * - always build winui for core * - add created handlers * - add mappers * Build windows and macos now * Always pack * - call arrange on the children again * - fix * - embrace it * - fix condition * - maybe * This might work * that * - fix * - fix * - no more * Use the correct path to the image * No more SimpleApp * This actually works... Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
2021-03-25 17:02:01 +03:00
eq('${{ BuildCondition }}', 'Release'))
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
steps:
- ${{ if eq(BuildPlatform.name, 'macos') }}:
- bash: |
set -x
mkdir -p ~/Library/Preferences/Xamarin
rm -f ~/Library/Preferences/Xamarin/Settings.plist
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
cat ~/Library/Preferences/Xamarin/Settings.plist || true
displayName: configure vsmac xcode
[build] Update to .NET 6 Preview 4 (#796) * [build] Update to .NET 6 Preview 4 Brings in Preview 4 updates for the Android, MaciOS, and .NET SDks. Initial build attempts were failing with hundreds of errors: D:\a\1\s\src\Essentials\src\Connectivity\Connectivity.ios.tvos.macos.cs(12,70): error BI1234: 'CTCellularData' is obsolete: 'Starting with ios14.0 Use the 'CallKit' API instead.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Essentials\src\Compass\Compass.ios.cs(31,6): error CA1416: This call site is reachable on: 'iOS' 13.6 and later. 'CLLocationManager.HeadingFilter' is only supported on: 'macos' 11.0 and later. [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Core\src\Platform\MaciOS\ColorExtensions.cs(64,13): error CA1416: This call site is reachable on: 'MacCatalyst' 13.5 and later. 'UIColor.SystemBackgroundColor.get' is supported on: 'ios' 13.0 and later. [D:\a\1\s\src\Core\src\Core-net6.csproj] CSC : error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.InteropServices.PlatformCompatibilityAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [D:\a\1\s\src\BlazorWebView\src\core\Microsoft.AspNetCore.Components.WebView.Maui.csproj] The [platform compatibility analyzer][0] has been disabled for now, and it can be enabled locally to work through the few hundred errors in future PRs. Once these issues were sorted, there were a handful of other breaks that I've attempted to fix: D:\a\1\s\src\Essentials\src\AssemblyInfo\AssemblyInfo.ios.tvos.watchos.macos.cs(3,12): error CS0618: 'LinkerSafeAttribute' is obsolete: 'Replace with '[assembly: System.Reflection.AssemblyMetadata ("IsTrimmable", "True")]'.' [D:\a\1\s\src\Essentials\src\Essentials-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\Renderers\TabbedRenderer.cs(422,33): error CS1503: Argument 1: cannot convert from 'UIKit.UIStringAttributes' to 'UIKit.UITextAttributes' [D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(106,23): error CS0114: 'CarouselViewController.DraggingStarted(UIScrollView)' hides inherited member 'UICollectionViewController.DraggingStarted(UIScrollView)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] D:\a\1\s\src\Compatibility\Core\src\iOS\CollectionView\CarouselViewController.cs(117,23): error CS0114: 'CarouselViewController.DraggingEnded(UIScrollView, bool)' hides inherited member 'UICollectionViewController.DraggingEnded(UIScrollView, bool)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [ D:\a\1\s\src\Compatibility\Core\src\Compatibility-net6.csproj] Finally it seems JDK 14 was being preferred on macOS machines in CI, so I've set `$(JI_JAVA_HOME)` to the [pre-installed JDK 11][1]. [0]: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416 [1]: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210419.2/images/macos/macos-10.15-Readme.md#java * Apply feedback, bump p4 bits, provision xcode 12.5 rc * Use Big Sur pool, clean up duplicate variable declaration * Revert "Use Big Sur pool, clean up duplicate variable declaration" This reverts commit b91482e10cdef99158e9060c9bf51298a74d89a8. * Disable linker for ios and catalyst Co-authored-by: Rui Marinho <me@ruimarinho.net>
2021-04-24 13:32:18 +03:00
- ${{ if eq(BuildPlatform.name, 'macos') }}:
- script: echo '##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)'
displayName: set JI_JAVA_HOME
- pwsh: |
[build] bootstrap a local .\bin\dotnet\ with .NET Workloads (#514) Based on: https://github.com/jonathanpeppers/maui-workload This adds a new `DotNet.csproj` that provisions a local .NET 6 install into `.\bin\dotnet\`. Next, it uses versions defined in `eng/Versions.props` as required by .NET version bumping infrastructure (called Darc): <Project> <PropertyGroup> <MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion> <MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion> <MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion> <MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion> </PropertyGroup> </Project> Next, we can use these versions to consume NuGet packages for workloads: <PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.NET.Workload.iOS" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> Then the other packs they depend on: <PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.Android.Sdk.win-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" /> <PackageDownload Include="Microsoft.Android.Sdk.osx-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" /> <PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> <PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" /> After doing this, I can build .NET 6 projects with: > .\bin\dotnet\dotnet.exe build .\src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj I can even build MacCatalyst apps on Windows! I updated `build.cake` so the following builds for .NET 6 and opens Visual Studio: > dotnet cake --target=VS-NET6 This is the equivalent of these commands if you want to run them individually: dotnet build src\DotNet\DotNet.csproj .\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks-net6.sln .\bin\dotnet\dotnet build Microsoft.Maui-net6.sln .\eng\dogfood.ps1 ~~ Other Changes ~~ * Rework CI setup to use .\bin\dotnet\dotnet * We don't need boots or URLs anymore * Fixed `MSBuildTests` to use .\bin\dotnet\dotnet if found and fall back to the system `dotnet` * Moved `.nuspec\package.ps1` to `eng\package.ps1` ~~ What problems does this solve? ~~ * MacCatalyst builds on Windows! (offline build that checks C#) * Building Maui always gets you the right things installed. * Maui becoming a .NET workload will be a breeze. We can copy files into `.\bin\dotnet\sdk-manifests` and `.\bin\dotnet\packs`. * We can use Darc to bump dependencies within .NET: https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md
2021-03-22 13:16:06 +03:00
& dotnet build src/DotNet/DotNet.csproj -bl:$(LogDirectory)/$(BuildConfiguration)-dotnet.binlog
& $(DotNet.Path) build Microsoft.Maui.BuildTasks-net6.sln -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-buildtasks.binlog
& $(DotNet.Path) build Microsoft.Maui-net6.sln -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration).binlog
displayName: build samples
errorActionPreference: stop
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish artifacts
inputs:
ArtifactName: ${{ BuildPlatform.artifact }}
2021-03-04 22:41:31 +03:00
- template: common/device-tests.yml
parameters:
${{ if or(parameters.BuildEverything, ne(variables['Build.Reason'], 'PullRequest')) }}:
androidApiLevels: [ 30, 29, 21 ]
iosVersions: [ 'latest' ]
projects:
- name: essentials
desc: Essentials
android: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests.Android/Essentials.DeviceTests.Android.csproj
ios: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests.iOS/Essentials.DeviceTests.iOS.csproj
- name: core
desc: Core
android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests.Android/Core.DeviceTests.Android.csproj
ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests.iOS/Core.DeviceTests.iOS.csproj
# only sign using the private server
2021-03-04 22:41:31 +03:00
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- stage: nuget_signing
2021-03-06 04:36:17 +03:00
dependsOn: pack_net6
2021-03-04 22:41:31 +03:00
displayName: Sign Nuget
jobs:
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
parameters:
teamName: Maui
usePipelineArtifactTasks: false
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
signedArtifactName: nuget
signedArtifactPath: signed
displayName: Sign Phase
condition: and(succeeded(), ne(variables['signVmImage'], ''), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'],'refs/tags/'))))