Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into darc-main-65998f2a-6c…
Browse files Browse the repository at this point in the history
…bb-40ce-874f-d9e4964f7051
  • Loading branch information
jonpryor committed Apr 14, 2021
2 parents 1f1088a + 99273de commit 66c3a90
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .external
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
xamarin/monodroid:main@78f627984b173e09054b86a58fcba8fd3b998be9
xamarin/monodroid:main@45abd3f98d221a75c2d425ed94f2b6b31b8778d3
mono/mono:2020-02@eb4c3116ebf3ac44f72232fc9315fa4947c04b44
1 change: 0 additions & 1 deletion Documentation/guides/messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ ms.date: 01/24/2020
+ [XA0121](xa0121.md): Assembly '{assembly}' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.
+ [XA0122](xa0122.md): Assembly '{assembly}' is using a deprecated attribute '[assembly: Java.Interop.DoNotPackageAttribute]'. Use a newer version of this NuGet package or notify the library author.
+ XA0123: Removing {issue} from {propertyName}. Lint {version} does not support this check.
+ [XA0124](xa0124.md): Interpreter is not supported by the x86 ABI
+ [XA0125](xa0125.md): `{Project}` is using a deprecated debug information level.
Set the debugging information to Portable in the Visual Studio project property pages or edit the project file in a text editor and set the 'DebugType' MSBuild property to 'portable' to use the newer, cross-platform debug information level.
If this file comes from a NuGet package, update to a newer version of the NuGet package or notify the library author.
Expand Down
18 changes: 0 additions & 18 deletions Documentation/guides/messages/xa0124.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System.Globalization;
using System.Linq;
using System.Xml;
using Microsoft.Build.Framework;
Expand Down Expand Up @@ -61,7 +62,7 @@ public override bool Execute ()
writer.WriteEndElement (); // </TargetPlatformSupported>
writer.WriteStartElement ("TargetPlatformVersion");
writer.WriteAttributeString ("Condition", " '$(TargetPlatformVersion)' == '' ");
writer.WriteString (versions.MaxStableVersion.ApiLevel.ToString ());
writer.WriteString (versions.MaxStableVersion.ApiLevel.ToString ("0.0", CultureInfo.InvariantCulture));
writer.WriteEndElement (); // </TargetPlatformVersion>
writer.WriteEndElement (); // </PropertyGroup>

Expand All @@ -70,7 +71,7 @@ public override bool Execute ()
.Where (v => v.ApiLevel >= MinimumApiLevel)
.OrderBy (v => v.ApiLevel)) {
writer.WriteStartElement ("AndroidSdkSupportedTargetPlatformVersion");
writer.WriteAttributeString ("Include", version.ApiLevel.ToString ());
writer.WriteAttributeString ("Include", version.ApiLevel.ToString ("0.0", CultureInfo.InvariantCulture));
writer.WriteEndElement (); // </AndroidSdkSupportedTargetPlatformVersion>
}
writer.WriteStartElement ("SdkSupportedTargetPlatformVersion");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ This file contains *temporary* workarounds for NuGet in .NET 5.
<UsingTask TaskName="Xamarin.Android.Tasks.FixupNuGetReferences" AssemblyFile="$(_XamarinAndroidBuildTasksAssembly)" />

<PropertyGroup>
<_AndroidPlatformVersion>$(TargetPlatformVersion)</_AndroidPlatformVersion>
<_AndroidPlatformVersion Condition=" !$(_AndroidPlatformVersion.EndsWith ('.0')) ">$(_AndroidPlatformVersion).0</_AndroidPlatformVersion>
<!-- Clear $(AssetTargetFallback), so only $(PackageTargetFallback) is used. -->
<AssetTargetFallback></AssetTargetFallback>
<!--
Use $(PackageTargetFallback), even though it is deprecated.
It doesn't suffer from: https://github.com/NuGet/docs.microsoft.com-nuget/issues/1955
-->
<PackageTargetFallback>
net6.0-android$(TargetPlatformVersion).0;
net6.0-android$(_AndroidPlatformVersion);
monoandroid12.0;
monoandroid11.0;
monoandroid10.0;
Expand Down
3 changes: 0 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</comment>
</data>
<data name="XA0124" xml:space="preserve">
<value>Interpreter is not supported by the x86 ABI</value>
</data>
<data name="XA0125" xml:space="preserve">
<value>'{0}' is using a deprecated debug information level.
Set the debugging information to Portable in the Visual Studio project property pages or edit the project file in a text editor and set the 'DebugType' MSBuild property to 'portable' to use the newer, cross-platform debug information level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">x86 ABI nepodporuje interpret.</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Při parsování {0} došlo k problému. Pravděpodobnou příčinou je neúplný nebo neplatný kód XML. Výjimka: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">Der Interpreter wird von der x86-ABI nicht unterstützt.</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Problem beim Analysieren von "{0}". Dies ist wahrscheinlich auf eine unvollständige oder ungültige XML-Datei zurückzuführen. Ausnahme: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">ABI x86 no admite el intérprete</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Hubo un problema al analizar {0}. Probablemente se deba a un elemento XML incompleto o no válido. Excepción: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">L'interpréteur n'est pas pris en charge par l'ABI x86</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Un problème s'est produit durant l'analyse de {0}. Cela est probablement dû à du code XML incomplet ou non valide. Exception : {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">L'interprete non è supportato dall'ABI x86</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Si è verificato un problema durante l'analisi di {0}, probabilmente a causa di codice XML incompleto o non valido. Eccezione: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">インタープリターは x86 ABI ではサポートされていません</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">{0} の解析で問題が発生しました。不完全または無効な XML が原因である可能性があります。例外: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">인터프리터는 x86 ABI에서 지원되지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">{0}을(를) 구문 분석하는 중 문제가 발생했습니다. XML이 불완전하거나 잘못된 것 같습니다. 예외: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">Interpreter nie jest obsługiwany przez interfejs ABI x86</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Wystąpił problem podczas analizowania pliku {0}. Prawdopodobnie jest to spowodowane niekompletnym lub nieprawidłowym kodem XML. Wyjątek: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">O interpretador não é compatível com a ABI x86</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Ocorreu um problema ao analisar {0}. Isso provavelmente se deve a XML incompleto ou inválido. Exceção: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">ABI x86 не поддерживает интерпретатор</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">Возникла проблема при синтаксическом анализе {0}. Возможная причина: неполный или недопустимый код XML. Исключение: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">Yorumlayıcı, x86 ABI tarafından desteklenmiyor</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">{0} ayrıştırılırken bir sorun oluştu. Bunun nedeni büyük olasılıkla tamamlanmamış veya geçersiz XML olabilir. Özel durum: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">X86 ABI 不支持解释程序</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">分析 {0} 时出现问题。这可能是由于 XML 不完整或无效。异常: {1}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ When it appears in the middle of a sentence, "lint" is not capitalized.
{1} - The literal name of the MSBuild property
{2} - The lint version number</note>
</trans-unit>
<trans-unit id="XA0124">
<source>Interpreter is not supported by the x86 ABI</source>
<target state="translated">x86 ABI 不支援解譯器</target>
<note />
</trans-unit>
<trans-unit id="XA1000">
<source>There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}</source>
<target state="translated">剖析 {0} 時發生問題。此情況可能是 XML 不完整或無效所致。例外狀況: {1}</target>
Expand Down
10 changes: 0 additions & 10 deletions src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class BuildApk : AndroidTask

public string TlsProvider { get; set; }
public string UncompressedFileExtensions { get; set; }
public bool InterpreterEnabled { get; set; }

// Make it required after https://github.com/xamarin/monodroid/pull/1094 is merged
//[Required]
Expand Down Expand Up @@ -121,15 +120,6 @@ protected virtual void FixupArchive (ZipArchiveEx zip) { }

void ExecuteWithAbi (string [] supportedAbis, string apkInputPath, string apkOutputPath, bool debug, bool compress, IDictionary<string, CompressedAssemblyInfo> compressedAssembliesInfo)
{
if (InterpreterEnabled) {
foreach (string abi in supportedAbis) {
if (String.Compare ("x86", abi, StringComparison.OrdinalIgnoreCase) == 0) {
Log.LogCodedError ("XA0124", Properties.Resources.XA0124);
return;
}
}
}

ArchiveFileList files = new ArchiveFileList ();
bool refresh = true;
if (apkInputPath != null && File.Exists (apkInputPath) && !File.Exists (apkOutputPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void BuildHasNoWarnings (bool isRelease, bool xamarinForms, bool multidex
}
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings.");
b.AssertHasNoWarnings ();
Assert.IsFalse (StringAssertEx.ContainsText (b.LastBuildOutput, "Warning: end of file not at end of a line"),
"Should not get a warning from the <CompileNativeAssembly/> task.");
var lockFile = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, ".__lock");
Expand All @@ -195,7 +195,7 @@ public void ClassLibraryHasNoWarnings ()
proj.SetProperty ("AndroidEnableMultiDex", "true");
using (var b = CreateDllBuilder ()) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings.");
b.AssertHasNoWarnings ();

// $(AndroidEnableMultiDex) should not add android-support-multidex.jar!
if (Builder.UseDotNet) {
Expand Down Expand Up @@ -3932,11 +3932,7 @@ public void PackageNamingPolicy ([Values ("LowercaseMD5", "LowercaseCrc64")] str
Assert.IsTrue (b.Build (proj), "build should have succeeded.");
var environment = b.Output.GetIntermediaryPath (Path.Combine ("__environment__.txt"));
FileAssert.Exists (environment);
if (Builder.UseDotNet) {
Assert.AreEqual ($"__XA_PACKAGE_NAMING_POLICY__={packageNamingPolicy}{Environment.NewLine}mono.enable_assembly_preload=0", File.ReadAllText (environment).Trim ());
} else {
Assert.AreEqual ($"__XA_PACKAGE_NAMING_POLICY__={packageNamingPolicy}", File.ReadAllText (environment).Trim ());
}
Assert.AreEqual ($"__XA_PACKAGE_NAMING_POLICY__={packageNamingPolicy}", File.ReadAllText (environment).Trim ());
}
}

Expand Down Expand Up @@ -4070,10 +4066,7 @@ public void XA4310 ([Values ("apk", "aab")] string packageFormat)

StringAssertEx.Contains ("error XA4310", builder.LastBuildOutput, "Error should be XA4310");
StringAssertEx.Contains ("`DoesNotExist`", builder.LastBuildOutput, "Error should include the name of the nonexistent file");
if (!Builder.UseDotNet) {
// ILLink produces lots of warnings in .NET 5+
StringAssertEx.Contains ("0 Warning(s)", builder.LastBuildOutput, "Should have no MSBuild warnings.");
}
builder.AssertHasNoWarnings ();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,7 @@ public void CheckSignApk ([Values(true, false)] bool useApkSigner, [Values(true,
using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
var bin = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath);
Assert.IsTrue (b.Build (proj), "First build failed");
if (!Builder.UseDotNet) {
// In .NET 5+, there are ILLink warnings
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, " 0 Warning(s)"),
"First build should not contain warnings! Contains\n" +
string.Join ("\n", b.LastBuildOutput.Where (line => line.Contains ("warning"))));
}
b.AssertHasNoWarnings ();

//Make sure the APKs are signed
foreach (var apk in Directory.GetFiles (bin, "*-Signed.apk")) {
Expand All @@ -425,12 +420,7 @@ public void CheckSignApk ([Values(true, false)] bool useApkSigner, [Values(true,
item.TextContent = () => proj.StringsXml.Replace ("${PROJECT_NAME}", "Foo");
item.Timestamp = null;
Assert.IsTrue (b.Build (proj), "Second build failed");
if (!Builder.UseDotNet) {
// In .NET 5+, there are ILLink warnings
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, " 0 Warning(s)"),
"Second build should not contain warnings! Contains\n" +
string.Join ("\n", b.LastBuildOutput.Where (line => line.Contains ("warning"))));
}
b.AssertHasNoWarnings ();

//Make sure the APKs are signed
foreach (var apk in Directory.GetFiles (bin, "*-Signed.apk")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,17 @@ public static void AssertEntryContents (this ZipArchive zip, string zipPath, str
Assert.AreEqual (contents, actual, $"{archivePath} should contain {contents}");
}
}

[DebuggerHidden]
public static void AssertHasNoWarnings (this ProjectBuilder builder)
{
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, " 0 Warning(s)"), $"{builder.BuildLogFile} should have no MSBuild warnings.");
}

[DebuggerHidden]
public static void AssertHasNoWarnings (this DotNetCLI dotnet)
{
Assert.IsTrue (StringAssertEx.ContainsText (dotnet.LastBuildOutput, " 0 Warning(s)"), $"{dotnet.BuildLogFile} should have no MSBuild warnings.");
}
}
}
Loading

0 comments on commit 66c3a90

Please sign in to comment.