From 4f2b30127514a95e8a0fc1abbd161bdfc4a4f1ca Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 16 Dec 2020 22:00:33 -0500 Subject: [PATCH] [Mono.Android] Emit only summary XML, not full XML Context: https://github.com/xamarin/xamarin-android/pull/5253#issuecomment-747172661 Context: https://github.com/xamarin/java.interop/pull/687#issuecomment-743266123 Context: https://github.com/xamarin/java.interop/pull/687/commits/a65b8aba0d6e8a7f29b38e42397290d3f639708a It looks like only emitting ``, ``, ``, and `` is *much* faster than trying to do full ``. Update the `generator.exe` invocation to use `generator --doc-comment-style=summary`, which will hopefully speed things up. --- external/Java.Interop | 2 +- src/Mono.Android/Mono.Android.csproj | 7 ++++++- src/Mono.Android/Mono.Android.targets | 2 +- .../Xamarin/Android/Xamarin.Android.Bindings.Core.targets | 2 ++ src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs | 6 +++++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/external/Java.Interop b/external/Java.Interop index a65b8aba0d6..d870a082812 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit a65b8aba0d6e8a7f29b38e42397290d3f639708a +Subproject commit d870a082812b367e50425b042fa7e30ac1e392ca diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 2e196f0cb8d..90fe24dc301 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -25,12 +25,17 @@ + + + True + intellisense $(OutputPath)Mono.Android.xml - CS1573;CS1591 + CS1572;CS1573;CS1574;CS1587;CS1591; diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index 13343a093f3..98364ae33dd 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -157,7 +157,7 @@ <_TypeMap>--type-map-report=$(IntermediateOutputPath)mcw\type-mapping.txt <_Api>$(IntermediateOutputPath)mcw\api.xml <_Dirs>--enumdir=$(IntermediateOutputPath)mcw - <_WithJavadocXml Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">"--with-javadoc-xml=$(_AndroidJavadocXml)" + <_WithJavadocXml Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">--doc-comment-verbosity=$(AndroidJavadocVerbosity) "--with-javadoc-xml=$(_AndroidJavadocXml)" <_FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)')) <_LangFeatures>--lang-features=nullable-reference-types <_LangFeatures Condition="$(AndroidApiLevel) >= 30">$(_LangFeatures),default-interface-methods,nested-interface-types,interface-constants diff --git a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets index 9911326447f..a2bc0142ad0 100644 --- a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets +++ b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets @@ -18,6 +18,7 @@ It is shared between "legacy" binding projects and .NET 5 projects. false $(IntermediateOutputPath)generated\ + intellisense $(IntermediateOutputPath)api.xml <_GeneratorStampFile>$(IntermediateOutputPath)generator.stamp @@ -74,6 +75,7 @@ It is shared between "legacy" binding projects and .NET 5 projects. ApiXmlInput="$(ApiOutputFile)" AnnotationsZipFiles="@(AnnotationsZip)" AssemblyName="$(AssemblyName)" + JavadocVerbosity="$(AndroidJavadocVerbosity)" JavadocXml="@(_JavadocXml)" TransformFiles="@(TransformFile)" ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)" diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs index 213205f14c2..e73cc96debc 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs @@ -53,6 +53,7 @@ public class BindingsGenerator : AndroidDotnetToolTask public ITaskItem[] AnnotationsZipFiles { get; set; } public ITaskItem[] JavadocXml { get; set; } + public string JavadocVerbosity { get; set; } private List> transform_files = new List> (); @@ -169,9 +170,12 @@ protected override string GenerateCommandLineCommands () if (EnableInterfaceMembersPreview && SupportsCSharp8) WriteLine (sw, "--lang-features=interface-constants,default-interface-methods"); + if (!string.IsNullOrEmpty (JavadocVerbosity)) + WriteLine (sw, $"\"--doc-comment-verbosity={JavadocVerbosity}\""); + if (JavadocXml != null) { foreach (var xml in JavadocXml) { - WriteLine (sw, $"--with-javadoc-xml=\"{Path.GetFullPath (xml.ItemSpec)}\""); + WriteLine (sw, $"\"--with-javadoc-xml={Path.GetFullPath (xml.ItemSpec)}\""); } } }