-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yi Zhang
committed
Mar 28, 2024
1 parent
5a1f885
commit ddbeac1
Showing
2 changed files
with
55 additions
and
82 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
tools/ci_build/github/azure-pipelines/templates/make_java_win_binaries.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
parameters: | ||
- name: msbuildPlatform | ||
type: string | ||
- name: java_artifact_id | ||
type: string | ||
|
||
steps: | ||
- task: CmdLine@2 | ||
displayName: 'Add symbols and notices to Java' | ||
inputs: | ||
script: | | ||
@echo on | ||
cd $(Build.SourcesDirectory)\java | ||
call $(Build.SourcesDirectory)\java\gradlew.bat cmakeCheck -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
cd $(Build.BinariesDirectory)\RelWithDebInfo | ||
set NATIVE_FOLDER=$(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\ai\onnxruntime\native\win-x64 | ||
mkdir %NATIVE_FOLDER% | ||
echo "Directories created" | ||
copy .\java\build\libs\*.jar $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }} | ||
pushd $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }} | ||
set artifact_id=${{ parameters.java_artifact_id }} | ||
jar xf onnxruntime-$(OnnxRuntimeVersion).jar META-INF\maven\com.microsoft.onnxruntime\%artifact_id%\pom.xml | ||
move META-INF\maven\com.microsoft.onnxruntime\%artifact_id%\pom.xml onnxruntime-$(OnnxRuntimeVersion).pom | ||
rd /s /q META-INF | ||
popd | ||
copy .\RelWithDebInfo\onnxruntime.pdb %NATIVE_FOLDER% | ||
copy .\RelWithDebInfo\onnxruntime4j_jni.pdb %NATIVE_FOLDER% | ||
copy $(Build.SourcesDirectory)\docs\Privacy.md $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\Privacy.md | ||
copy $(Build.SourcesDirectory)\ThirdPartyNotices.txt $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\ThirdPartyNotices.txt | ||
@echo $(OnnxRuntimeGitCommitHash) > $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\GIT_COMMIT_ID | ||
pushd $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage | ||
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar ai\onnxruntime\native\win-x64\onnxruntime.pdb | ||
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar ai\onnxruntime\native\win-x64\onnxruntime4j_jni.pdb | ||
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar Privacy.md ThirdPartyNotices.txt GIT_COMMIT_ID | ||
popd | ||
pushd $(Build.SourcesDirectory)\java\build\classes\java\test | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
jar cvf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\testing.jar . | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
popd | ||
pushd $(Build.SourcesDirectory)\java\build\resources\test | ||
rd /s /q ai\onnxruntime\native | ||
jar uvf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\testing.jar . | ||
popd | ||
rd /s /q $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage | ||
dir /s /b $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters