Commit 2afce7e
committed
[Mono.Android] Generate Mono.Android.xml
Context: dotnet/java-interop#687
Context: dotnet#5200
What do we want? Updated documentation!
How do we get that? Uh…
Historically, [Xamarin.Android API docs][0] were produced by parsing
Android's HTML documentation from `docs-24_r01.zip` and converting it
into [**mdoc**(5) documentation][1] via [`tools/javadoc2mdoc`].
The problem is that Google hasn't released an updated `docs*.zip`
package since API-24 (~6 years ago), and thus are woefully out of date.
There is an alternative, though: with API-30, there is a new `sources`
package which contains the Java source code used for the API level,
which in turn contains Javadoc source code comments. Previous API
levels similarly contained a `android-stubs-src.jar` file which
likewise contained Java source code containing Javadoc comments.
The new approach is to:
1. Update `build-tools/xaprepare` to extract the `sources` package.
2. Use [`java-source-tool.jar`][2] to parse the Java source code,
creating an `android-javadoc.xml` file.
3. [Update `generator`][3] to consume `anddroid-javadoc.xml` and
convert the Javadocs into [C# XML documentation comments][4].
4. Update `src/Mono.Android` so that `generator` will emit
C# XML doc comments, and then produce a `Mono.Android.xml` file.
The result is a `Mono.Android.xml` file which contains imported
Android Javadoc documentation, e.g.
<doc
<assembly><name>Mono.Android</name></assembly>
<members>
<member name="T:Java.Lang.Object">
<summary>Class <c>Object</c> is the root of the class hierarchy.</summary>
<remarks>
<para>Class <c>Object</c> is the root of the class hierarchy.
…
"Later", `Mono.Android.xml` can then be used alongside
[`mdoc update --import=Mono.Android.xml`][5] to update our published
API documentation.
[0]: https://github.com/xamarin/android-api-docs
[1]: http://docs.go-mono.com/?link=man%3amdoc(5)
[2]: dotnet/java-interop@69e1b80
[3]: dotnet/java-interop#687
[4]: https://docs.microsoft.com/dotnet/csharp/codedoc
[5]: http://docs.go-mono.com/?link=man%3amdoc-update(1)1 parent f1a6e22 commit 2afce7e
File tree
9 files changed
+99
-6
lines changed- build-tools
- installers
- xaprepare/xaprepare
- ConfigAndData/Dependencies
- ThirdPartyNotices
- external
- src/Mono.Android
9 files changed
+99
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
379 | | - | |
| 381 | + | |
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| |||
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
392 | 398 | | |
393 | 399 | | |
394 | 400 | | |
| |||
454 | 460 | | |
455 | 461 | | |
456 | 462 | | |
| 463 | + | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| |||
Submodule Java.Interop updated 36 files
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/IronyExtensions.cs+28
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/JavadocInfo.cs+31
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.BlockTagsBnfTerms.cs+196
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs+303
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs+115
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.cs+124
- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocParser.cs+121
- src/Java.Interop.Tools.JavaSource/README.md+31
- tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.BlockTagsBnfTermsTests.cs+137
- tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.HtmlBnfTermsTests.cs+51
- tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.InlineTagsBnfTermsTests.cs+92
- tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs+64
- tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs+141
- tools/generator/CodeGenerator.cs+2
- tools/generator/CodeGeneratorOptions.cs+5
- tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs+1
- tools/generator/Java.Interop.Tools.Generator.ObjectModel/Field.cs+3
- tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs+2
- tools/generator/Java.Interop.Tools.Generator.ObjectModel/Javadoc.cs+79
- tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs+302
- tools/generator/Java.Interop.Tools.Generator.ObjectModel/MethodBase.cs+2
- tools/generator/Java.Interop.Tools.Generator.Transformation/JavadocFixups.cs+87
- tools/generator/SourceWriters/BoundClass.cs+1
- tools/generator/SourceWriters/BoundConstructor.cs+1
- tools/generator/SourceWriters/BoundField.cs+1
- tools/generator/SourceWriters/BoundFieldAsProperty.cs+1
- tools/generator/SourceWriters/BoundInterface.cs+1
- tools/generator/SourceWriters/BoundInterfaceMethodDeclaration.cs+2
- tools/generator/SourceWriters/BoundMethod.cs+2
- tools/generator/SourceWriters/BoundMethodAbstractDeclaration.cs+2
- tools/generator/SourceWriters/BoundMethodStringOverload.cs+2
- tools/generator/generator.csproj+2
- tools/java-source-utils/src/main/java/com/microsoft/android/App.java+4-3
- tools/java-source-utils/src/main/java/com/microsoft/android/JavaSourceUtilsOptions.java+60-2
- tools/java-source-utils/src/main/java/com/microsoft/android/JavadocXmlGenerator.java+70-16
- tools/java-source-utils/src/test/java/com/microsoft/android/JavadocXmlGeneratorTest.java+4-1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
344 | 354 | | |
345 | 355 | | |
346 | 356 | | |
347 | | - | |
| 357 | + | |
| 358 | + | |
348 | 359 | | |
349 | 360 | | |
350 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
56 | 100 | | |
57 | 101 | | |
58 | 102 | | |
| |||
113 | 157 | | |
114 | 158 | | |
115 | 159 | | |
| 160 | + | |
116 | 161 | | |
117 | 162 | | |
118 | 163 | | |
119 | 164 | | |
120 | 165 | | |
121 | | - | |
| 166 | + | |
| 167 | + | |
122 | 168 | | |
123 | 169 | | |
124 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments