Skip to content

Commit

Permalink
Merge branch 'dev/grendel/use-libc++' into dev/grendel/clr-host
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
grendello committed Jan 9, 2025
2 parents 75c296e + 94f245f commit e3c3a16
Show file tree
Hide file tree
Showing 28 changed files with 3,368 additions and 370 deletions.
20 changes: 17 additions & 3 deletions Documentation/docs-mobile/messages/xa0141.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
---
title: .NET for Android warning XA0141
description: XA0141 warning code
ms.date: 07/22/2024
ms.date: 01/08/2025
---
# .NET for Android warning XA0141

## Issue

NuGet package '{0}' version '{1}' contains a shared library '{2}' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details
Future versions of Android on arm64 will require that native libraries use 16 KB page sizes.
This requires that the mentioned native libraries be recompiled, and all apps using those
native libraries be rebuilt to contain the fixed versions of the native libraries.

See the Android SDK [Support 16 KB page sizes](https://developer.android.com/guide/practices/page-sizes)
documentation for more information.

## Solution

The indicated native shared library must be recompiled and relinked with the 16k alignment, as per URL indicated in the message.
The indicated native shared library must be recompiled and relinked with the 16k alignment, as per
the Android SDK [Support 16 KB page sizes](https://developer.android.com/guide/practices/page-sizes)
documentation.

## Example messages

> warning XA0141: Android 16 will require 16 KB page sizes, Shared library 'libface_detector_v2_jni.so' does not have a 16 KB page size.
> Please inform the authors of the NuGet package 'Xamarin.GooglePlayServices.Vision.Face.Contour.Internal' version '116.1.0.19'
> which contains 'lib/net8.0-android34.0/play-services-vision-face-contour-internal.aar'.
> See https://developer.android.com/guide/practices/page-sizes for more details.
245 changes: 132 additions & 113 deletions build-tools/automation/azure-pipelines-apidocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
trigger: none
pr: none

resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

parameters:
- name: apiLevel
displayName: AndroidApiLevel property value
Expand Down Expand Up @@ -50,118 +57,130 @@ variables:
value: ''


stages:
- stage: mac_build
displayName: Build
dependsOn: []
jobs:
- job: mac_build_update_docs
displayName: Update API Docs
pool:
name: $(SharedMacPool)
demands:
- macOS.Name -equals $(SharedMacName)
- Agent.OSArchitecture -equals $(SharedMacArch)
timeoutInMinutes: 120
workspace:
clean: all
steps:
- checkout: self
submodules: recursive

- script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17"
displayName: set JI_JAVA_HOME

# Set MSBuild property overrides if parameters are set
- ${{ if ne(parameters.apiLevel, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsApiLevelArg]-p:DocsApiLevel=${{ parameters.apiLevel }}"
displayName: set DocsApiLevelArg

- ${{ if ne(parameters.platformId, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsPlatformIdArg]-p:DocsPlatformId=${{ parameters.platformId }}"
displayName: set DocsPlatformIdArg

- ${{ if ne(parameters.frameworkVersion, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsFxVersionArg]-p:DocsFxVersion=${{ parameters.frameworkVersion }}"
displayName: set DocsFxVersionArg

- ${{ if ne(parameters.mdocVersion, 'default') }}:
- script: echo "##vso[task.setvariable variable=MdocPackageVersionArg]-p:MdocPackageVersion=${{ parameters.mdocVersion }}"
displayName: set MdocPackageVersionArg

- ${{ if ne(parameters.javadocVerbosity, 'default') }}:
- script: echo "##vso[task.setvariable variable=AndroidJavadocVerbosity]-p:AndroidJavadocVerbosity=${{ parameters.javadocVerbosity }}"
displayName: set AndroidJavadocVerbosity

- template: yaml-templates/use-dot-net.yaml

- task: NuGetAuthenticate@1
displayName: authenticate with azure artifacts
inputs:
forceReinstallCredentialProvider: true

- template: yaml-templates/run-xaprepare.yaml
parameters:
displayName: update mono
arguments: --s=UpdateMono

- script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1
workingDirectory: $(Build.SourcesDirectory)
displayName: make prepare

- script: >-
make update-api-docs CONFIGURATION=$(XA.Build.Configuration)
MSBUILD_ARGS='$(DocsApiLevelArg) $(DocsPlatformIdArg) $(DocsFxVersionArg) $(MdocPackageVersionArg) $(AndroidJavadocVerbosity)'
workingDirectory: $(Build.SourcesDirectory)
displayName: make update-api-docs
- script: >
mkdir -p $(Build.StagingDirectory)/docs-binaries &&
ln $(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/34/*.dll $(Build.StagingDirectory)/docs-binaries/ &&
ln $(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/34/*.xml $(Build.StagingDirectory)/docs-binaries/
displayName: copy docs files
- task: PublishPipelineArtifact@1
displayName: upload docs files
inputs:
artifactName: Binaries
targetPath: $(Build.StagingDirectory)/docs-binaries

- script: >
mkdir -p $(Build.StagingDirectory)/api-doc-diff &&
ln $(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/UpdateApiDocs*.diff $(Build.StagingDirectory)/api-doc-diff/
displayName: copy api docs diff
- task: PublishPipelineArtifact@1
displayName: upload api docs diff
inputs:
artifactName: Api Docs Diff
targetPath: $(Build.StagingDirectory)/api-doc-diff

- template: yaml-templates/upload-results.yaml
parameters:
artifactName: Build Results - API Docs Update
includeBuildResults: true
condition: always()

- powershell: |
$docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1
$buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-build.log"
& "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog
$issueContent = & {
Get-Content -Path $buildLog | Select-String "## Exception translating remarks"
Get-Content -Path $buildLog | Select-String "## Unable to translate remarks"
Get-Content -Path $buildLog | Select-String "JavadocImport-"
}
if ($issueContent) {
Write-Host "The following issues were found, review the build log for more details:"
Write-Host ""
foreach ($line in $issueContent) {
Write-Host $line
extends:
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
${{ else }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: $(WindowsPoolImage1ESPT)
os: windows
suppression:
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
stages:
- stage: mac_build
displayName: Build
dependsOn: []
jobs:
- job: mac_build_update_docs
displayName: Update API Docs
pool:
name: $(SharedMacPool)
demands:
- macOS.Name -equals $(SharedMacName)
- Agent.OSArchitecture -equals $(SharedMacArch)
os: macOS
timeoutInMinutes: 120
workspace:
clean: all
templateContext:
outputs:
- output: pipelineArtifact
displayName: upload docs binaries
artifactName: Binaries
targetPath: $(Build.SourcesDirectory)/src/Mono.Android/obj/docs-gen-temp
- output: pipelineArtifact
displayName: upload docs diff
artifactName: Api Docs Diff
targetPath: $(Build.StagingDirectory)/api-doc-diff
steps:
- checkout: self
submodules: recursive

- script: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17"
echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17"
displayName: set JI_JAVA_HOME
# Set MSBuild property overrides if parameters are set
- ${{ if ne(parameters.apiLevel, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsApiLevelArg]-p:DocsApiLevel=${{ parameters.apiLevel }}"
displayName: set DocsApiLevelArg

- ${{ if ne(parameters.platformId, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsPlatformIdArg]-p:DocsPlatformId=${{ parameters.platformId }}"
displayName: set DocsPlatformIdArg

- ${{ if ne(parameters.frameworkVersion, 'default') }}:
- script: echo "##vso[task.setvariable variable=DocsFxVersionArg]-p:DocsFxVersion=${{ parameters.frameworkVersion }}"
displayName: set DocsFxVersionArg

- ${{ if ne(parameters.mdocVersion, 'default') }}:
- script: echo "##vso[task.setvariable variable=MdocPackageVersionArg]-p:MdocPackageVersion=${{ parameters.mdocVersion }}"
displayName: set MdocPackageVersionArg

- ${{ if ne(parameters.javadocVerbosity, 'default') }}:
- script: echo "##vso[task.setvariable variable=AndroidJavadocVerbosity]-p:AndroidJavadocVerbosity=${{ parameters.javadocVerbosity }}"
displayName: set AndroidJavadocVerbosity

- template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self

- task: NuGetAuthenticate@1
displayName: authenticate with azure artifacts
inputs:
forceReinstallCredentialProvider: true

- script: dotnet tool update -v:n boots --version 1.1.0.36 --add-source "https://api.nuget.org/v3/index.json" --global
displayName: Install boots

- script: boots https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.188.macos10.xamarin.universal.pkg
displayName: Install Mono

- script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1
workingDirectory: $(Build.SourcesDirectory)
displayName: make prepare

- script: >-
make update-api-docs CONFIGURATION=$(XA.Build.Configuration)
MSBUILD_ARGS='$(DocsApiLevelArg) $(DocsPlatformIdArg) $(DocsFxVersionArg) $(MdocPackageVersionArg) $(AndroidJavadocVerbosity)'
workingDirectory: $(Build.SourcesDirectory)
displayName: make update-api-docs
- script: >
mkdir -p $(Build.StagingDirectory)/api-doc-diff &&
ln $(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/UpdateApiDocs*.diff $(Build.StagingDirectory)/api-doc-diff/ &&
ln $(Build.SourcesDirectory)/external/android-api-docs/docs/xml/index.xml $(Build.StagingDirectory)/api-doc-diff/
displayName: copy api docs diff
- template: /build-tools/automation/yaml-templates/upload-results.yaml@self
parameters:
artifactName: Build Results - API Docs Update
includeBuildResults: true
condition: always()

- powershell: |
$docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1
$buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-UpdateApiDocs-build.log"
& "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog
$issueContent = & {
Get-Content -Path $buildLog | Select-String "## Exception translating remarks" -Context 0, 3
Get-Content -Path $buildLog | Select-String "## Unable to translate remarks" -Context 0, 3
Get-Content -Path $buildLog | Select-String "JavadocImport-" -Context 0, 3
}
if ($issueContent) {
Write-Host "The following issues were found, review the build log for more details:"
Write-Host ""
foreach ($line in $issueContent) {
Write-Host $line
Write-Host ""
}
exit 1
}
exit 1
}
displayName: Report issues in docs generation
Write-Host "No issues found."
displayName: Report issues in docs generation
continueOnError: true
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public AndroidToolchain ()
new AndroidPlatformComponent ("platform-33-ext3_r03", apiLevel: "33", pkgRevision: "3"),
new AndroidPlatformComponent ("platform-34-ext7_r02", apiLevel: "34", pkgRevision: "2"),
new AndroidPlatformComponent ("platform-35_r01", apiLevel: "35", pkgRevision: "1", isLatestStable: true),
new AndroidPlatformComponent ("platform-Baklava_r01", apiLevel: "Baklava", pkgRevision: "1", isLatestStable: true),
new AndroidPlatformComponent ("platform-Baklava_r03", apiLevel: "Baklava", pkgRevision: "3", isLatestStable: true),

new AndroidToolchainComponent ("sources-34_r01",
destDir: Path.Combine ("sources", "android-34"),
new AndroidToolchainComponent ("source-35_r01",
destDir: Path.Combine ("sources", "android-35"),
pkgRevision: "1",
dependencyType: AndroidToolchainComponentType.BuildDependency,
buildToolVersion: "34.1"
buildToolVersion: "35.1"
),
new AndroidToolchainComponent ("docs-24_r01",
destDir: "docs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ void MoveContents (string sourceDir, string destinationDir)
{
string realSourceDir = Path.Combine (sourceDir, "Contents", "Home");
Utilities.MoveDirectoryContentsRecursively (realSourceDir, destinationDir);

var xattr_d = new ProcessRunner ("xattr", "-d", "-r", "com.apple.quarantine", ".") {
EchoStandardError = true,
WorkingDirectory = destinationDir,
};
xattr_d.Run ();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<DefineConstants>ILLINK</DefineConstants>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(MicrosoftAndroidSdkOutDir)</OutputPath>
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.ILLink" Version="$(MicrosoftNETILLinkTasksPackageVersion)" />
Expand Down
14 changes: 7 additions & 7 deletions src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,15 @@

<PropertyGroup>
<!-- Override these properties to generate docs against a specific API level -->
<DocsApiLevel Condition=" '$(DocsApiLevel)' == '' ">34</DocsApiLevel>
<DocsApiLevel Condition=" '$(DocsApiLevel)' == '' ">35</DocsApiLevel>
<DocsPlatformId Condition=" '$(DocsPlatformId)' == '' ">$(DocsApiLevel)</DocsPlatformId>
<DocsFxMoniker Condition=" '$(DocsFxMoniker)' == '' ">net-android-$(DocsApiLevel).0</DocsFxMoniker>
<DocsExportOutput Condition=" '$(DocsExportOutput)' == '' ">$(_MonoAndroidNETDefaultOutDir)Mono.Android.xml</DocsExportOutput>
<_ExternalDocsRoot>$(XamarinAndroidSourcePath)external/android-api-docs/docs/xml</_ExternalDocsRoot>
<_LogPrefix>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateApiDocs-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss"))</_LogPrefix>
<_ManagedRuntime Condition=" !$([MSBuild]::IsOSPlatform('windows')) ">mono</_ManagedRuntime>
<_MdocExe Condition=" '$(Pkgmdoc)' != '' ">"$(Pkgmdoc)/tools/net471/mdoc.exe"</_MdocExe>
<_MdocExe Condition=" '$(Pkgmdoc)' == '' ">"$(XAPackagesDir)/mdoc/$(MdocPackageVersion)/tools/net471/mdoc.exe"</_MdocExe>
<_Mdoc Condition=" '$(Pkgmdoc)' != '' ">"$(Pkgmdoc)/tools/net6.0/mdoc.dll"</_Mdoc>
<_Mdoc Condition=" '$(Pkgmdoc)' == '' ">"$(XAPackagesDir)/mdoc/$(MdocPackageVersion)/tools/net6.0/mdoc.dll"</_Mdoc>
</PropertyGroup>
Expand All @@ -270,6 +273,7 @@
/>
</Target>

<!-- `mdoc fx-bootstrap` and `mdoc update` require the .NET framework version of mdoc, a mono install will be needed to run the RunMdoc target on macOS/Linux -->
<Target Name="RunMdoc">
<MSBuild Projects="$(MSBuildThisFileDirectory)Mono.Android.csproj"
Targets="_RunMdoc"
Expand Down Expand Up @@ -305,16 +309,12 @@
SourceFiles="@(_FxAssembly);@(_FxAssemblyXml)"
DestinationFolder="$(_RootFxDir)$(DocsFxMoniker)"
/>
<WriteLinesToFile
File="$(_RootFxDir)frameworks.xml"
Lines="$(FrameworksXmlContent)"
/>
<Exec
Command="dotnet $(_Mdoc) fx-bootstrap -fx $(_RootFxDir) -importContent true"
Command="$(_ManagedRuntime) $(_MdocExe) fx-bootstrap -fx $(_RootFxDir) -importContent true"
WorkingDirectory="$(MSBuildThisFileDirectory)"
/>
<Exec
Command="dotnet $(_Mdoc) update $(_Libdir) $(_Output) $(_DocTypeArgs) $(_FxConfig) $(_ExtraMdocArgs)"
Command="$(_ManagedRuntime) $(_MdocExe) update $(_Libdir) $(_Output) $(_DocTypeArgs) $(_FxConfig) $(_ExtraMdocArgs)"
WorkingDirectory="$(MSBuildThisFileDirectory)"
/>
</Target>
Expand Down
Loading

0 comments on commit e3c3a16

Please # to comment.