Skip to content

Commit

Permalink
[Mono.Android] Emit only summary XML, not full XML
Browse files Browse the repository at this point in the history
Context: dotnet#5253 (comment)
Context: dotnet/java-interop#687 (comment)
Context: dotnet/java-interop@a65b8ab

It looks like only emitting `<summary/>`, `<param/>`, `<returns/>`,
and `<exception/>` is *much* faster than trying to do full
`<remarks/>`.

Update the `generator.exe` invocation to use
`generator --doc-comment-style=summary`, which will hopefully
speed things up.
  • Loading branch information
jonpryor committed Dec 17, 2020
1 parent f8c18d3 commit 4f2b301
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external/Java.Interop
Submodule Java.Interop updated 22 files
+7 −0 src/Java.Interop.Localization/Java.Interop.Localization.csproj
+7 −0 src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj
+34 −25 src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs
+7 −7 src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/MethodDefinitionRocks.cs
+21 −17 src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs
+7 −0 src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj
+4 −4 src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics/XamarinAndroidException.cs
+5 −5 src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs
+6 −2 src/Java.Interop.Tools.Generator/Extensions/UtilityExtensions.cs
+6 −0 src/Java.Interop.Tools.Generator/Java.Interop.Tools.Generator.csproj
+1 −1 src/Java.Interop.Tools.Generator/Utilities/NamingConverter.cs
+0 −1 ...va.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.BlockTagsBnfTerms.cs
+1 −4 src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs
+0 −2 ...a.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs
+3 −3 src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocParser.cs
+1 −0 src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs
+1 −1 tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs
+22 −22 tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs
+30 −0 tests/generator-Tests/Unit-Tests/ReportTests.cs
+9 −9 tools/generator/CodeGeneratorOptions.cs
+2 −2 tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs
+19 −3 tools/generator/Utilities/Report.cs
7 changes: 6 additions & 1 deletion src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
</PropertyGroup>

<PropertyGroup>
<!--
<IncludeAndroidJavadoc Condition=" '$(IncludeAndroidJavadoc)' == '' And '$(CONVERT_JAVADOC_TO_XMLDOC)' == 'true' And '$(AndroidFrameworkVersion)' == '$(AndroidLatestStableFrameworkVersion)'">True</IncludeAndroidJavadoc>
-->
<!-- TODO: replace with above; for CI timing purposes only! -->
<IncludeAndroidJavadoc Condition=" '$(IncludeAndroidJavadoc)' == '' And '$(AndroidFrameworkVersion)' == '$(AndroidLatestStableFrameworkVersion)'">True</IncludeAndroidJavadoc>
<AndroidJavadocVerbosity Condition=" '$(AndroidJavadocVerbosity)' == '' ">intellisense</AndroidJavadocVerbosity>
</PropertyGroup>

<PropertyGroup Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">
<DocumentationFile>$(OutputPath)Mono.Android.xml</DocumentationFile>
<NoWarn>CS1573;CS1591</NoWarn>
<NoWarn>CS1572;CS1573;CS1574;CS1587;CS1591;</NoWarn>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'monoandroid10' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<_TypeMap>--type-map-report=$(IntermediateOutputPath)mcw\type-mapping.txt</_TypeMap>
<_Api>$(IntermediateOutputPath)mcw\api.xml</_Api>
<_Dirs>--enumdir=$(IntermediateOutputPath)mcw</_Dirs>
<_WithJavadocXml Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">"--with-javadoc-xml=$(_AndroidJavadocXml)"</_WithJavadocXml>
<_WithJavadocXml Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">--doc-comment-verbosity=$(AndroidJavadocVerbosity) "--with-javadoc-xml=$(_AndroidJavadocXml)"</_WithJavadocXml>
<_FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)'))</_FullIntermediateOutputPath>
<_LangFeatures>--lang-features=nullable-reference-types</_LangFeatures>
<_LangFeatures Condition="$(AndroidApiLevel) &gt;= 30">$(_LangFeatures),default-interface-methods,nested-interface-types,interface-constants</_LangFeatures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ It is shared between "legacy" binding projects and .NET 5 projects.
<PropertyGroup>
<UseShortGeneratorFileNames Condition=" '$(UseShortGeneratorFileNames)' == '' ">false</UseShortGeneratorFileNames>
<GeneratedOutputPath Condition=" '$(GeneratedOutputPath)' == '' ">$(IntermediateOutputPath)generated\</GeneratedOutputPath>
<AndroidJavadocVerbosity Condition=" '$(AndroidJavadocVerbosity)' == '' ">intellisense</AndroidJavadocVerbosity>
<ApiOutputFile Condition=" '$(ApiOutputFile)' == '' ">$(IntermediateOutputPath)api.xml</ApiOutputFile>
<_GeneratorStampFile>$(IntermediateOutputPath)generator.stamp</_GeneratorStampFile>
</PropertyGroup>
Expand Down Expand Up @@ -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)"
Expand Down
6 changes: 5 additions & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tuple<string, string>> transform_files = new List<Tuple<string,string>> ();

Expand Down Expand Up @@ -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)}\"");
}
}
}
Expand Down

0 comments on commit 4f2b301

Please sign in to comment.