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

[ci] Add support to net6.0 for multi-targeting in VS #7261

Merged
merged 3 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 23 additions & 5 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,18 @@ stages:
- template: yaml-templates/run-msbuild-mac-tests.yaml
parameters:
job_name: mac_msbuild_tests_0
nunit_categories: '|| cat == SmokeTests'
job_suffix: One .NET
nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))'
target_framework: 'net6.0'
provisionatorChannel: ${{ parameters.provisionatorChannel }}

# Xamarin.Android (Smoke Tests MSBuild - Win-0)
- template: yaml-templates\run-msbuild-win-tests.yaml
parameters:
job_name: win_msbuild_tests_0
nunit_categories: '|| cat == SmokeTests'
job_name: win_dotnet_tests_0
job_suffix: One .NET
nunit_categories: '| (TestCategory = SmokeTests $(DotNetNUnitCategories))'
target_framework: 'net6.0'
provisionatorChannel: ${{ parameters.provisionatorChannel }}

# Check - "Xamarin.Android (Smoke Tests MSBuild Emulator - macOS)"
Expand Down Expand Up @@ -1409,7 +1413,7 @@ stages:
usePipelineArtifactTasks: true

# Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)"
- template: nuget-msi-convert/job/v2.yml@yaml
- template: nuget-msi-convert/job/v3.yml@yaml
parameters:
yamlResourceName: yaml
dependsOn: sign_net_mac_win
Expand All @@ -1418,7 +1422,7 @@ stages:
!*Darwin*
propsArtifactName: nuget-unsigned
signType: $(MicroBuildSignType)
runInParallel: false
useDateTimeVersion: false

# Check - "Xamarin.Android (Prepare .NET Release Push Internal)"
- job: push_signed_nugets
Expand Down Expand Up @@ -1484,6 +1488,20 @@ stages:
artifactName: vsdrop-signed
downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)

- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
parameters:
githubToken: $(GitHub.Token)
githubContext: $(MultiTargetVSDropCommitStatusName)
blobName: $(MultiTargetVSDropCommitStatusName)
packagePrefix: xamarin-android
artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
yamlResourceName: yaml
downloadSteps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-multitarget-signed
downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)

- powershell: >-
& dotnet build -v:n -c $(XA.Build.Configuration)
-t:PushManifestToBuildAssetRegistry
Expand Down
1 change: 1 addition & 0 deletions build-tools/create-packs/vs-workload.in.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
</ShortNames>
<ComponentResources Include="android" Version="@WORKLOAD_VERSION@" Category=".NET" Title=".NET SDK for Android" Description=".NET SDK Workload for building Android applications."/>
<WorkloadPackages Include="$(NuGetPackagePath)\Microsoft.NET.Sdk.Android.Manifest*.nupkg" Version="@WORKLOAD_VERSION@" />
<MultiTargetPackNames Include="Microsoft.Android.Sdk" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"android": {
"description": ".NET SDK Workload for building Android applications.",
"packs": [
"Microsoft.Android.Sdk",
"Microsoft.Android.Sdk.net6",
"Microsoft.Android.Ref.31",
"Microsoft.Android.Runtime.31.android-arm",
"Microsoft.Android.Runtime.31.android-arm64",
Expand Down Expand Up @@ -41,7 +41,7 @@
}
},
"packs": {
"Microsoft.Android.Sdk": {
"Microsoft.Android.Sdk.net6": {
"kind": "sdk",
"version": "@WORKLOAD_VERSION@",
"alias-to": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.Android.Sdk"
<Import Project="Sdk.targets" Sdk="Microsoft.Android.Sdk.net6"
Condition=" '$(TargetPlatformIdentifier)' == 'android' " />

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ void CreateEmptyFile (params string [] paths)
public void XamarinLegacySdk ([Values ("net6.0-android32.0", "net6.0-android33.0")] string dotnetTargetFramework)
{
var proj = new XASdkProject (outputType: "Library") {
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha1",
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2",
Sources = {
new AndroidItem.AndroidLibrary ("javaclasses.jar") {
BinaryContent = () => ResourceData.JavaSourceJarTestJar,
Expand Down