|
8 | 8 | trigger: none
|
9 | 9 | pr: none
|
10 | 10 |
|
| 11 | +resources: |
| 12 | + repositories: |
| 13 | + - repository: 1esPipelines |
| 14 | + type: git |
| 15 | + name: 1ESPipelineTemplates/1ESPipelineTemplates |
| 16 | + ref: refs/tags/release |
| 17 | + |
11 | 18 | parameters:
|
12 | 19 | - name: apiLevel
|
13 | 20 | displayName: AndroidApiLevel property value
|
@@ -50,118 +57,130 @@ variables:
|
50 | 57 | value: ''
|
51 | 58 |
|
52 | 59 |
|
53 |
| -stages: |
54 |
| -- stage: mac_build |
55 |
| - displayName: Build |
56 |
| - dependsOn: [] |
57 |
| - jobs: |
58 |
| - - job: mac_build_update_docs |
59 |
| - displayName: Update API Docs |
60 |
| - pool: |
61 |
| - name: $(SharedMacPool) |
62 |
| - demands: |
63 |
| - - macOS.Name -equals $(SharedMacName) |
64 |
| - - Agent.OSArchitecture -equals $(SharedMacArch) |
65 |
| - timeoutInMinutes: 120 |
66 |
| - workspace: |
67 |
| - clean: all |
68 |
| - steps: |
69 |
| - - checkout: self |
70 |
| - submodules: recursive |
71 |
| - |
72 |
| - - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" |
73 |
| - displayName: set JI_JAVA_HOME |
74 |
| - |
75 |
| - # Set MSBuild property overrides if parameters are set |
76 |
| - - ${{ if ne(parameters.apiLevel, 'default') }}: |
77 |
| - - script: echo "##vso[task.setvariable variable=DocsApiLevelArg]-p:DocsApiLevel=${{ parameters.apiLevel }}" |
78 |
| - displayName: set DocsApiLevelArg |
79 |
| - |
80 |
| - - ${{ if ne(parameters.platformId, 'default') }}: |
81 |
| - - script: echo "##vso[task.setvariable variable=DocsPlatformIdArg]-p:DocsPlatformId=${{ parameters.platformId }}" |
82 |
| - displayName: set DocsPlatformIdArg |
83 |
| - |
84 |
| - - ${{ if ne(parameters.frameworkVersion, 'default') }}: |
85 |
| - - script: echo "##vso[task.setvariable variable=DocsFxVersionArg]-p:DocsFxVersion=${{ parameters.frameworkVersion }}" |
86 |
| - displayName: set DocsFxVersionArg |
87 |
| - |
88 |
| - - ${{ if ne(parameters.mdocVersion, 'default') }}: |
89 |
| - - script: echo "##vso[task.setvariable variable=MdocPackageVersionArg]-p:MdocPackageVersion=${{ parameters.mdocVersion }}" |
90 |
| - displayName: set MdocPackageVersionArg |
91 |
| - |
92 |
| - - ${{ if ne(parameters.javadocVerbosity, 'default') }}: |
93 |
| - - script: echo "##vso[task.setvariable variable=AndroidJavadocVerbosity]-p:AndroidJavadocVerbosity=${{ parameters.javadocVerbosity }}" |
94 |
| - displayName: set AndroidJavadocVerbosity |
95 |
| - |
96 |
| - - template: yaml-templates/use-dot-net.yaml |
97 |
| - |
98 |
| - - task: NuGetAuthenticate@1 |
99 |
| - displayName: authenticate with azure artifacts |
100 |
| - inputs: |
101 |
| - forceReinstallCredentialProvider: true |
102 |
| - |
103 |
| - - template: yaml-templates/run-xaprepare.yaml |
104 |
| - parameters: |
105 |
| - displayName: update mono |
106 |
| - arguments: --s=UpdateMono |
107 |
| - |
108 |
| - - script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 |
109 |
| - workingDirectory: $(Build.SourcesDirectory) |
110 |
| - displayName: make prepare |
111 |
| - |
112 |
| - - script: >- |
113 |
| - make update-api-docs CONFIGURATION=$(XA.Build.Configuration) |
114 |
| - MSBUILD_ARGS='$(DocsApiLevelArg) $(DocsPlatformIdArg) $(DocsFxVersionArg) $(MdocPackageVersionArg) $(AndroidJavadocVerbosity)' |
115 |
| - workingDirectory: $(Build.SourcesDirectory) |
116 |
| - displayName: make update-api-docs |
117 |
| -
|
118 |
| - - script: > |
119 |
| - mkdir -p $(Build.StagingDirectory)/docs-binaries && |
120 |
| - ln $(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/34/*.dll $(Build.StagingDirectory)/docs-binaries/ && |
121 |
| - ln $(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/34/*.xml $(Build.StagingDirectory)/docs-binaries/ |
122 |
| - displayName: copy docs files |
123 |
| -
|
124 |
| - - task: PublishPipelineArtifact@1 |
125 |
| - displayName: upload docs files |
126 |
| - inputs: |
127 |
| - artifactName: Binaries |
128 |
| - targetPath: $(Build.StagingDirectory)/docs-binaries |
129 |
| - |
130 |
| - - script: > |
131 |
| - mkdir -p $(Build.StagingDirectory)/api-doc-diff && |
132 |
| - ln $(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/UpdateApiDocs*.diff $(Build.StagingDirectory)/api-doc-diff/ |
133 |
| - displayName: copy api docs diff |
134 |
| -
|
135 |
| - - task: PublishPipelineArtifact@1 |
136 |
| - displayName: upload api docs diff |
137 |
| - inputs: |
138 |
| - artifactName: Api Docs Diff |
139 |
| - targetPath: $(Build.StagingDirectory)/api-doc-diff |
140 |
| - |
141 |
| - - template: yaml-templates/upload-results.yaml |
142 |
| - parameters: |
143 |
| - artifactName: Build Results - API Docs Update |
144 |
| - includeBuildResults: true |
145 |
| - condition: always() |
146 |
| - |
147 |
| - - powershell: | |
148 |
| - $docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1 |
149 |
| - $buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-build.log" |
150 |
| - & "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog |
151 |
| -
|
152 |
| - $issueContent = & { |
153 |
| - Get-Content -Path $buildLog | Select-String "## Exception translating remarks" |
154 |
| - Get-Content -Path $buildLog | Select-String "## Unable to translate remarks" |
155 |
| - Get-Content -Path $buildLog | Select-String "JavadocImport-" |
156 |
| - } |
157 |
| -
|
158 |
| - if ($issueContent) { |
159 |
| - Write-Host "The following issues were found, review the build log for more details:" |
160 |
| - Write-Host "" |
161 |
| - foreach ($line in $issueContent) { |
162 |
| - Write-Host $line |
| 60 | +extends: |
| 61 | + ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: |
| 62 | + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines |
| 63 | + ${{ else }}: |
| 64 | + template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines |
| 65 | + parameters: |
| 66 | + sdl: |
| 67 | + sourceAnalysisPool: |
| 68 | + name: AzurePipelines-EO |
| 69 | + image: $(WindowsPoolImage1ESPT) |
| 70 | + os: windows |
| 71 | + suppression: |
| 72 | + suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress |
| 73 | + stages: |
| 74 | + - stage: mac_build |
| 75 | + displayName: Build |
| 76 | + dependsOn: [] |
| 77 | + jobs: |
| 78 | + - job: mac_build_update_docs |
| 79 | + displayName: Update API Docs |
| 80 | + pool: |
| 81 | + name: $(SharedMacPool) |
| 82 | + demands: |
| 83 | + - macOS.Name -equals $(SharedMacName) |
| 84 | + - Agent.OSArchitecture -equals $(SharedMacArch) |
| 85 | + os: macOS |
| 86 | + timeoutInMinutes: 120 |
| 87 | + workspace: |
| 88 | + clean: all |
| 89 | + templateContext: |
| 90 | + outputs: |
| 91 | + - output: pipelineArtifact |
| 92 | + displayName: upload docs binaries |
| 93 | + artifactName: Binaries |
| 94 | + targetPath: $(Build.SourcesDirectory)/src/Mono.Android/obj/docs-gen-temp |
| 95 | + - output: pipelineArtifact |
| 96 | + displayName: upload docs diff |
| 97 | + artifactName: Api Docs Diff |
| 98 | + targetPath: $(Build.StagingDirectory)/api-doc-diff |
| 99 | + steps: |
| 100 | + - checkout: self |
| 101 | + submodules: recursive |
| 102 | + |
| 103 | + - script: | |
| 104 | + echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/android-toolchain/jdk-17" |
| 105 | + echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17" |
| 106 | + displayName: set JI_JAVA_HOME |
| 107 | +
|
| 108 | + # Set MSBuild property overrides if parameters are set |
| 109 | + - ${{ if ne(parameters.apiLevel, 'default') }}: |
| 110 | + - script: echo "##vso[task.setvariable variable=DocsApiLevelArg]-p:DocsApiLevel=${{ parameters.apiLevel }}" |
| 111 | + displayName: set DocsApiLevelArg |
| 112 | + |
| 113 | + - ${{ if ne(parameters.platformId, 'default') }}: |
| 114 | + - script: echo "##vso[task.setvariable variable=DocsPlatformIdArg]-p:DocsPlatformId=${{ parameters.platformId }}" |
| 115 | + displayName: set DocsPlatformIdArg |
| 116 | + |
| 117 | + - ${{ if ne(parameters.frameworkVersion, 'default') }}: |
| 118 | + - script: echo "##vso[task.setvariable variable=DocsFxVersionArg]-p:DocsFxVersion=${{ parameters.frameworkVersion }}" |
| 119 | + displayName: set DocsFxVersionArg |
| 120 | + |
| 121 | + - ${{ if ne(parameters.mdocVersion, 'default') }}: |
| 122 | + - script: echo "##vso[task.setvariable variable=MdocPackageVersionArg]-p:MdocPackageVersion=${{ parameters.mdocVersion }}" |
| 123 | + displayName: set MdocPackageVersionArg |
| 124 | + |
| 125 | + - ${{ if ne(parameters.javadocVerbosity, 'default') }}: |
| 126 | + - script: echo "##vso[task.setvariable variable=AndroidJavadocVerbosity]-p:AndroidJavadocVerbosity=${{ parameters.javadocVerbosity }}" |
| 127 | + displayName: set AndroidJavadocVerbosity |
| 128 | + |
| 129 | + - template: /build-tools/automation/yaml-templates/use-dot-net.yaml@self |
| 130 | + |
| 131 | + - task: NuGetAuthenticate@1 |
| 132 | + displayName: authenticate with azure artifacts |
| 133 | + inputs: |
| 134 | + forceReinstallCredentialProvider: true |
| 135 | + |
| 136 | + - script: dotnet tool update -v:n boots --version 1.1.0.36 --add-source "https://api.nuget.org/v3/index.json" --global |
| 137 | + displayName: Install boots |
| 138 | + |
| 139 | + - script: boots https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.188.macos10.xamarin.universal.pkg |
| 140 | + displayName: Install Mono |
| 141 | + |
| 142 | + - script: make prepare CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 |
| 143 | + workingDirectory: $(Build.SourcesDirectory) |
| 144 | + displayName: make prepare |
| 145 | + |
| 146 | + - script: >- |
| 147 | + make update-api-docs CONFIGURATION=$(XA.Build.Configuration) |
| 148 | + MSBUILD_ARGS='$(DocsApiLevelArg) $(DocsPlatformIdArg) $(DocsFxVersionArg) $(MdocPackageVersionArg) $(AndroidJavadocVerbosity)' |
| 149 | + workingDirectory: $(Build.SourcesDirectory) |
| 150 | + displayName: make update-api-docs |
| 151 | +
|
| 152 | + - script: > |
| 153 | + mkdir -p $(Build.StagingDirectory)/api-doc-diff && |
| 154 | + ln $(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/UpdateApiDocs*.diff $(Build.StagingDirectory)/api-doc-diff/ && |
| 155 | + ln $(Build.SourcesDirectory)/external/android-api-docs/docs/xml/index.xml $(Build.StagingDirectory)/api-doc-diff/ |
| 156 | + displayName: copy api docs diff |
| 157 | +
|
| 158 | + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self |
| 159 | + parameters: |
| 160 | + artifactName: Build Results - API Docs Update |
| 161 | + includeBuildResults: true |
| 162 | + condition: always() |
| 163 | + |
| 164 | + - powershell: | |
| 165 | + $docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1 |
| 166 | + $buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-UpdateApiDocs-build.log" |
| 167 | + & "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog |
| 168 | +
|
| 169 | + $issueContent = & { |
| 170 | + Get-Content -Path $buildLog | Select-String "## Exception translating remarks" -Context 0, 3 |
| 171 | + Get-Content -Path $buildLog | Select-String "## Unable to translate remarks" -Context 0, 3 |
| 172 | + Get-Content -Path $buildLog | Select-String "JavadocImport-" -Context 0, 3 |
| 173 | + } |
| 174 | +
|
| 175 | + if ($issueContent) { |
| 176 | + Write-Host "The following issues were found, review the build log for more details:" |
163 | 177 | Write-Host ""
|
| 178 | + foreach ($line in $issueContent) { |
| 179 | + Write-Host $line |
| 180 | + Write-Host "" |
| 181 | + } |
| 182 | + exit 1 |
164 | 183 | }
|
165 |
| - exit 1 |
166 |
| - } |
167 |
| - displayName: Report issues in docs generation |
| 184 | + Write-Host "No issues found." |
| 185 | + displayName: Report issues in docs generation |
| 186 | + continueOnError: true |
0 commit comments