diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2096b5568..82a1fdc60 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,6 +8,9 @@ pr: variables: AndroidBinderatorVersion: 0.4.7 AndroidXMigrationVersion: 1.0.8 + DotNetVersion: 6.0.100-preview.6.21355.2 + LegacyXamarinAndroidPkg: https://aka.ms/xamarin-android-commercial-d16-10-macos + LegacyXamarinAndroidVsix: https://aka.ms/xamarin-android-commercial-d16-10-windows BUILD_NUMBER: $(Build.BuildNumber) BUILD_COMMIT: $(Build.SourceVersion) PRE_RESTORE_PROJECTS: true # Windows is having an issue on CI right now @@ -31,18 +34,25 @@ jobs: timeoutInMinutes: 120 validPackagePrefixes: [ 'Xamarin' ] areaPath: 'DevDiv\Xamarin SDK\Android' + initSteps: + - task: UseDotNet@2 + displayName: install .NET $(DotNetVersion) + inputs: + version: $(DotNetVersion) + - pwsh: | + dotnet workload install microsoft-android-sdk-full preBuildSteps: - pwsh: | dotnet tool uninstall --global Cake.Tool dotnet tool install --global Cake.Tool dotnet tool install --global boots - boots https://aka.ms/xamarin-android-commercial-d16-10-macos + boots $(LegacyXamarinAndroidPkg) condition: eq(variables['System.JobName'], 'macos') - pwsh: | dotnet tool uninstall --global Cake.Tool dotnet tool install --global Cake.Tool dotnet tool install --global boots - boots https://aka.ms/xamarin-android-commercial-d16-10-windows + boots $(LegacyXamarinAndroidVsix) condition: eq(variables['System.JobName'], 'windows') tools: - 'xamarin.androidbinderator.tool': '$(AndroidBinderatorVersion)' diff --git a/build.cake b/build.cake index 5fa2fa58e..b2c3dc4a6 100644 --- a/build.cake +++ b/build.cake @@ -636,12 +636,10 @@ Task("libs") .IsDependentOn("libs-native") .Does(() => { - var settings = new MSBuildSettings() + var settings = new DotNetCoreMSBuildSettings() .SetConfiguration(CONFIGURATION) - .SetVerbosity(VERBOSITY) .SetMaxCpuCount(0) .EnableBinaryLogger($"./output/libs.{CONFIGURATION}.binlog") - .WithRestore() .WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION) .WithProperty("DesignTimeBuild", "false") .WithProperty("AndroidSdkBuildToolsVersion", $"{AndroidSdkBuildTools}"); @@ -649,10 +647,12 @@ Task("libs") if (!string.IsNullOrEmpty(ANDROID_HOME)) settings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}"); - if (!string.IsNullOrEmpty(MSBUILD_PATH)) - settings.ToolPath = MSBUILD_PATH; + DotNetCoreRestore("./generated/AndroidX.sln", new DotNetCoreRestoreSettings + { + MSBuildSettings = settings.EnableBinaryLogger("./output/restore.binlog") + }); - MSBuild("./generated/AndroidX.sln", settings); + DotNetCoreMSBuild("./generated/AndroidX.sln", settings); }); Task("libs-native") @@ -674,9 +674,8 @@ Task("nuget") .IsDependentOn("libs") .Does(() => { - var settings = new MSBuildSettings() + var settings = new DotNetCoreMSBuildSettings() .SetConfiguration(CONFIGURATION) - .SetVerbosity(VERBOSITY) .SetMaxCpuCount(0) .EnableBinaryLogger($"./output/nuget.{CONFIGURATION}.binlog") .WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION) @@ -688,10 +687,7 @@ Task("nuget") if (!string.IsNullOrEmpty(ANDROID_HOME)) settings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}"); - if (!string.IsNullOrEmpty(MSBUILD_PATH)) - settings.ToolPath = MSBUILD_PATH; - - MSBuild("./generated/AndroidX.sln", settings); + DotNetCoreMSBuild("./generated/AndroidX.sln", settings); }); Task("samples-generate-all-targets") diff --git a/global.json b/global.json index 0d0701b41..1ca5ffe99 100644 --- a/global.json +++ b/global.json @@ -3,6 +3,7 @@ { "MSBuild.Sdk.Extras": "3.0.23", "Microsoft.Build.Traversal": "2.1.1", - "Microsoft.Build.NoTargets": "2.0.1" + "Microsoft.Build.NoTargets": "2.0.1", + "Xamarin.Legacy.Sdk": "0.1.0-alpha2" } } \ No newline at end of file diff --git a/source/AndroidXProject.cshtml b/source/AndroidXProject.cshtml index 03abd1315..8c0e6294d 100644 --- a/source/AndroidXProject.cshtml +++ b/source/AndroidXProject.cshtml @@ -1,6 +1,6 @@ @using System @using System.Linq - + MonoAndroid9.0 true @@ -9,17 +9,8 @@ } else { @(Model.NuGetPackageId) } - Resources - Assets - False - True - Resources\Resource.designer.cs + false @(Model.NuGetPackageId.Replace("Xamarin.", "")) - true - true - true - d8 - r8