Skip to content

Commit 2d4c8fd

Browse files
authored
Merge pull request #1138 from microsoftgraph/andrueastman/fixjavaDocs
fix: resolve javadoc and source locations
2 parents 3ba5825 + 1a633b6 commit 2d4c8fd

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

.github/workflows/api-level-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
distribution: 'temurin'
1818
java-version: 21
1919
cache: gradle
20+
- name: Move generated sources to correct package
21+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
22+
shell: pwsh
2023
- name: Setup Android SDK
2124
uses: android-actions/setup-android@v3.2.2
2225
- name: Add execution right to the script

.github/workflows/gradle-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
run: |
2626
pip install detect-secrets
2727
git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline
28+
- name: Move generated sources to correct package
29+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
30+
shell: pwsh
2831
- name: Grant Execute permission for gradlew
2932
run: chmod +x gradlew
3033
- name: Build with Gradle
@@ -65,6 +68,9 @@ jobs:
6568
cache: gradle
6669
- name: Grant Execute permission for gradlew
6770
run: chmod +x gradlew
71+
- name: Move generated sources to correct package
72+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
73+
shell: pwsh
6874
- name: Build with Java 8
6975
working-directory: ./java-8
7076
run: .././gradlew -Dorg.gradle.jvmargs=-Xmx4g build

.github/workflows/preview-and-release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
java-version: ${{ env.JAVA_VERSION }}
4242
distribution: ${{ env.JAVA_DISTRIBUTION }}
4343
cache: gradle
44+
- name: Move generated sources to correct package
45+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
46+
shell: pwsh
4447
- name: Download File
4548
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
4649
shell: pwsh
@@ -76,6 +79,9 @@ jobs:
7679
run: |
7780
pip install detect-secrets
7881
git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline
82+
- name: Move generated sources to correct package
83+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
84+
shell: pwsh
7985
- name: Download File
8086
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
8187
shell: pwsh
@@ -129,6 +135,9 @@ jobs:
129135
java-version: ${{ env.JAVA_VERSION }}
130136
distribution: ${{ env.JAVA_DISTRIBUTION}}
131137
cache: gradle
138+
- name: Move generated sources to correct package
139+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
140+
shell: pwsh
132141
- name: Download file
133142
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
134143
shell: pwsh

build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ def pomConfig = {
4848
}
4949
}
5050

51-
tasks.withType(Javadoc).all { enabled = false }
51+
tasks.withType(Javadoc).configureEach {
52+
enabled = true
53+
options.addStringOption('Xdoclint:-missing', '-quiet')
54+
}
55+
56+
tasks.withType(Zip).configureEach {
57+
zip64 = true
58+
}
5259

5360
tasks.jar {
5461
manifest {

scripts/copyFilesOnBuild.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.Synopsis
6+
Copy files to a new location that is the parent of the current directory.
7+
.Description
8+
Receives an encoded string value and decodes it using base64.
9+
Write the new decoded string to a local file for later consumption.
10+
.Parameter inputPath
11+
The encoded string we wish to decode.
12+
#>
13+
14+
Param(
15+
[Parameter(Mandatory = $true)][string]$inputPath
16+
)
17+
18+
$fullPath = (Get-Item $inputPath).FullName
19+
$parentDirectory = (Get-Item $inputPath).Parent
20+
Push-Location $inputPath
21+
22+
Get-ChildItem '*' -Filter *.java -recurse | ForEach-Object {
23+
$TargetDirectory = $_.DirectoryName.Replace($fullPath, "")
24+
$TargetPath = Join-Path -Path $parentDirectory -ChildPath $TargetDirectory
25+
If (!(Test-Path $TargetPath)) {
26+
New-Item -Path $TargetPath -Type Directory -Force | out-null
27+
}
28+
$_ | Move-Item -Destination $TargetPath -Force
29+
}
30+
Pop-Location

0 commit comments

Comments
 (0)