Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mono.Android] Generate API docs for API level 35 #9647

Merged
merged 15 commits into from
Jan 8, 2025
Merged

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Jan 3, 2025

Updates xaprepare and Mono.Android to generate API Docs against API level 35 sources.

The azure-pipelines-apidocs.yaml pipeline has been updated to use the 1ES pipeline template to improve compatibility with existing yaml templates.

The semi-automated API docs build and update workflow uses the .NET framework version of Mdoc and the target has been updated to continue to mirror that workflow.

Bumps to dotnet/java-interop@fe00cef5:
dotnet/java-interop@2c06b3c...fe00cef

@pjcollins
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jonpryor pushed a commit to dotnet/java-interop that referenced this pull request Jan 7, 2025
)

Context: dotnet/android#9647

dotnet/android#9647 attempted to import API docs for API 35, and
produced the following warning:

	The following issues were found, review the build log for more details:
	>   ## Unable to translate remarks for android/app/admin/DevicePolicyManager:
	>   JavadocImport-Error (31:39): Syntax error, expected: </p>, </P>, #PCDATA, <tt>, <TT>, <i>, <I>, <a attr=, <code>, {@code, {@docroot}, {@inheritdoc}, {@link, {@linkplain, {@literal, {@see, {@value}, {@value, IgnorableDeclaration, {@param, UnknownHtmlElementStart, <p>, <P>, <pre , @author, @apiSince, @deprecated, @deprecatedSince, @exception, @inheritdoc, @hide, @param, @return, @see, @Serialdata, @serialField, @SInCE, @throws, @[unknown], @Version
	    <li>A <i id="deviceowner">Device Owner</i>, which only ever exists on the
	                                          ^

Parsing logic fails here because the `<i>` tag has an `id` attribute
_and_ is present in an open `<p>` tag.

Turns Out™ that HTML allows attributes on nearly *everything*; e.g.
from [§3.2.3 Global attributes][0]: 

> The following attributes are common to and may be specified on all
> [HTML elements](https://dev.w3.org/html5/spec-LC/infrastructure.html#html-elements)
> (even those not defined in this specification):
>   * …
>   * `id`

Given this, it doesn't make sense for `CreateStartElement()` to not
allow any attributes.  Update `CreateStartElement()` so that *all*
elements *ignore* any specified attributes (by default), which
allows `<i id="deviceowner">Device Owner</i>` to work.

The regex used has also been improved to include word boundaries
around the tag name to make sure that it does not match unexpected
elements.

[0]: https://dev.w3.org/html5/spec-LC/elements.html#global-attributes
@pjcollins
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pjcollins pjcollins marked this pull request as ready for review January 7, 2025 22:51
@jonpryor jonpryor merged commit 3d2ae4b into main Jan 8, 2025
61 checks passed
@jonpryor jonpryor deleted the dev/pjc/api35-docs branch January 8, 2025 18:10
pjcollins added a commit to dotnet/java-interop that referenced this pull request Jan 8, 2025
)

Context: dotnet/android#9647

dotnet/android#9647 attempted to import API docs for API 35, and
produced the following warning:

	The following issues were found, review the build log for more details:
	>   ## Unable to translate remarks for android/app/admin/DevicePolicyManager:
	>   JavadocImport-Error (31:39): Syntax error, expected: </p>, </P>, #PCDATA, <tt>, <TT>, <i>, <I>, <a attr=, <code>, {@code, {@docroot}, {@inheritdoc}, {@link, {@linkplain, {@literal, {@see, {@value}, {@value, IgnorableDeclaration, {@param, UnknownHtmlElementStart, <p>, <P>, <pre , @author, @apiSince, @deprecated, @deprecatedSince, @exception, @inheritdoc, @hide, @param, @return, @see, @Serialdata, @serialField, @SInCE, @throws, @[unknown], @Version
	    <li>A <i id="deviceowner">Device Owner</i>, which only ever exists on the
	                                          ^

Parsing logic fails here because the `<i>` tag has an `id` attribute
_and_ is present in an open `<p>` tag.

Turns Out™ that HTML allows attributes on nearly *everything*; e.g.
from [§3.2.3 Global attributes][0]: 

> The following attributes are common to and may be specified on all
> [HTML elements](https://dev.w3.org/html5/spec-LC/infrastructure.html#html-elements)
> (even those not defined in this specification):
>   * …
>   * `id`

Given this, it doesn't make sense for `CreateStartElement()` to not
allow any attributes.  Update `CreateStartElement()` so that *all*
elements *ignore* any specified attributes (by default), which
allows `<i id="deviceowner">Device Owner</i>` to work.

The regex used has also been improved to include word boundaries
around the tag name to make sure that it does not match unexpected
elements.

[0]: https://dev.w3.org/html5/spec-LC/elements.html#global-attributes
pjcollins added a commit that referenced this pull request Jan 8, 2025
Changes: dotnet/java-interop@2a1e180...03cb8e2

  * dotnet/java-interop@03cb8e25: [Java.Interop.Tools.JavaSource] Support html tags with attributes

Bump to dotnet/java-interop@03cb8e25 to get Javadoc import fixes.

Updates xaprepare and Mono.Android to generate API Docs against
API-35 sources.

The `azure-pipelines-apidocs.yaml` pipeline has been updated to use
the 1ES pipeline template to improve compatibility with existing
yaml templates.

The semi-automated API docs build and update workflow uses the
.NET Framework version of Mdoc and the `RunMdoc` target has been
updated to continue to mirror that workflow.
grendello added a commit that referenced this pull request Jan 9, 2025
* main:
  Add `$(Nullable)` = `annotations` to projects using NRT annotations without NRT enabled. (#9660)
  [Xamarin.Android.Build.Tasks] Add %(NuGetPackage*) to TaskItems (#9559)
  Bump to dotnet/java-interop@ee47652d (#9659)
  [XABT] Remove <CollectAssemblyFilesForArchive/> from FastDeployment (#9650)
  [Mono.Android] Generate API docs for API level 35 (#9647)
  [java-runtime] simplify `mono.MonoPackageManager.LoadApplication()` (#9655)
  [Mono.Android] Bind Android API-Baklava DP2. (#9653)
  [build+macOS] Remove quarantine from OpenJDK installations (#9652)
grendello added a commit that referenced this pull request Jan 9, 2025
* dev/grendel/use-libc++:
  Add `$(Nullable)` = `annotations` to projects using NRT annotations without NRT enabled. (#9660)
  [Xamarin.Android.Build.Tasks] Add %(NuGetPackage*) to TaskItems (#9559)
  Bump to dotnet/java-interop@ee47652d (#9659)
  [XABT] Remove <CollectAssemblyFilesForArchive/> from FastDeployment (#9650)
  [Mono.Android] Generate API docs for API level 35 (#9647)
  [java-runtime] simplify `mono.MonoPackageManager.LoadApplication()` (#9655)
  [Mono.Android] Bind Android API-Baklava DP2. (#9653)
  [build+macOS] Remove quarantine from OpenJDK installations (#9652)
jonpryor pushed a commit that referenced this pull request Jan 9, 2025
…9658)

* [Mono.Android] Generate API docs for API level 35 (#9647)

Changes: dotnet/java-interop@2a1e180...03cb8e2

  * dotnet/java-interop@03cb8e25: [Java.Interop.Tools.JavaSource] Support html tags with attributes

Bump to dotnet/java-interop@03cb8e25 to get Javadoc import fixes.

Updates xaprepare and Mono.Android to generate API Docs against
API-35 sources.

The `azure-pipelines-apidocs.yaml` pipeline has been updated to use
the 1ES pipeline template to improve compatibility with existing
yaml templates.

The semi-automated API docs build and update workflow uses the
.NET Framework version of Mdoc and the `RunMdoc` target has been
updated to continue to mirror that workflow.

* [ci] Upgrade on-prem macOS pool to macOS-14 Sonoma (#9477)

Build and test stages using the physical macOS pool have been updated to
use macOS-14 Sonoma images, and builds will now prefer Apple silicon
over Intel machines.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants