Skip to content

Commit 0503d63

Browse files
authored
[ci] Add pipeline for updating api docs (#6460)
Add a new `azure-pipelines-apidocs.yaml` pipeline that can be used to update the `Mono.Android` API docs in the [xamarin/android-api-docs][0] repository. We will now only build `src/Mono.Android` with generated JavaDoc XML when running this new pipeline. The new pipeline will run the `<UpdateExternalDocumentation/>` target and upload the contents of `/android-api-docs/docs/Mono.Android/en/` as a build artifact. These updated docs can be downloaded for manual review and pull request creation. The .NET 6 packs have been updated to include the same `Mono.Android.xml` docs that are bundled into the traditional Windows `.vsix` installer. These docs are generated from the content of `external/android-api-docs` when the `<AssembleApiDocs/>` installer target is run. [0]: https://github.com/xamarin/android-api-docs
1 parent af301a6 commit 0503d63

File tree

9 files changed

+86
-34
lines changed

9 files changed

+86
-34
lines changed

Configuration.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<AutoProvisionUsesSudo Condition=" '$(AutoProvisionUsesSudo)' == '' ">False</AutoProvisionUsesSudo>
5454
<_XABinRelativeInstallPrefix>lib\xamarin.android</_XABinRelativeInstallPrefix>
5555
<XAInstallPrefix Condition=" '$(XAInstallPrefix)' == '' ">$(MSBuildThisFileDirectory)bin\$(Configuration)\$(_XABinRelativeInstallPrefix)\</XAInstallPrefix>
56+
<_MonoAndroidNETOutputDir>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0\</_MonoAndroidNETOutputDir>
5657
<MingwDependenciesRootDirectory Condition=" '$(MingwDependenciesRootDirectory)' == '' ">$(MSBuildThisFileDirectory)\bin\Build$(Configuration)\mingw-deps</MingwDependenciesRootDirectory>
5758
<HostCc Condition=" '$(HostCc)' == '' ">$(HostCc64)</HostCc>
5859
<HostCxx Condition=" '$(HostCxx)' == '' ">$(HostCxx64)</HostCxx>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Pipeline for updating and uploading android-api-docs/docs/Mono.Android/en/*
2+
# https://dev.azure.com/devdiv/DevDiv/_build?definitionId=15262
3+
4+
# This pipeline can be manually ran against a given branch to generate a new set of Mono.Android docs.
5+
# The `Mono.Android Docs` artifact can be downloaded and copied into a local android-api-docs checkout
6+
# for manual review and pull request creation.
7+
8+
trigger: none
9+
pr: none
10+
11+
# Global variables
12+
variables:
13+
- template: yaml-templates/variables.yaml
14+
15+
stages:
16+
- stage: mac_build
17+
displayName: Build
18+
dependsOn: []
19+
jobs:
20+
- job: mac_build_update_docs
21+
displayName: Update API Docs
22+
pool:
23+
vmImage: macOS-11
24+
timeoutInMinutes: 120
25+
workspace:
26+
clean: all
27+
steps:
28+
- checkout: self
29+
submodules: recursive
30+
31+
- script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/$(XA.Jdk11.Folder)"
32+
displayName: set JI_JAVA_HOME
33+
34+
- template: yaml-templates/use-dot-net.yaml
35+
36+
- task: NuGetAuthenticate@0
37+
displayName: authenticate with azure artifacts
38+
inputs:
39+
forceReinstallCredentialProvider: true
40+
41+
- template: yaml-templates/run-xaprepare.yaml
42+
parameters:
43+
displayName: update mono
44+
arguments: --s=UpdateMono
45+
46+
- script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1
47+
workingDirectory: $(Build.SourcesDirectory)
48+
displayName: make prepare
49+
50+
- task: MSBuild@1
51+
displayName: build jnienv-gen.csproj
52+
inputs:
53+
solution: $(Build.SourcesDirectory)/external/Java.Interop/build-tools/jnienv-gen/jnienv-gen.csproj
54+
configuration: $(XA.Build.Configuration)
55+
msbuildArguments: /restore
56+
57+
- task: MSBuild@1
58+
displayName: update android-api-docs
59+
inputs:
60+
solution: $(Build.SourcesDirectory)/src/Mono.Android/Mono.Android.csproj
61+
configuration: $(XA.Build.Configuration)
62+
msbuildArguments: /restore /t:UpdateExternalDocumentation
63+
64+
- template: yaml-templates/upload-results.yaml
65+
parameters:
66+
xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android
67+
artifactName: Build Results - API Docs Update
68+
includeBuildResults: true
69+
70+
- task: PublishPipelineArtifact@1
71+
displayName: upload Mono.Android docs
72+
inputs:
73+
artifactName: Mono.Android Docs
74+
targetPath: $(Build.SourcesDirectory)/external/android-api-docs/docs/Mono.Android/en/

build-tools/automation/azure-pipelines.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ variables:
4444
value: $[or(eq(variables['XA.RunAllTests'], true), eq(variables['IsMonoBranch'], true))]
4545
- name: DotNetNUnitCategories
4646
value: '& TestCategory != DotNetIgnore & TestCategory != HybridAOT & TestCategory != ProfiledAOT & TestCategory != MkBundle & TestCategory != MonoSymbolicate & TestCategory != PackagesConfig & TestCategory != StaticProject & TestCategory != Debugger & TestCategory != SystemApplication'
47-
- name: CONVERT_JAVADOC_TO_XMLDOC
48-
value: $[ne(variables['Build.DefinitionName'], 'Xamarin.Android-PR')]
4947
- ${{ if and(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), ne(variables['Build.Reason'], 'PullRequest')) }}:
5048
- name: MicroBuildSignType
5149
value: Real

build-tools/create-packs/Directory.Build.targets

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
<UsingTask TaskName="GenerateBuildManifest" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll" />
1414
<UsingTask TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" AssemblyFile="$(PrepTasksAssembly)" />
1515

16-
<PropertyGroup>
17-
<_MonoAndroidNETOutputDir>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0\</_MonoAndroidNETOutputDir>
18-
</PropertyGroup>
19-
2016
<!-- https://github.com/dotnet/runtime/blob/0647ec314948904319da5eb15e9931f7c85ed1e2/src/installer/pkg/projects/Directory.Build.targets#L281 -->
2117
<!-- TODO: Generate PlatformManifest.txt files? -->
2218
<Target Name="_GenerateFrameworkListFile" >

build-tools/create-packs/Microsoft.Android.Ref.proj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ by projects that use the Microsoft.Android framework in .NET 5.
2525
</PropertyGroup>
2626

2727
<Target Name="_GetTargetingPackItems"
28-
DependsOnTargets="_GetLicense">
28+
DependsOnTargets="AssembleApiDocs;_GetLicense">
2929
<PropertyGroup>
3030
<FrameworkListFile>$(IntermediateOutputPath)FrameworkList.xml</FrameworkListFile>
3131
</PropertyGroup>
@@ -40,11 +40,7 @@ by projects that use the Microsoft.Android framework in .NET 5.
4040
<ItemGroup>
4141
<_PackageFiles Include="@(_AndroidRefPackAssemblies)" PackagePath="$(_AndroidRefPackAssemblyPath)" TargetPath="$(_AndroidRefPackAssemblyPath)" />
4242
<_PackageFiles Include="$(_MonoAndroidNETOutputDir)Java.Interop.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" />
43-
<_PackageFiles
44-
Condition=" '$(CONVERT_JAVADOC_TO_XMLDOC)' == 'true' "
45-
Include="$(_MonoAndroidNETOutputDir)Mono.Android.xml"
46-
PackagePath="$(_AndroidRefPackAssemblyPath)"
47-
/>
43+
<_PackageFiles Include="$(_MonoAndroidNETOutputDir)Mono.Android.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" />
4844
<_PackageFiles Include="$(_MonoAndroidNETOutputDir)mono.android.jar" PackagePath="$(_AndroidRefPackAssemblyPath)" />
4945
<_PackageFiles Include="$(_MonoAndroidNETOutputDir)mono.android.dex" PackagePath="$(_AndroidRefPackAssemblyPath)" />
5046
<_PackageFiles Include="$(_MonoAndroidNETOutputDir)AndroidApiInfo.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" />

build-tools/installers/create-installers.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@
5252
<Target Name="_GenerateMsxDocXmls"
5353
DependsOnTargets="_FindFrameworkDirs;_FindDocSourceFiles"
5454
Inputs="@(_MsxDocSourceFile)"
55-
Outputs="@(_MsxDocAssembly->'$(_LatestStableFrameworkDir)%(Identity).xml')">
55+
Outputs="@(_MsxDocAssembly->'$(_LatestStableFrameworkDir)%(Identity).xml');@(_MsxDocAssembly->'$(_MonoAndroidNETOutputDir)%(Identity).xml')">
5656
<Exec Command="$(ManagedRuntime) &quot;$(MSBuildSrcDir)mdoc.exe&quot; --debug export-msxdoc -o &quot;$(_LatestStableFrameworkDir)%(_MsxDocAssembly.Identity).xml&quot; &quot;%(_MsxDocAssembly.SourceDir)&quot;" />
57+
<Copy
58+
SourceFiles="$(_LatestStableFrameworkDir)%(_MsxDocAssembly.Identity).xml"
59+
DestinationFolder="$(_MonoAndroidNETOutputDir)"
60+
/>
61+
<Touch Files="@(_MsxDocAssembly->'$(_LatestStableFrameworkDir)%(Identity).xml');@(_MsxDocAssembly->'$(_MonoAndroidNETOutputDir)%(Identity).xml')" />
5762
</Target>
5863
<Target Name="_GenerateMsxDocXmlRedirects"
5964
DependsOnTargets="_FindFrameworkDirs"

src/Mono.Android/Mono.Android.csproj

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@
2424
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
2525
</PropertyGroup>
2626

27-
<PropertyGroup>
28-
<IncludeAndroidJavadoc Condition=" '$(IncludeAndroidJavadoc)' == '' And '$(CONVERT_JAVADOC_TO_XMLDOC)' == 'true' And ('$(AndroidFrameworkVersion)' == '$(AndroidLatestStableFrameworkVersion)' or '$(TargetFramework)' != 'monoandroid10')">True</IncludeAndroidJavadoc>
29-
<AndroidJavadocVerbosity Condition=" '$(AndroidJavadocVerbosity)' == '' ">intellisense</AndroidJavadocVerbosity>
30-
</PropertyGroup>
31-
32-
<PropertyGroup Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">
33-
<DocumentationFile>$(OutputPath)Mono.Android.xml</DocumentationFile>
34-
<NoWarn>$(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658;</NoWarn>
35-
</PropertyGroup>
36-
3727
<PropertyGroup Condition=" '$(TargetFramework)' == 'monoandroid10' ">
3828
<TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
3929
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
@@ -46,12 +36,8 @@
4636
<OutputPath>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\$(TargetFramework)\</OutputPath>
4737
</PropertyGroup>
4838

49-
<PropertyGroup>
50-
<IncludeAndroidJavadoc Condition=" '$(IncludeAndroidJavadoc)' == '' And '$(CONVERT_JAVADOC_TO_XMLDOC)' == 'true' And '$(AndroidFrameworkVersion)' == '$(AndroidLatestStableFrameworkVersion)'">True</IncludeAndroidJavadoc>
51-
<AndroidJavadocVerbosity Condition=" '$(AndroidJavadocVerbosity)' == '' ">intellisense+extraremarks</AndroidJavadocVerbosity>
52-
</PropertyGroup>
53-
5439
<PropertyGroup Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">
40+
<AndroidJavadocVerbosity Condition=" '$(AndroidJavadocVerbosity)' == '' ">intellisense+extraremarks</AndroidJavadocVerbosity>
5541
<DocumentationFile>$(OutputPath)Mono.Android.xml</DocumentationFile>
5642
<NoWarn>$(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658;</NoWarn>
5743
</PropertyGroup>

src/Mono.Android/Mono.Android.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
<Target Name="_UpdateExternalDocumentation">
283283
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
284284
<PropertyGroup>
285-
<_Binlog>UpdateExternalDocumentation-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog</_Binlog>
285+
<_Binlog>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateExternalDocumentation-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog</_Binlog>
286286
</PropertyGroup>
287287
<Exec
288288
Condition=" '$(HostOS)' != 'Windows' "
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<para>Portions of this page are modifications based on work created and shared by the <format type="text/html">
2-
<a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a>
3-
</format> and used according to terms described in the <format type="text/html">
4-
<a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format>
5-
</para>
1+
<para>Portions of this page are modifications based on work created and shared by the <format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format> and used according to terms described in the <format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>

0 commit comments

Comments
 (0)