Android: remove unused qt_get_android_sdk_jar_for_api() function

This function is no longer needed after removing the one unnecessary
use for it in qtspeech.

Change-Id: Ia0d061e898aedff0ba6941b678e0ec45a1abe55d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Assam Boudjelthia 2024-12-05 15:39:42 +02:00
parent d08b55867b
commit faec1a022d
2 changed files with 1 additions and 21 deletions

View File

@ -23,18 +23,6 @@ if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}")
message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}") message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}")
endif() endif()
# Get the Android SDK jar for an API version other than the one specified with
# QT_ANDROID_API_USED_FOR_JAVA.
function(qt_get_android_sdk_jar_for_api api out_jar_location)
set(jar_location "${ANDROID_SDK_ROOT}/platforms/${api}/android.jar")
if (NOT EXISTS "${jar_location}")
message(WARNING "Could not locate Android SDK jar for api '${api}', defaulting to ${QT_ANDROID_API_USED_FOR_JAVA}")
set(${out_jar_location} ${QT_ANDROID_JAR} PARENT_SCOPE)
else()
set(${out_jar_location} ${jar_location} PARENT_SCOPE)
endif()
endfunction()
# This variable specifies the API level used for building Java code, it can be the same as Qt for # This variable specifies the API level used for building Java code, it can be the same as Qt for
# Android's maximum supported Android version or higher. # Android's maximum supported Android version or higher.
set(QT_ANDROID_API_USED_FOR_JAVA "android-34") set(QT_ANDROID_API_USED_FOR_JAVA "android-34")

View File

@ -3798,20 +3798,12 @@ def write_jar(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
raise RuntimeError("Could not locate jar install path") raise RuntimeError("Could not locate jar install path")
install_dir = install_dir.replace("$$[QT_INSTALL_PREFIX]/", "") install_dir = install_dir.replace("$$[QT_INSTALL_PREFIX]/", "")
android_sdk_jar = "${QT_ANDROID_JAR}"
android_api_level = scope.get_string("API_VERSION")
if android_api_level:
cm_fh.write(
f'{spaces(indent)}qt_get_android_sdk_jar_for_api("{android_api_level}" android_sdk)\n\n'
)
android_sdk_jar = "${android_sdk}"
write_source_file_list( write_source_file_list(
cm_fh, scope, "", ["JAVASOURCES"], indent=indent, header="set(java_sources\n", footer=")\n" cm_fh, scope, "", ["JAVASOURCES"], indent=indent, header="set(java_sources\n", footer=")\n"
) )
cm_fh.write(f"{spaces(indent)}qt_internal_add_jar({target}\n") cm_fh.write(f"{spaces(indent)}qt_internal_add_jar({target}\n")
cm_fh.write(f"{spaces(indent+1)}INCLUDE_JARS {android_sdk_jar}\n") cm_fh.write(f"{spaces(indent+1)}INCLUDE_JARS ${{QT_ANDROID_JAR}}\n")
cm_fh.write(f"{spaces(indent+1)}SOURCES ${{java_sources}}\n") cm_fh.write(f"{spaces(indent+1)}SOURCES ${{java_sources}}\n")
cm_fh.write(f'{spaces(indent+1)}OUTPUT_DIR "${{QT_BUILD_DIR}}/{install_dir}"\n') cm_fh.write(f'{spaces(indent+1)}OUTPUT_DIR "${{QT_BUILD_DIR}}/{install_dir}"\n')
cm_fh.write(f"{spaces(indent)})\n\n") cm_fh.write(f"{spaces(indent)})\n\n")