From f81c0ec32a5e239dae7904c02ff64660fbc3216d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 24 Jun 2024 16:46:21 -0700 Subject: [PATCH] Remove warning suppression from Java Packaging pipeline. (#21010) ### Description Remove warning suppression from Java Packaging pipeline. ### Motivation and Context We want the CI step not to produce warning. --- java/build.gradle | 3 +++ .../templates/make_java_win_binaries.yml | 14 +++++++++----- .../github/azure-pipelines/templates/win-ci.yml | 6 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/java/build.gradle b/java/build.gradle index cebf67e085446..3219b082994ff 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -166,11 +166,14 @@ if (cmakeBuildDir != null) { } tasks.register('cmakeCheck', Copy) { + group = 'verification' from layout.buildDirectory.get() include 'reports/**' into cmakeBuildOutputDir dependsOn(check) } +} else { + println "cmakeBuildDir is not set. Skipping cmake tasks." } dependencies { diff --git a/tools/ci_build/github/azure-pipelines/templates/make_java_win_binaries.yml b/tools/ci_build/github/azure-pipelines/templates/make_java_win_binaries.yml index 9a666155028cc..0d62ed7907a67 100644 --- a/tools/ci_build/github/azure-pipelines/templates/make_java_win_binaries.yml +++ b/tools/ci_build/github/azure-pipelines/templates/make_java_win_binaries.yml @@ -9,12 +9,16 @@ parameters: steps: - task: CmdLine@2 displayName: 'Gradle cmakeCheck' - continueOnError: ${{ parameters.buildOnly }} inputs: - script: | - @echo on - call gradlew.bat cmakeCheck -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo --warning-mode all - workingDirectory: $(Build.SourcesDirectory)\java + ${{ if eq(parameters.buildOnly, true) }}: + script: | + call gradlew.bat testClasses -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo + call gradlew.bat cmakeCheck -x test -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo --warning-mode all + workingDirectory: $(Build.SourcesDirectory)\java + ${{ else }}: + script: | + call gradlew.bat cmakeCheck -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo --warning-mode all + workingDirectory: $(Build.SourcesDirectory)\java - task: CmdLine@2 displayName: 'Add symbols and notices to Java' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index c726054d8eb10..52547fd9a796b 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -196,11 +196,11 @@ stages: parameters: msbuildPlatform: ${{ parameters.msbuildPlatform }} java_artifact_id: ${{ parameters.java_artifact_id }} - ${{ if contains(parameters.ort_build_pool_name, 'CPU') }}: - buildOnly: false + ${{ if or(contains(parameters.buildparameter, 'use_cuda'), contains(parameters.buildparameter, 'use_tensorrt')) }}: # When it is a GPU build, we only assemble the java binaries, testing will be done in the later stage with GPU machine - ${{ else }}: buildOnly: true + ${{ else }}: + buildOnly: false - task: PublishBuildArtifacts@1 displayName: 'Publish Java temp binaries'