Skip to content

Commit

Permalink
clean the gradle command
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalarkadam committed Oct 2, 2024
1 parent e4bd4e8 commit df95a25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion java/build-android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ publishing {

if (addQnnDependency) {
println "Modifying the POM XML to include QNN dependency"
def qnnVersion = project.hasProperty('qnnVersion')
def qnnVersion = System.properties['qnnVersion']

qnnVersion = "$qnnVersion.+"
withXml {
Expand Down
7 changes: 7 additions & 0 deletions tools/ci_build/github/android/build_aar_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def _build_aar(args):

if qnn_android_build:
qnn_home = os.getenv("QNN_HOME")
qnn_sdk_version = os.getenv("QNN_SDK_VERSION")
if not qnn_sdk_version:
raise EnvironmentError("QNN_SDK_VERSION environment variable is not set.")

Check warning

Code scanning / lintrunner

RUFF/UP024 Warning

Replace aliased errors with OSError.
See https://docs.astral.sh/ruff/rules/os-error-alias
abi_build_command += ["--qnn_home=" + qnn_home]
if ops_config_path is not None:
abi_build_command += ["--include_ops_by_config=" + ops_config_path]
Expand Down Expand Up @@ -163,6 +166,10 @@ def _build_aar(args):
("-DaddQnnDependency=1" if qnn_android_build else "-DaddQnnDependency=0"),
]

# Add qnn specific parameters
if qnn_android_build:
gradle_command.append(f"-DqnnVersion={qnn_sdk_version}")

# clean, build, and publish to a local directory
subprocess.run([*gradle_command, "clean"], env=temp_env, shell=False, check=True, cwd=JAVA_ROOT)
subprocess.run([*gradle_command, "build"], env=temp_env, shell=False, check=True, cwd=JAVA_ROOT)
Expand Down

0 comments on commit df95a25

Please sign in to comment.