Skip to content

Commit 6873dc7

Browse files
authored
[Mono.Android] Update default API level for docs (#7139)
Improve the `UpdateExternalDocumentation` target so that it will run successfully without having to set extra properties on the command line. API docs will now be generated against API-31 sources by default.
1 parent 918613d commit 6873dc7

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

build-tools/automation/azure-pipelines-apidocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ stages:
6464
workingDirectory: $(Build.SourcesDirectory)
6565
displayName: make prepare
6666

67-
- script: make update-api-docs CONFIGURATION=$(XA.Build.Configuration) MSBUILD_ARGS='-p:AndroidApiLevel=${{ parameters.apiLevel }} -p:AndroidPlatformId=${{ parameters.platformId }} -p:AndroidFrameworkVersion=${{ parameters.frameworkVersion }}'
67+
- script: make update-api-docs CONFIGURATION=$(XA.Build.Configuration) MSBUILD_ARGS='-p:DocsApiLevel=${{ parameters.apiLevel }} -p:DocsPlatformId=${{ parameters.platformId }} -p:DocsFxVersion=${{ parameters.frameworkVersion }}'
6868
workingDirectory: $(Build.SourcesDirectory)
6969
displayName: make update-api-docs
7070

src/Mono.Android/Mono.Android.targets

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,15 @@
285285
</ItemGroup>
286286
</Target>
287287

288+
289+
<PropertyGroup>
290+
<!-- Override these properties to generate docs against a specific API level -->
291+
<DocsApiLevel Condition=" '$(DocsApiLevel)' == '' ">31</DocsApiLevel>
292+
<DocsPlatformId Condition=" '$(DocsPlatformId)' == '' ">31</DocsPlatformId>
293+
<DocsFxVersion Condition=" '$(DocsFxVersion)' == '' ">v12.0</DocsFxVersion>
294+
<_Binlog>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateApiDocs-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog</_Binlog>
295+
</PropertyGroup>
296+
288297
<!-- Generate documentation using MDoc -->
289298
<Target Name="UpdateExternalDocumentation">
290299
<MSBuild Projects="$(MSBuildThisFileDirectory)Mono.Android.csproj"
@@ -294,16 +303,12 @@
294303
</Target>
295304
<Target Name="_UpdateExternalDocumentation">
296305
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
297-
<PropertyGroup>
298-
<_Binlog>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateApiDocs-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog</_Binlog>
299-
</PropertyGroup>
300306
<ItemGroup>
301307
<_BuildProps Include="-p:IncludeAndroidJavadoc=True" />
302308
<_BuildProps Include="-p:TargetFramework=monoandroid10" />
303-
<!-- Override these properties to generate docs against a specific API level -->
304-
<_BuildProps Include="-p:AndroidApiLevel=$(AndroidApiLevel)" />
305-
<_BuildProps Include="-p:AndroidPlatformId=$(AndroidPlatformId)" />
306-
<_BuildProps Include="-p:AndroidFrameworkVersion=$(AndroidFrameworkVersion)" />
309+
<_BuildProps Include="-p:AndroidApiLevel=$(DocsApiLevel)" />
310+
<_BuildProps Include="-p:AndroidPlatformId=$(DocsPlatformId)" />
311+
<_BuildProps Include="-p:AndroidFrameworkVersion=$(DocsFxVersion)" />
307312
</ItemGroup>
308313
<Exec
309314
Command="&quot;$(DotNetPreviewTool)&quot; build -v:n -c $(Configuration) -bl:$(_Binlog) @(_BuildProps, ' ')"
@@ -321,11 +326,11 @@
321326
<Target Name="_RunMdoc">
322327
<PropertyGroup>
323328
<_Mdoc Condition=" '$(Pkgmdoc)' != '' ">"$(Pkgmdoc)/tools/mdoc.exe"</_Mdoc>
324-
<_Libdir>-L "$(OutputPath)../v1.0"</_Libdir>
325-
<_AssemblyBasename>$(OutputPath)Mono.Android</_AssemblyBasename>
329+
<_Libdir>-L "$(XAInstallPrefix)xbuild-frameworks/MonoAndroid/v1.0"</_Libdir>
330+
<_AssemblyBasename>$(XAInstallPrefix)xbuild-frameworks/MonoAndroid/$(DocsFxVersion)/Mono.Android</_AssemblyBasename>
326331
<_ImportXml>-i "$(_AssemblyBasename).xml"</_ImportXml>
327332
<_Assembly>$(_AssemblyBasename).dll</_Assembly>
328-
<_JIAssembly>$(OutputPath)../v1.0/Java.Interop.dll</_JIAssembly>
333+
<_JIAssembly>$(XAInstallPrefix)xbuild-frameworks/MonoAndroid/v1.0/Java.Interop.dll</_JIAssembly>
329334
<_Output>-o "$(MSBuildThisFileDirectory)../../external/android-api-docs/docs/Mono.Android/en"</_Output>
330335
<_DocTypeArgs Condition=" '$(DocTypeName)' != '' ">--type=$(DocTypeName)</_DocTypeArgs>
331336
<_FxMoniker>xamarin-android-sdk-12</_FxMoniker>

0 commit comments

Comments
 (0)