diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml
index 8d9db7ce126..3488fb0bbb2 100644
--- a/build-tools/automation/azure-pipelines.yaml
+++ b/build-tools/automation/azure-pipelines.yaml
@@ -37,9 +37,6 @@ resources:
endpoint: xamarin
parameters:
-- name: provisionatorChannel
- type: string
- default: latest # Support for launching a build against a Provisionator PR (e.g., pr/[github-account-name]/[pr-number]) as a means to test in-progress Provisionator changes
- name: macTestAgentsUseCleanImages # Test agents we do not need to clean up when finished because they are not reused
default: true
@@ -83,8 +80,6 @@ variables:
# Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check.
stages:
- template: yaml-templates/build-macos.yaml
- parameters:
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
- template: yaml-templates/build-windows.yaml
@@ -107,7 +102,6 @@ stages:
- template: yaml-templates/setup-test-environment.yaml
parameters:
provisionClassic: false
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
installLegacyDotNet: false
restoreNUnitConsole: false
updateMono: false
@@ -267,8 +261,6 @@ stages:
- template: yaml-templates/setup-ubuntu.yaml
- template: yaml-templates/setup-test-environment.yaml
- parameters:
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
- task: DownloadPipelineArtifact@2
inputs:
@@ -347,7 +339,6 @@ stages:
parameters:
xaSourcePath: $(Build.SourcesDirectory)/xamarin-android
provisionClassic: false
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
installLegacyDotNet: false
restoreNUnitConsole: false
updateMono: false
diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml
index d0ecd1dc33c..23d400ada95 100644
--- a/build-tools/automation/yaml-templates/build-macos.yaml
+++ b/build-tools/automation/yaml-templates/build-macos.yaml
@@ -11,7 +11,6 @@ parameters:
jobName: mac_build_create_installers
jobDisplayName: macOS > Build
nugetArtifactName: $(NuGetArtifactName)
- provisionatorChannel: latest
repositoryAlias: self
stageName: mac_build
stageDisplayName: Mac
@@ -49,7 +48,6 @@ stages:
parameters:
installerArtifactName: ${{ parameters.installerArtifactName }}
nugetArtifactName: ${{ parameters.nugetArtifactName }}
- provisionatorChannel: ${{ parameters.provisionatorChannel }}
testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }}
- powershell: |
diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml
index 8ab2c3a041d..f7c74a596bb 100644
--- a/build-tools/automation/yaml-templates/commercial-build.yaml
+++ b/build-tools/automation/yaml-templates/commercial-build.yaml
@@ -3,7 +3,6 @@ parameters:
xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android
makeMSBuildArgs: ''
nugetArtifactName: $(NuGetArtifactName)
- provisionatorChannel: latest
testAssembliesArtifactName: $(TestAssembliesArtifactName)
steps:
@@ -19,55 +18,49 @@ steps:
inputs:
forceReinstallCredentialProvider: true
-- task: provisionator@2
- displayName: Install Xcode
- inputs:
- github_token: $(GitHub.Token)
- provisioning_script: ${{ parameters.xaSourcePath }}/build-tools/provisioning/xcode.csx
- provisioning_extra_args: '-v -v -v -v'
- env:
- PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}
-
- script: make prepare-update-mono CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1
workingDirectory: ${{ parameters.xaSourcePath }}
displayName: make prepare-update-mono
-# Clone 'monodroid' without submodules
-- checkout: monodroid
- clean: true
- path: s/xamarin-android/external/monodroid
-
-# Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded
-- script: git config submodule."external/xamarin-android".update none
- workingDirectory: xamarin-android/external/monodroid
- displayName: Ignore XA submodule
-
-# Clone 'monodroid' with the rest of the submodules
-- checkout: monodroid
- submodules: recursive
- path: s/xamarin-android/external/monodroid
- persistCredentials: true
-
-- script: rm -rf external/monodroid/external/xamarin-android
- workingDirectory: ${{ parameters.xaSourcePath }}
- displayName: delete legacy xamarin-android submodule
-
-- script: rm -rf external/opentk
- workingDirectory: ${{ parameters.xaSourcePath }}
- displayName: delete legacy opentk submodule
-
-- script: rm -rf external/sqlite
- workingDirectory: ${{ parameters.xaSourcePath }}
- displayName: delete legacy sqlite submodule
+# Always checkout a second resource to ensure we are using multi-repo checkout behavior
+# https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path
+- checkout: yaml-templates
+
+- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}:
+ - script: >
+ ls -l /Applications &&
+ sudo xcode-select --switch /Applications/Xcode_14.2.app &&
+ xcode-select --print-path
+ displayName: Use Xcode 14.2
+
+ # Clone 'monodroid' without submodules
+ - checkout: monodroid
+ clean: true
+ path: s/xamarin-android/external/monodroid
+
+ # Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded
+ - script: git config submodule."external/xamarin-android".update none
+ workingDirectory: xamarin-android/external/monodroid
+ displayName: Ignore XA submodule
+
+ # Clone 'monodroid' with the rest of the submodules
+ - checkout: monodroid
+ submodules: recursive
+ path: s/xamarin-android/external/monodroid
+ persistCredentials: true
+
+ - script: rm -rf external/monodroid/external/xamarin-android
+ workingDirectory: ${{ parameters.xaSourcePath }}
+ displayName: delete legacy xamarin-android submodule
+
+ - script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration)
+ workingDirectory: ${{ parameters.xaSourcePath }}
+ displayName: make prepare-external-git-dependencies
- task: CodeQL3000Init@0
displayName: CodeQL 3000 Init
condition: and(succeeded(), eq(variables['Codeql.Enabled'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
-- script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration)
- workingDirectory: ${{ parameters.xaSourcePath }}
- displayName: make prepare-external-git-dependencies
-
# Prepare and Build everything
- script: make jenkins CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 MSBUILD_ARGS='${{ parameters.makeMSBuildArgs }}'
workingDirectory: ${{ parameters.xaSourcePath }}
diff --git a/build-tools/automation/yaml-templates/run-installer.yaml b/build-tools/automation/yaml-templates/run-installer.yaml
index e7db3bf471f..b66b0209ada 100644
--- a/build-tools/automation/yaml-templates/run-installer.yaml
+++ b/build-tools/automation/yaml-templates/run-installer.yaml
@@ -1,6 +1,5 @@
parameters:
provisionExtraArgs: -vv -f
- provisionatorChannel: latest
steps:
- task: DownloadPipelineArtifact@2
@@ -38,6 +37,4 @@ steps:
provisioning_script: $(XA.Provisionator.Args)
provisioning_extra_args: ${{ parameters.provisionExtraArgs }}
# Disabled on Windows on .NET release branches
- condition: and(succeeded(), ne(variables['agent.os'], 'Linux'), or(eq(variables.IsRelOrTargetingRel, 'False'), eq(variables['agent.os'], 'Darwin')))
- env:
- PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}
+ condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'), ne(variables['agent.os'], 'Linux'), or(eq(variables.IsRelOrTargetingRel, 'False'), eq(variables['agent.os'], 'Darwin')))
diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml
index 6b98286ab37..0a8e6a787fe 100644
--- a/build-tools/automation/yaml-templates/setup-test-environment.yaml
+++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml
@@ -1,7 +1,6 @@
parameters:
configuration: $(XA.Build.Configuration)
xaSourcePath: $(System.DefaultWorkingDirectory)
- updateVS: false
jdkTestFolder: $(JAVA_HOME_11_X64)
remove_dotnet: false
installTestSlicer: false
@@ -24,11 +23,6 @@ steps:
clean: true
submodules: recursive
-- ${{ if eq(parameters.updateVS, true) }}:
- - template: update-vs.yaml
- parameters:
- xasourcePath: ${{ parameters.xaSourcePath }}
-
- script: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]${{ parameters.jdkTestFolder }}"
echo "##vso[task.setvariable variable=DOTNET_TOOL_PATH]${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet/dotnet"
diff --git a/build-tools/automation/yaml-templates/update-vs.yaml b/build-tools/automation/yaml-templates/update-vs.yaml
deleted file mode 100644
index 22154203e59..00000000000
--- a/build-tools/automation/yaml-templates/update-vs.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-parameters:
- xaSourcePath: $(System.DefaultWorkingDirectory)
- condition: eq(variables['agent.os'], 'Windows_NT')
-
-steps:
-- task: provisionator@2
- displayName: update VS 2019
- timeoutInMinutes: 60
- inputs:
- github_token: $(Github.Token)
- provisioning_script: ${{ parameters.xaSourcePath }}\build-tools\provisioning\vs2019.csx
- provisioning_extra_args: -vv
- condition: ${{ parameters.condition }}
-
-- template: environment/win/vs-msbuild.v1.yml@yaml-templates # Display (in log) VS installation(s) including installation status with associated MSBuild location(s)
- parameters:
- condition: ${{ parameters.condition }}
diff --git a/build-tools/provisioning/vs2019.csx b/build-tools/provisioning/vs2019.csx
deleted file mode 100644
index 8acaf3a3833..00000000000
--- a/build-tools/provisioning/vs2019.csx
+++ /dev/null
@@ -1,3 +0,0 @@
-VisualStudio (VisualStudioChannel.Stable, VisualStudioTier.Enterprise, 16, @"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise", true)
- .Workload (VisualStudioWorkload.ManagedDesktop)
- .Workload (VisualStudioWorkload.NetCrossPlat);
diff --git a/build-tools/provisioning/xcode.csx b/build-tools/provisioning/xcode.csx
deleted file mode 100644
index 8aafbaf8e16..00000000000
--- a/build-tools/provisioning/xcode.csx
+++ /dev/null
@@ -1,3 +0,0 @@
-if (IsMac) {
- Xcode ("13.4").XcodeSelect ();
-}
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs
index ba570cce8ca..f30f2f2388d 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs
@@ -124,7 +124,7 @@ public partial class BuildTest : BaseTest
/* debugSymbols */ true ,
/* optimize */ true ,
/* embedassebmlies */ false ,
- /* expectedResult */ CommercialBuildAvailable ? "debug" : "release",
+ /* expectedResult */ TestEnvironment.CommercialBuildAvailable ? "debug" : "release",
},
new object[] {
/* supportedAbi */ "armeabi-v7a",
@@ -145,7 +145,7 @@ public partial class BuildTest : BaseTest
/* debugSymbols */ false ,
/* optimize */ null ,
/* embedassebmlies */ null ,
- /* expectedResult */ CommercialBuildAvailable ? "debug" : "release",
+ /* expectedResult */ TestEnvironment.CommercialBuildAvailable ? "debug" : "release",
},
};
#pragma warning restore 414
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
index 9405f155328..cd269edafe0 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
@@ -139,12 +139,12 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo
Assert.AreEqual (XABuildConfig.AndroidDefaultTargetDotnetApiLevel.ToString(),
uses_sdk.Attribute (ns + "targetSdkVersion").Value);
- bool expectEmbeddedAssembies = !(CommercialBuildAvailable && !isRelease);
+ bool expectEmbeddedAssembies = !(TestEnvironment.CommercialBuildAvailable && !isRelease);
var apkPath = Path.Combine (outputPath, $"{proj.PackageName}-Signed.apk");
FileAssert.Exists (apkPath);
var helper = new ArchiveAssemblyHelper (apkPath, usesAssemblyStore, rids);
helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.dll", shouldContainEntry: expectEmbeddedAssembies);
- helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.pdb", shouldContainEntry: !CommercialBuildAvailable && !isRelease);
+ helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.pdb", shouldContainEntry: !TestEnvironment.CommercialBuildAvailable && !isRelease);
helper.AssertContainsEntry ($"assemblies/Mono.Android.dll", shouldContainEntry: expectEmbeddedAssembies);
helper.AssertContainsEntry ($"assemblies/es/{proj.ProjectName}.resources.dll", shouldContainEntry: expectEmbeddedAssembies);
foreach (var abi in rids.Select (AndroidRidAbiHelper.RuntimeIdentifierToAbi)) {
@@ -1030,6 +1030,8 @@ public void MicrosoftExtensionsHttp ()
[Test]
public void FastDeploymentDoesNotAddContentProvider ()
{
+ AssertCommercialBuild ();
+
var proj = new XamarinAndroidApplicationProject {
EmbedAssembliesIntoApk = false,
};
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
index 48e7457d97c..d1c8b1cefa4 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
@@ -605,11 +605,10 @@ public void DuplicateManagedNames ()
}
[Test]
- [Category ("Commercial")]
public void LibraryProjectsShouldSkipGetPrimaryCpuAbi ()
{
- if (!CommercialBuildAvailable)
- Assert.Ignore ("Not required on Open Source Builds");
+ AssertCommercialBuild ();
+
const string target = "_GetPrimaryCpuAbi";
var proj = new XamarinAndroidLibraryProject ();
using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) {
@@ -619,10 +618,10 @@ public void LibraryProjectsShouldSkipGetPrimaryCpuAbi ()
}
[Test]
- [Category ("Commercial")]
public void LibraryReferenceWithHigherTFVShouldDisplayWarning ([Values (true, false)] bool isRelease)
{
- if (!CommercialBuildAvailable || Builder.UseDotNet)
+
+ if (!TestEnvironment.CommercialBuildAvailable || Builder.UseDotNet)
Assert.Ignore ("Not applicable to One .NET or single framework OSS builds.");
var libproj = new XamarinAndroidLibraryProject () {
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
index 27177273816..1e581bc8cfa 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
@@ -10,15 +10,14 @@
namespace Xamarin.Android.Build.Tests
{
- [Category ("Node-2"), Category ("Commercial")]
+ [Category ("Node-2")]
[TestFixture, NonParallelizable]
public class DebuggingTasksTests : BaseTest
{
[OneTimeSetUp]
public void SetUp ()
{
- if (!CommercialBuildAvailable)
- Assert.Ignore ("DebuggingTasksTests require Xamarin.Android.Build.Debugging.Tasks.");
+ AssertCommercialBuild ();
}
// https://github.com/xamarin/monodroid/blob/63bbeb076d809c74811a8001d38bf2e9e8672627/tests/msbuild/nunit/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests/ResolveXamarinAndroidToolsTests.cs
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs
index 91649d560ef..9c8dfc894e2 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs
@@ -694,6 +694,8 @@ public void LinkAssembliesNoShrink ()
[Test]
public void CSProjUserFileChanges ()
{
+ AssertCommercialBuild ();
+
var proj = new XamarinAndroidApplicationProject ();
var selectedDevice = "foo";
var csproj_user_file = $"{proj.ProjectName}.csproj.user";
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
index 5938f7102e3..e46af666639 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
@@ -73,6 +73,8 @@ public void EolFrameworks()
[Test]
public void XA0119 ()
{
+ AssertCommercialBuild ();
+
var proj = new XamarinAndroidApplicationProject ();
proj.SetProperty ("_XASupportsFastDev", "True");
proj.SetProperty (proj.DebugProperties, "AndroidLinkMode", "Full");
@@ -86,6 +88,8 @@ public void XA0119 ()
[Test]
public void XA0119AAB ()
{
+ AssertCommercialBuild ();
+
var proj = new XamarinAndroidApplicationProject ();
proj.SetProperty ("_XASupportsFastDev", "True");
proj.SetProperty ("AndroidPackageFormat", "aab");
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
index ec66ffc55cd..29c00189e8e 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
@@ -27,16 +27,14 @@ public class BaseTest
public string Root => Path.GetFullPath (XABuildPaths.TestOutputDirectory);
- public static bool CommercialBuildAvailable => TestEnvironment.CommercialBuildAvailable;
-
///
/// Checks if a commercial Xamarin.Android is available
/// * Defaults to Assert.Ignore ()
///
public void AssertCommercialBuild (bool fail = false)
{
- if (!CommercialBuildAvailable) {
- var message = "This test requires a commercial build of Xamarin.Android.";
+ if (!TestEnvironment.CommercialBuildAvailable) {
+ var message = $"'{TestName}' requires a commercial build of Xamarin.Android.";
if (fail) {
Assert.Fail (message);
} else {
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
index 825e77f6735..ed5becf6940 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
@@ -203,7 +203,7 @@ protected static void RunProjectAndAssert (XamarinAndroidApplicationProject proj
if (Builder.UseDotNet) {
builder.BuildLogFile = logName;
Assert.True (builder.RunTarget (proj, "Run", doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters), "Project should have run.");
- } else if (CommercialBuildAvailable) {
+ } else if (TestEnvironment.CommercialBuildAvailable) {
builder.BuildLogFile = logName;
Assert.True (builder.RunTarget (proj, "_Run", doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters), "Project should have run.");
} else {
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs
index 6118fc6a0c8..afa07f3ce27 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs
@@ -5,6 +5,7 @@
using System.Diagnostics;
using Microsoft.Build.Framework;
using System.Xml.Linq;
+using Xamarin.Android.Tools;
namespace Xamarin.ProjectTools
{
@@ -154,21 +155,29 @@ public struct RuntimeInfo
public RuntimeInfo [] GetSupportedRuntimes ()
{
var runtimeInfo = new List ();
- foreach (var file in Directory.EnumerateFiles (Path.Combine (TestEnvironment.AndroidMSBuildDirectory, "lib"), "libmono-android.*.so", SearchOption.AllDirectories)) {
- string fullFilePath = Path.GetFullPath (file);
- DirectoryInfo parentDir = Directory.GetParent (fullFilePath);
- if (parentDir == null)
- continue;
- string[] items = Path.GetFileName (fullFilePath).Split ('.' );
- if (items.Length != 3)
- continue;
- var fi = new FileInfo (fullFilePath);
- runtimeInfo.Add (new RuntimeInfo () {
- Name = "libmonodroid.so",
- Runtime = items [1], // release|debug
- Abi = parentDir.Name, // armaebi|x86|arm64-v8a
- Size = (int)fi.Length, // int
- });
+ var runtimeDirs = new HashSet ();
+ var rootRuntimeDirs = Directory.GetDirectories (TestEnvironment.DotNetPreviewPacksDirectory, $"Microsoft.Android.Runtime.{XABuildConfig.AndroidDefaultTargetDotnetApiLevel}.*");
+ foreach (var dir in rootRuntimeDirs) {
+ runtimeDirs.Add (Directory.GetDirectories (dir).LastOrDefault ());
+ }
+
+ foreach (var runtimeDir in runtimeDirs) {
+ foreach (var file in Directory.EnumerateFiles (runtimeDir, "libmono-android.*.so", SearchOption.AllDirectories)) {
+ string fullFilePath = Path.GetFullPath (file);
+ DirectoryInfo parentDir = Directory.GetParent (fullFilePath);
+ if (parentDir == null)
+ continue;
+ string[] items = Path.GetFileName (fullFilePath).Split ('.' );
+ if (items.Length != 3)
+ continue;
+ var fi = new FileInfo (fullFilePath);
+ runtimeInfo.Add (new RuntimeInfo () {
+ Name = "libmonodroid.so",
+ Runtime = items [1], // release|debug
+ Abi = parentDir.Name, // armaebi|x86|arm64-v8a
+ Size = (int)fi.Length, // int
+ });
+ }
}
return runtimeInfo.ToArray ();
}
diff --git a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
index b94326b4684..5acf58203bd 100755
--- a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
@@ -58,7 +58,7 @@ public void ApplicationRunsWithoutDebugger ([Values (false, true)] bool isReleas
var proj = new XamarinFormsAndroidApplicationProject () {
IsRelease = isRelease,
};
- if (isRelease || !CommercialBuildAvailable) {
+ if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
}
proj.SetDefaultTargetDevice ();
@@ -90,7 +90,7 @@ public void ClassLibraryMainLauncherRuns ([Values (true, false)] bool preloadAss
var app = new XamarinAndroidApplicationProject {
ProjectName = "MyApp",
};
- if (!CommercialBuildAvailable) {
+ if (!TestEnvironment.CommercialBuildAvailable) {
app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
}
app.SetDefaultTargetDevice ();
diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
index b6553ecdef6..f8ef61db4a4 100644
--- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
@@ -73,7 +73,7 @@ public void NativeAssemblyCacheWithSatelliteAssemblies ([Values (true, false)] b
Assert.IsTrue (helper.Exists ($"assemblies/{lang}/{lib.ProjectName}.resources.dll"), $"Apk should contain satellite assembly for language '{lang}'!");
}
- Assert.True (builder.RunTarget (proj, "_Run"), "Project should have run.");
+ RunProjectAndAssert (proj, builder);
Assert.True (WaitForActivityToStart (proj.PackageName, "MainActivity",
Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30), "Activity should have started.");
}
@@ -88,7 +88,7 @@ public void GlobalLayoutEvent_ShouldRegisterAndFire_OnActivityLaunch ([Values (f
IsRelease = isRelease,
SupportedOSPlatformVersion = "23",
};
- if (isRelease || !CommercialBuildAvailable) {
+ if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
}
proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}",
@@ -356,7 +356,7 @@ public void JsonDeserializationCreatesJavaHandle ([Values (false, true)] bool is
// error SYSLIB0011: 'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.'
proj.SetProperty ("NoWarn", "SYSLIB0011");
- if (isRelease || !CommercialBuildAvailable) {
+ if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
}
@@ -616,6 +616,8 @@ public void ResourceDesignerWithNuGetReference ([Values ("net8.0-android")] stri
[Test]
public void SingleProject_ApplicationId ([Values (false, true)] bool testOnly)
{
+ AssertCommercialBuild ();
+
proj = new XamarinAndroidApplicationProject ();
proj.SetProperty ("ApplicationId", "com.i.should.get.overridden.by.the.manifest");
if (testOnly)
diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
index 75ffe121ca4..d77fec4f228 100644
--- a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
@@ -12,7 +12,7 @@
namespace Xamarin.Android.Build.Tests
{
[TestFixture]
- [Category ("Commercial"), Category ("UsesDevice")]
+ [Category ("UsesDevice")]
public class InstallTests : DeviceTest
{
string GetContentFromAllOverrideDirectories (string packageName, bool useRunAsCommand = true)
diff --git a/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs b/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs
index 6cbc552c57b..5c4b9429b08 100644
--- a/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs
@@ -7,7 +7,7 @@
namespace Xamarin.Android.Build.Tests
{
[TestFixture]
- [Category ("Commercial"), Category ("UsesDevice")]
+ [Category ("UsesDevice")]
public class InstantRunTest : DeviceTest
{
[Test]
diff --git a/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs b/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs
index 6d41a39204f..ccd23bc34d2 100644
--- a/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs
@@ -11,7 +11,7 @@
namespace Xamarin.Android.Build.Tests
{
[TestFixture]
- [Category ("Commercial"), Category ("UsesDevice")]
+ [Category ("UsesDevice")]
public class SystemApplicationTests : DeviceTest
{
// All Tests here require the emulator to be started with -writable-system