Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void NoSymbolsArgShouldReduceAppSize ([Values (false, true)] bool skipDeb
proj.SetRuntime (AndroidRuntime.MonoVM);

var supportedAbi = "arm64-v8a";
proj.SetAndroidSupportedAbis (supportedAbi);
proj.SetRuntimeIdentifiers (new[] { supportedAbi });
proj.SetProperty ("EnableLLVM", true.ToString ());

var xaAssemblySize = 0;
Expand Down Expand Up @@ -440,7 +440,7 @@ public void AotAssembliesInIDE ()
};
// Mono-only test
proj.SetRuntime (AndroidRuntime.MonoVM);
proj.SetAndroidSupportedAbis (supportedAbis);
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));
using var b = CreateApkBuilder ();
Assert.IsTrue (b.RunTarget (proj, target: "Build"));

Expand Down Expand Up @@ -475,7 +475,7 @@ public void CheckWhetherLibcAndLibmAreReferencedInAOTLibraries ()
proj.SetProperty ("EnableLLVM", "True");

var abis = new [] { "arm64-v8a", "x86_64" };
proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis);

var libPaths = new List<string> ();
libPaths.Add (Path.Combine ("android-arm64", "aot", "Mono.Android.dll.so"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void CheckMonoComponentsMask (bool enableProfiler, bool useInterpreter, b
proj.SetProperty (proj.ActiveConfigurationProperties, "UseInterpreter", useInterpreter.ToString ());

var abis = new [] { "armeabi-v7a", "x86" };
proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis);

using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
Expand Down Expand Up @@ -370,7 +370,7 @@ public void CheckWhichRuntimeIsIncluded (string supportedAbi, bool debugSymbols,
var proj = new XamarinAndroidApplicationProject ();
// MonoVM-only test
proj.SetRuntime (Android.Tasks.AndroidRuntime.MonoVM);
proj.SetAndroidSupportedAbis (supportedAbi);
proj.SetRuntimeIdentifiers (new[] { supportedAbi });
proj.SetProperty (proj.ActiveConfigurationProperties, "DebugSymbols", debugSymbols);
if (optimize.HasValue)
proj.SetProperty (proj.ActiveConfigurationProperties, "Optimize", optimize.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public void BuildReleaseArm64 ([Values] bool forms, [Values] AndroidRuntime runt
proj.SetRuntime (runtime);
proj.IsRelease = isRelease;
proj.AotAssemblies = false; // Release defaults to Profiled AOT for .NET 6
proj.SetAndroidSupportedAbis ("arm64-v8a");
proj.SetRuntimeIdentifiers (new[] { "arm64-v8a" });
proj.SetProperty ("LinkerDumpDependencies", "True");
proj.SetProperty ("AndroidUseAssemblyStore", "False");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline
string linkSkip = "FormsViewGroup";
app.SetProperty ("AndroidLinkSkip", linkSkip);
app.SetProperty ("_AndroidSequencePointsMode", sequencePointsMode);
app.SetAndroidSupportedAbis (supportedAbis);
app.SetRuntimeIdentifiers (supportedAbis.Split (';'));
using (var libb = CreateDllBuilder (Path.Combine ("temp", TestName, lib.ProjectName)))
using (var appb = CreateApkBuilder (Path.Combine ("temp", TestName, app.ProjectName))) {
Assert.IsTrue (libb.Build (lib), "Library build should have succeeded.");
Expand Down Expand Up @@ -105,7 +105,7 @@ public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline"
// Mono-only test
proj.SetRuntime (AndroidRuntime.MonoVM);
proj.SetProperty ("_AndroidSequencePointsMode", sequencePointsMode);
proj.SetAndroidSupportedAbis (supportedAbis);
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));
using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");

Expand Down Expand Up @@ -140,7 +140,7 @@ public void CheckConcurrentGC ()
var supportedAbis = "armeabi-v7a;arm64-v8a";
// MonoVM-only test
proj.SetRuntime (Android.Tasks.AndroidRuntime.MonoVM);
proj.SetAndroidSupportedAbis (supportedAbis);
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));

using (var b = CreateApkBuilder ()) {
proj.SetProperty ("AndroidEnableSGenConcurrent", "False");
Expand Down Expand Up @@ -201,7 +201,7 @@ public void CheckHttpClientHandlerType ([Values] AndroidRuntime runtime)
_ => throw new NotSupportedException ($"Unsupported runtime '{runtime}'")
};
proj.SetRuntime (runtime);
proj.SetAndroidSupportedAbis (supportedAbis);
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));
proj.PackageReferences.Add (new Package() { Id = "System.Net.Http", Version = "*" });
proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", "var _ = new System.Net.Http.HttpClient ();");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public Class2 ()
if (runtime == AndroidRuntime.MonoVM) {
// Using `SetRuntimeIdentifier` would change the intermediate path (by adding the RID component to it) and, thus, the way this test used to work.
// Keep it as it was.
app.SetAndroidSupportedAbis (abi);
app.SetRuntimeIdentifiers (new[] { abi });
} else {
app.SetRuntimeIdentifier (abi);
}
Expand Down Expand Up @@ -1257,7 +1257,7 @@ public void GenerateJavaStubsAndAssembly ([Values] bool isRelease, [Values] Andr
if (runtime == AndroidRuntime.MonoVM) {
// Using `SetRuntimeIdentifier` would change the intermediate path (by adding the RID component to it) and, thus, the way this test used to work.
// Keep it as it was.
proj.SetAndroidSupportedAbis (abi);
proj.SetRuntimeIdentifiers (new[] { abi });
} else {
proj.SetRuntimeIdentifier (abi);
}
Expand Down Expand Up @@ -1381,7 +1381,7 @@ public void BuildIncrementalAot (string supportedAbis, string androidAotMode, bo
if (aotAssemblies) {
targets.Add ("_AndroidAot");
}
proj.SetAndroidSupportedAbis (supportedAbis);
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));
if (!string.IsNullOrEmpty (androidAotMode))
proj.SetProperty ("AndroidAotMode", androidAotMode);
using (var b = CreateApkBuilder (path)) {
Expand Down Expand Up @@ -1802,7 +1802,7 @@ public void ChangeSupportedAbis ([Values] AndroidRuntime runtime)
_ => throw new NotSupportedException ($"Unsupported runtime '{runtime}'")
};

proj.SetAndroidSupportedAbis (supportedAbi);
proj.SetRuntimeIdentifiers (new[] { supportedAbi });
using (var b = CreateApkBuilder ()) {
b.Build (proj);
b.Build (proj, parameters: new [] { $"{KnownProperties.RuntimeIdentifier}=android-{alternativeRid}" }, doNotCleanupOnUpdate: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public void VersionCodeTests (bool seperateApk, string abis, string versionCode,
proj.SetProperty ("GenerateApplicationManifest", "false"); // Disable $(AndroidVersionCode) support
proj.SetProperty (proj.ReleaseProperties, KnownProperties.AndroidCreatePackagePerAbi, seperateApk);
if (!string.IsNullOrEmpty (abis))
proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis.Split (';'));
if (!string.IsNullOrEmpty (versionCodePattern))
proj.SetProperty (proj.ReleaseProperties, "AndroidVersionCodePattern", versionCodePattern);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void CheckIncludedNativeLibraries ([Values] bool compressNativeLibraries,
};
proj.SetRuntime (runtime);
proj.PackageReferences.Add(KnownPackages.SQLitePCLRaw_Core);
proj.SetAndroidSupportedAbis ("x86_64");
proj.SetRuntimeIdentifiers (new[] { "x86_64" });
proj.SetProperty (proj.ReleaseProperties, "AndroidStoreUncompressedFileExtensions", compressNativeLibraries ? "" : "so");
using (var b = CreateApkBuilder ()) {
b.ThrowOnBuildFailure = false;
Expand Down Expand Up @@ -513,7 +513,7 @@ public void CheckSignApk ([Values] bool useApkSigner, [Values] bool perAbiApk, [
proj.SetProperty (proj.ReleaseProperties, KnownProperties.AndroidCreatePackagePerAbi, perAbiApk);
if (perAbiApk) {
if (runtime == AndroidRuntime.MonoVM) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "arm64-v8a", "x86_64");
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "x86", "arm64-v8a", "x86_64" });
} else {
proj.SetRuntimeIdentifiers (AndroidTargetArch.Arm64, AndroidTargetArch.X86_64);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void WarnAboutAppDomains ([Values] bool isRelease, [Values] AndroidRuntim

var app = new XamarinAndroidApplicationProject { IsRelease = isRelease };
app.SetRuntime (runtime);
app.SetAndroidSupportedAbis ("arm64-v8a");
app.SetRuntimeIdentifiers (new[] { "arm64-v8a" });
app.AddReference (lib);
using var libBuilder = CreateDllBuilder (Path.Combine (path, lib.ProjectName));
Assert.IsTrue (libBuilder.Build (lib), "library build should have succeeded.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,6 @@ namespace Xamarin.ProjectTools
{
public static class ProjectExtensions
{
/// <summary>
/// Sets $(AndroidSupportedAbis) or $(RuntimeIdentifiers) depending if running under dotnet
/// </summary>
[Obsolete ("SetAndroidSupportedAbis is deprecated, please use SetRuntimeIdentifiers instead.")]
public static void SetAndroidSupportedAbis (this IShortFormProject project, params string [] abis)
{
project.SetRuntimeIdentifiers (abis);
}

/// <summary>
/// Sets $(AndroidSupportedAbis) or $(RuntimeIdentifiers) depending if running under dotnet
/// </summary>
/// <param name="abis">A semi-colon-delimited list of ABIs</param>
[Obsolete ("SetAndroidSupportedAbis is deprecated, please use SetRuntimeIdentifiers instead.")]
public static void SetAndroidSupportedAbis (this IShortFormProject project, string abis)
{
project.SetRuntimeIdentifiers (abis.Split (';'));
}

public static void SetRuntimeIdentifier (this IShortFormProject project, string androidAbi)
{
project.SetProperty (KnownProperties.RuntimeIdentifier, AbiUtils.AbiToRuntimeIdentifier (androidAbi));
Expand Down
2 changes: 1 addition & 1 deletion tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void BuildBasicApplicationAndAotProfileIt ()
};
// MonoVM-only test
proj.SetRuntime (Android.Tasks.AndroidRuntime.MonoVM);
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });

// TODO: only needed in .NET 6+
// See https://github.com/dotnet/runtime/issues/56989
Expand Down
2 changes: 1 addition & 1 deletion tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void OneTimeSetUp ()
//NOTE: this is here to enable adb shell run-as
app.AndroidManifest = app.AndroidManifest.Replace ("<application ", "<application android:debuggable=\"true\" ");
app.SetProperty (app.ReleaseProperties, "AndroidPackageFormat", "aab");
app.SetAndroidSupportedAbis (Abis);
app.SetRuntimeIdentifiers (Abis);
app.SetProperty ("AndroidBundleConfigurationFile", "buildConfig.json");
app.SetProperty ("AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ());

Expand Down
6 changes: 3 additions & 3 deletions tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void ApplicationRunsWithoutDebugger ([Values] bool isRelease, [Values] bo
};
proj.SetRuntime (runtime);
if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
}
proj.SetDefaultTargetDevice ();
if (isRelease) {
Expand Down Expand Up @@ -140,7 +140,7 @@ public void ClassLibraryMainLauncherRuns ([Values] bool preloadAssemblies, [Valu
};
app.SetRuntime (runtime);
if (!TestEnvironment.CommercialBuildAvailable) {
app.SetAndroidSupportedAbis (DeviceAbi);
app.SetRuntimeIdentifiers (new[] { DeviceAbi });
}
app.SetDefaultTargetDevice ();
app.SetProperty ("AndroidEnablePreloadAssemblies", preloadAssemblies.ToString ());
Expand Down Expand Up @@ -259,7 +259,7 @@ public void CustomApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, bo
};

proj.SetRuntime (runtime);
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
proj.SetProperty ("EmbedAssembliesIntoApk", embedAssemblies.ToString ());
proj.SetProperty ("AndroidPackageFormat", packageFormat);
proj.SetDefaultTargetDevice ();
Expand Down
26 changes: 13 additions & 13 deletions tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public void GlobalLayoutEvent_ShouldRegisterAndFire_OnActivityLaunch ([Values] b

if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
if (runtime == AndroidRuntime.MonoVM) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" });
} else {
proj.SetRuntimeIdentifiers (new [] {"arm64-v8a", "x86_64"});
}
Expand Down Expand Up @@ -661,7 +661,7 @@ public void SubscribeToAppDomainUnhandledException ([Values] AndroidRuntime runt
};
proj.SetRuntime (runtime);
if (runtime == AndroidRuntime.MonoVM) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" });
} else {
proj.SetRuntimeIdentifiers (new [] {"arm64-v8a", "x86_64"});
}
Expand Down Expand Up @@ -746,7 +746,7 @@ public void UnhandledExceptionFromButtonClick ([Values (AndroidRuntime.MonoVM, A
{
proj = new XamarinAndroidApplicationProject ();
proj.SetRuntime (runtime);
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });

proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", """
Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, e) => {
Expand Down Expand Up @@ -794,7 +794,7 @@ public void NativeCrashProducesManagedStackTrace ([Values (AndroidRuntime.CoreCL
};
proj.SetRuntime (runtime);
proj.SetProperty ("AllowUnsafeBlocks", "true");
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });

proj.MainActivity = proj.DefaultMainActivity
.Replace ("//${USINGS}", "using System.Runtime.InteropServices;")
Expand Down Expand Up @@ -875,7 +875,7 @@ public void SmokeTestBuildAndRunWithSpecialCharacters (string testName, AndroidR
IsRelease = isRelease,
};
proj.SetRuntime (runtime);
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
proj.SetDefaultTargetDevice ();
using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){
Assert.IsTrue (builder.Install (proj), "Install should have succeeded.");
Expand Down Expand Up @@ -1087,7 +1087,7 @@ public void JsonDeserializationCreatesJavaHandle ([Values] bool isRelease, [Valu
proj.SetProperty ("NoWarn", "SYSLIB0011");

if (isRelease || !TestEnvironment.CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
}

proj.References.Add (new BuildItem.Reference ("System.Runtime.Serialization"));
Expand Down Expand Up @@ -1187,7 +1187,7 @@ public void RunWithInterpreterEnabled ([Values] bool isRelease, [Values] Android
};
proj.SetRuntime (runtime);
var abis = new string[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" };
proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis);
proj.SetProperty (proj.CommonProperties, "UseInterpreter", "True");
builder = CreateApkBuilder ();
builder.BuildLogFile = "install.log";
Expand Down Expand Up @@ -1223,7 +1223,7 @@ public void RunWithLLVMEnabled ()
};
// Mono-only test
proj.SetRuntime (AndroidRuntime.MonoVM);
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" });
proj.SetProperty ("EnableLLVM", true.ToString ());

builder = CreateApkBuilder ();
Expand Down Expand Up @@ -1282,7 +1282,7 @@ public void SingleProject_ApplicationId ([Values] bool testOnly, [Values] Androi
if (testOnly)
proj.AndroidManifest = proj.AndroidManifest.Replace ("<application", "<application android:testOnly=\"true\"");

proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
builder = CreateApkBuilder ();
Assert.IsTrue (builder.Install (proj), "Install should have succeeded.");
RunProjectAndAssert (proj, builder);
Expand Down Expand Up @@ -1426,7 +1426,7 @@ public MyLayout (Android.Content.Context context, Android.Util.IAttributeSet att
_ => throw new NotSupportedException ($"Unsupported runtime {runtime}")
};

proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis);
var libBuilder = CreateDllBuilder (Path.Combine (rootPath, lib.ProjectName));
Assert.IsTrue (libBuilder.Build (lib), "Library should have built succeeded.");
builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName));
Expand Down Expand Up @@ -1468,7 +1468,7 @@ public void CheckXamarinFormsAppDeploysAndAButtonWorks ([Values] AndroidRuntime
IsRelease = isRelease,
};
proj.SetRuntime (runtime);
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
var builder = CreateApkBuilder (packageName: packageName);

Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
Expand Down Expand Up @@ -1735,7 +1735,7 @@ public void DotNetInstallAndRunPreviousSdk (
proj.SetRuntime (runtime);

// Requires 32-bit ABIs
proj.SetAndroidSupportedAbis (["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]);
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" });

var builder = CreateApkBuilder ();
Assert.IsTrue (builder.Build (proj), "`dotnet build` should succeed");
Expand Down Expand Up @@ -2180,7 +2180,7 @@ public void MicrosoftIntune ([Values] bool isRelease, [Values] AndroidRuntime ru
.Replace ("Icon = \"@drawable/icon\")]", "Icon = \"@drawable/icon\", Theme = \"@style/Theme.AppCompat.Light.DarkActionBar\")]")
.Replace ("public class MainActivity : Activity", "public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity");
var abis = new string [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" };
proj.SetAndroidSupportedAbis (abis);
proj.SetRuntimeIdentifiers (abis);
builder = CreateApkBuilder ();
builder.BuildLogFile = "install.log";
Assert.IsTrue (builder.Install (proj), "Install should have succeeded.");
Expand Down
Loading