Skip to content

Commit 9eec01c

Browse files
committed
fix: align build files and javadoc file strcuture
1 parent 5d2db8e commit 9eec01c

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

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

+3
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\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

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
run: |
2323
pip install detect-secrets
2424
git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline
25+
- name: Move generated sources to correct package
26+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated'
27+
shell: pwsh
2528
- name: Grant Execute permission for gradlew
2629
run: chmod +x gradlew
2730
- name: Build with Gradle
@@ -60,6 +63,9 @@ jobs:
6063
java-version: 8
6164
distribution: 'temurin'
6265
cache: gradle
66+
- name: Move generated sources to correct package
67+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated'
68+
shell: pwsh
6369
- name: Grant Execute permission for gradlew
6470
run: chmod +x gradlew
6571
- name: Build with Java 8

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

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
java-version: ${{ env.JAVA_VERSION }}
3838
distribution: ${{ env.JAVA_DISTRIBUTION}}
3939
cache: gradle
40+
- name: Move generated sources to correct package
41+
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated'
42+
shell: pwsh
4043
- name: Detect secrets
4144
run: |
4245
pip install detect-secrets
@@ -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\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\generated'
140+
shell: pwsh
132141
- name: Download file
133142
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
134143
shell: pwsh

scripts/copyFilesOnBuild.ps1

+30
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)