[Fix] Only copy java files when build_java is True (#20121)

### Description


### Motivation and Context
Fix error in Nuget-CUDA-Packaging-Pipeline
This commit is contained in:
Yi Zhang 2024-03-29 05:06:28 +08:00 committed by GitHub
parent 3ed0c81b30
commit f7b52d2e3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -214,7 +214,6 @@ stages:
Get-ChildItem -Path "$(Agent.TempDirectory)/RelWithDebInfo" -Include *.pdb -File -Recurse | ForEach-Object { $_.Delete() }
Get-ChildItem -Path "$(Agent.TempDirectory)/RelWithDebInfo" -Include *.lib -File -Recurse | ForEach-Object { $_.Delete() }
Copy-Item -Path $(Build.BinariesDirectory)/RelWithDebInfo/RelWithDebInfo/onnxruntime.pdb -Destination $(Agent.TempDirectory)/RelWithDebInfo/RelWithDebInfo -Force
Copy-Item -Path $(Build.BinariesDirectory)/RelWithDebInfo/RelWithDebInfo/onnxruntime4j_jni.pdb -Destination $(Agent.TempDirectory)/RelWithDebInfo/RelWithDebInfo -Force
cd $(Agent.TempDirectory)/RelWithDebInfo
tree /f
displayName: 'Copy native test needs files'
@ -222,10 +221,11 @@ stages:
- ${{ if eq(parameters['buildJava'], 'true') }}:
- powershell: |
Copy-Item -Path $(Build.BinariesDirectory)/RelWithDebInfo/RelWithDebInfo/onnxruntime4j_jni.pdb -Destination $(Agent.TempDirectory)/RelWithDebInfo/RelWithDebInfo -Force
Copy-Item -Path "$(Build.BinariesDirectory)/RelWithDebInfo/java" -Destination $(Agent.TempDirectory)/RelWithDebInfo/ -Recurse -Force
cd $(Agent.TempDirectory)/RelWithDebInfo
tree /f
displayName: 'Copy java folder for java test'
displayName: 'Copy java pad and folder for java test'
workingDirectory: '$(Build.BinariesDirectory)'
- task: PublishPipelineArtifact@1