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 @@ -35,6 +35,9 @@ public class ReadAndroidManifest : AndroidTask
[Output]
public bool UseEmbeddedDex { get; set; } = false;

[Output]
public bool IsTestOnly { get; set; } = false;

public override bool RunTask ()
{
var androidNs = AndroidAppManifest.AndroidXNamespace;
Expand All @@ -52,6 +55,11 @@ public override bool RunTask ()
UseEmbeddedDex = value;
}

text = app.Attribute (androidNs + "testOnly")?.Value;
if (bool.TryParse (text, out value)) {
IsTestOnly = value;
}

var libraries = new List<ITaskItem> ();
foreach (var uses_library in app.Elements ("uses-library")) {
var attribute = uses_library.Attribute (androidNs + "name");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,7 @@ because xbuild doesn't support framework reference assemblies.
<Output TaskParameter="EmbeddedDSOsEnabled" PropertyName="_EmbeddedDSOsEnabled" />
<Output TaskParameter="UsesLibraries" ItemName="AndroidExternalJavaLibrary" />
<Output TaskParameter="UseEmbeddedDex" PropertyName="_UseEmbeddedDex" />
<Output TaskParameter="IsTestOnly" PropertyName="_AndroidIsTestOnlyPackage" />
</ReadAndroidManifest>
<PropertyGroup>
<AndroidStoreUncompressedFileExtensions Condition=" '$(_EmbeddedDSOsEnabled)' == 'True' ">.so;$(AndroidStoreUncompressedFileExtensions)</AndroidStoreUncompressedFileExtensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,14 @@ public void ResourceDesignerWithNuGetReference ([Values ("net8.0-android33.0")]
}

[Test]
public void SingleProject_ApplicationId ()
public void SingleProject_ApplicationId ([Values (false, true)] bool testOnly)
{
AssertHasDevices ();

proj = new XamarinAndroidApplicationProject ();
proj.SetProperty ("ApplicationId", "com.i.should.get.overridden.by.the.manifest");
if (testOnly)
proj.AndroidManifest = proj.AndroidManifest.Replace ("<application", "<application android:testOnly=\"true\"");

var abis = new string [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" };
proj.SetAndroidSupportedAbis (abis);
Expand Down