From bd42b44e37c665c39c190b5713d026e6826c2602 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 2 Nov 2021 19:10:59 -0400 Subject: [PATCH 1/4] [ci] Add pipeline for updating api docs --- .../automation/azure-pipelines-apidocs.yaml | 68 +++++++++++++++++++ src/Mono.Android/Mono.Android.csproj | 10 --- src/Mono.Android/Mono.Android.targets | 2 +- src/Mono.Android/javadoc-copyright.xml | 6 +- 4 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 build-tools/automation/azure-pipelines-apidocs.yaml diff --git a/build-tools/automation/azure-pipelines-apidocs.yaml b/build-tools/automation/azure-pipelines-apidocs.yaml new file mode 100644 index 00000000000..d4bf1b632e1 --- /dev/null +++ b/build-tools/automation/azure-pipelines-apidocs.yaml @@ -0,0 +1,68 @@ +# Pipeline for updating and uploading android-api-docs/docs/Mono.Android/en/* + +trigger: none +pr: none + +# Global variables +variables: +- template: yaml-templates/variables.yaml + +stages: +- stage: mac_build + displayName: Build + dependsOn: [] + jobs: + - job: mac_build_update_docs + displayName: macOS - Update API Docs + pool: + vmImage: macOS-11 + timeoutInMinutes: 120 + workspace: + clean: all + steps: + - checkout: self + submodules: recursive + + - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/$(XA.Jdk11.Folder)" + displayName: set JI_JAVA_HOME + + - template: yaml-templates/use-dot-net.yaml + + - task: NuGetAuthenticate@0 + displayName: authenticate with azure artifacts + inputs: + forceReinstallCredentialProvider: true + + - script: make prepare-update-mono CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 + workingDirectory: $(Build.SourcesDirectory) + displayName: make prepare-update-mono + + - script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 + workingDirectory: $(Build.SourcesDirectory) + displayName: make prepare + + - task: MSBuild@1 + displayName: build jnienv-gen.csproj + inputs: + solution: $(Build.SourcesDirectory)/external/Java.Interop/build-tools/jnienv-gen/jnienv-gen.csproj + configuration: $(XA.Build.Configuration) + msbuildArguments: /restore + + - task: MSBuild@1 + displayName: update external/android-api-docs + inputs: + solution: $(Build.SourcesDirectory)/src/Mono.Android/Mono.Android.csproj + configuration: $(XA.Build.Configuration) + msbuildArguments: /restore /t:UpdateExternalDocumentation + + - template: yaml-templates/upload-results.yaml + parameters: + xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android + artifactName: Build Results - API Docs Update + includeBuildResults: true + + - task: PublishPipelineArtifact@1 + displayName: upload Mono.Android docs + inputs: + artifactName: Mono.Android Docs + targetPath: $(Build.SourcesDirectory)/external/android-api-docs/docs/Mono.Android/en/ diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 06ec9cbc912..dfeafa80e31 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -24,16 +24,6 @@ true - - True - intellisense - - - - $(OutputPath)Mono.Android.xml - $(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658; - - MonoAndroid v1.0 diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index 25fe40258b0..8e810e73fa7 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -282,7 +282,7 @@ - <_Binlog>UpdateExternalDocumentation-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog + <_Binlog>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateExternalDocumentation-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")).binlog Portions of this page are modifications based on work created and shared by the -Android Open Source Project - and used according to terms described in the -Creative Commons 2.5 Attribution License. - +Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. From 40ef1f553fc72c8393d31ff0e1f8b2c8291fc6a1 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 2 Nov 2021 19:42:00 -0400 Subject: [PATCH 2/4] Use xaprepare template to update mono --- build-tools/automation/azure-pipelines-apidocs.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-tools/automation/azure-pipelines-apidocs.yaml b/build-tools/automation/azure-pipelines-apidocs.yaml index d4bf1b632e1..125514f0b73 100644 --- a/build-tools/automation/azure-pipelines-apidocs.yaml +++ b/build-tools/automation/azure-pipelines-apidocs.yaml @@ -33,9 +33,10 @@ stages: inputs: forceReinstallCredentialProvider: true - - script: make prepare-update-mono CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 - workingDirectory: $(Build.SourcesDirectory) - displayName: make prepare-update-mono + - 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) From a8b8fce5a4d22eff85bc6295b3fdc583c72c9147 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 2 Nov 2021 20:55:49 -0400 Subject: [PATCH 3/4] Only build against javadoc in separate pipeline, include the same docs in traditional and .NET 6 packs --- Configuration.props | 1 + build-tools/automation/azure-pipelines-apidocs.yaml | 5 +++-- build-tools/automation/azure-pipelines.yaml | 2 -- build-tools/create-packs/Directory.Build.targets | 4 ---- build-tools/create-packs/Microsoft.Android.Ref.proj | 8 ++------ build-tools/installers/create-installers.targets | 6 +++++- src/Mono.Android/Mono.Android.csproj | 6 +----- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Configuration.props b/Configuration.props index f3bb62e937f..837b95b1628 100644 --- a/Configuration.props +++ b/Configuration.props @@ -53,6 +53,7 @@ False <_XABinRelativeInstallPrefix>lib\xamarin.android $(MSBuildThisFileDirectory)bin\$(Configuration)\$(_XABinRelativeInstallPrefix)\ + <_MonoAndroidNETOutputDir>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0\ $(MSBuildThisFileDirectory)\bin\Build$(Configuration)\mingw-deps $(HostCc64) $(HostCxx64) diff --git a/build-tools/automation/azure-pipelines-apidocs.yaml b/build-tools/automation/azure-pipelines-apidocs.yaml index 125514f0b73..a53ae86d59b 100644 --- a/build-tools/automation/azure-pipelines-apidocs.yaml +++ b/build-tools/automation/azure-pipelines-apidocs.yaml @@ -1,4 +1,5 @@ # Pipeline for updating and uploading android-api-docs/docs/Mono.Android/en/* +# https://dev.azure.com/devdiv/DevDiv/_build?definitionId=15262 trigger: none pr: none @@ -13,7 +14,7 @@ stages: dependsOn: [] jobs: - job: mac_build_update_docs - displayName: macOS - Update API Docs + displayName: Update API Docs pool: vmImage: macOS-11 timeoutInMinutes: 120 @@ -50,7 +51,7 @@ stages: msbuildArguments: /restore - task: MSBuild@1 - displayName: update external/android-api-docs + displayName: update android-api-docs inputs: solution: $(Build.SourcesDirectory)/src/Mono.Android/Mono.Android.csproj configuration: $(XA.Build.Configuration) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index e78865bae42..d1f8cf16509 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -44,8 +44,6 @@ variables: value: $[or(eq(variables['XA.RunAllTests'], true), eq(variables['IsMonoBranch'], true))] - name: DotNetNUnitCategories value: '& TestCategory != DotNetIgnore & TestCategory != HybridAOT & TestCategory != ProfiledAOT & TestCategory != MkBundle & TestCategory != MonoSymbolicate & TestCategory != PackagesConfig & TestCategory != StaticProject & TestCategory != Debugger & TestCategory != SystemApplication' -- name: CONVERT_JAVADOC_TO_XMLDOC - value: $[ne(variables['Build.DefinitionName'], 'Xamarin.Android-PR')] - ${{ if and(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), ne(variables['Build.Reason'], 'PullRequest')) }}: - name: MicroBuildSignType value: Real diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index bfd6c53c734..6115b2a309e 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -13,10 +13,6 @@ - - <_MonoAndroidNETOutputDir>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\net6.0\ - - diff --git a/build-tools/create-packs/Microsoft.Android.Ref.proj b/build-tools/create-packs/Microsoft.Android.Ref.proj index 86b2046160f..9f4469cc32a 100644 --- a/build-tools/create-packs/Microsoft.Android.Ref.proj +++ b/build-tools/create-packs/Microsoft.Android.Ref.proj @@ -25,7 +25,7 @@ by projects that use the Microsoft.Android framework in .NET 5. + DependsOnTargets="AssembleApiDocs;_GetLicense"> $(IntermediateOutputPath)FrameworkList.xml @@ -40,11 +40,7 @@ by projects that use the Microsoft.Android framework in .NET 5. <_PackageFiles Include="@(_AndroidRefPackAssemblies)" PackagePath="$(_AndroidRefPackAssemblyPath)" TargetPath="$(_AndroidRefPackAssemblyPath)" /> <_PackageFiles Include="$(_MonoAndroidNETOutputDir)Java.Interop.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" /> - <_PackageFiles - Condition=" '$(CONVERT_JAVADOC_TO_XMLDOC)' == 'true' " - Include="$(_MonoAndroidNETOutputDir)Mono.Android.xml" - PackagePath="$(_AndroidRefPackAssemblyPath)" - /> + <_PackageFiles Include="$(_MonoAndroidNETOutputDir)Mono.Android.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" /> <_PackageFiles Include="$(_MonoAndroidNETOutputDir)mono.android.jar" PackagePath="$(_AndroidRefPackAssemblyPath)" /> <_PackageFiles Include="$(_MonoAndroidNETOutputDir)mono.android.dex" PackagePath="$(_AndroidRefPackAssemblyPath)" /> <_PackageFiles Include="$(_MonoAndroidNETOutputDir)AndroidApiInfo.xml" PackagePath="$(_AndroidRefPackAssemblyPath)" /> diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index cb906dedcd3..6c73ff8284c 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -52,8 +52,12 @@ + Outputs="@(_MsxDocAssembly->'$(_LatestStableFrameworkDir)%(Identity).xml');@(_MsxDocAssembly->'$(_MonoAndroidNETOutputDir)%(Identity).xml')"> + $(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\$(TargetFramework)\ - - True - intellisense+extraremarks - - + intellisense+extraremarks $(OutputPath)Mono.Android.xml $(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658; From 32fc19eccdcd82c0415c8205d64ddda4c983e3d0 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 3 Nov 2021 19:43:55 -0400 Subject: [PATCH 4/4] Apply feedback --- build-tools/automation/azure-pipelines-apidocs.yaml | 4 ++++ build-tools/installers/create-installers.targets | 1 + 2 files changed, 5 insertions(+) diff --git a/build-tools/automation/azure-pipelines-apidocs.yaml b/build-tools/automation/azure-pipelines-apidocs.yaml index a53ae86d59b..f01d4e16b8f 100644 --- a/build-tools/automation/azure-pipelines-apidocs.yaml +++ b/build-tools/automation/azure-pipelines-apidocs.yaml @@ -1,6 +1,10 @@ # Pipeline for updating and uploading android-api-docs/docs/Mono.Android/en/* # https://dev.azure.com/devdiv/DevDiv/_build?definitionId=15262 +# This pipeline can be manually ran against a given branch to generate a new set of Mono.Android docs. +# The `Mono.Android Docs` artifact can be downloaded and copied into a local android-api-docs checkout +# for manual review and pull request creation. + trigger: none pr: none diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index 6c73ff8284c..cec1da24ad5 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -58,6 +58,7 @@ SourceFiles="$(_LatestStableFrameworkDir)%(_MsxDocAssembly.Identity).xml" DestinationFolder="$(_MonoAndroidNETOutputDir)" /> +