mirror of
https://github.com/QuasarApp/CMake.git
synced 2025-04-29 03:04:43 +00:00
added new deploy apk method (without sign)
This commit is contained in:
parent
96c34a3e8d
commit
a408d25862
@ -52,7 +52,7 @@
|
|||||||
# - sourceDir - Path to folder with qif template.
|
# - sourceDir - Path to folder with qif template.
|
||||||
# - config - Path to config file of qif template.
|
# - config - Path to config file of qif template.
|
||||||
#
|
#
|
||||||
# addDeployAPK(name input aliase keystore keystorePass targetDir) // Add subtargets of deploy setep for create signed android apk file.
|
# addSignedDeployAPK(name input aliase keystore keystorePass targetDir) // Add subtargets of deploy setep for create signed android apk file.
|
||||||
# - name - This is prefix of added subtarget (any word).
|
# - name - This is prefix of added subtarget (any word).
|
||||||
# - android_src - Path to folder with the android_manifest file.
|
# - android_src - Path to folder with the android_manifest file.
|
||||||
# - aliase - Aliase for key store.
|
# - aliase - Aliase for key store.
|
||||||
@ -61,6 +61,12 @@
|
|||||||
# - targetDir - Target dir for output apk file.
|
# - targetDir - Target dir for output apk file.
|
||||||
# - extraLibs - list f the extra libraryes (like the openssl)
|
# - extraLibs - list f the extra libraryes (like the openssl)
|
||||||
#
|
#
|
||||||
|
# addDeployAPK(name input aliase keystore keystorePass targetDir) // Add subtargets of deploy setep for create android apk file.
|
||||||
|
# - name - This is prefix of added subtarget (any word).
|
||||||
|
# - android_src - Path to folder with the android_manifest file.
|
||||||
|
# - targetDir - Target dir for output apk file.
|
||||||
|
# - extraLibs - list f the extra libraryes (like the openssl)
|
||||||
|
#
|
||||||
# initDeploy() // Create a main deploy target for all addDeploy subtargets. This method need to call before invoiced of all addDeploy methods.
|
# initDeploy() // Create a main deploy target for all addDeploy subtargets. This method need to call before invoiced of all addDeploy methods.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -382,7 +388,7 @@ function(addDeployQIF name sourceDir targetDir config)
|
|||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(addDeployAPK name android_src aliase keystore keystorePass targetDir extraLibs)
|
function(addDeployAPK name android_src targetDir extraLibs)
|
||||||
|
|
||||||
if(TARGET deployAPK${name})
|
if(TARGET deployAPK${name})
|
||||||
message("the deployAPK${name} target already created!")
|
message("the deployAPK${name} target already created!")
|
||||||
@ -405,8 +411,57 @@ function(addDeployAPK name android_src aliase keystore keystorePass targetDir ex
|
|||||||
|
|
||||||
add_qt_android_apk(createAPK${name} ${name}
|
add_qt_android_apk(createAPK${name} ${name}
|
||||||
PACKAGE_SOURCES ${android_src}
|
PACKAGE_SOURCES ${android_src}
|
||||||
KEYSTORE ${keystore} ${aliase}
|
DEPENDS ${extraLibs}
|
||||||
KEYSTORE_PASSWORD ${keystorePass}
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(
|
||||||
|
deployAPK${name}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy *.apk ${targetDir}
|
||||||
|
COMMENT "copt apk: ${CMAKE_COMMAND} -E copy *.apk ${targetDir}"
|
||||||
|
WORKING_DIRECTORY ${QT_ANDROID_APP_BINARY_DIR}/build/outputs/apk/release
|
||||||
|
DEPENDS createAPK${name}
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(
|
||||||
|
deployAAB${name}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy *.aab ${targetDir}
|
||||||
|
COMMENT "copt aab: ${CMAKE_COMMAND} -E copy *.aab ${targetDir}"
|
||||||
|
WORKING_DIRECTORY ${QT_ANDROID_APP_BINARY_DIR}/build/outputs/bundle/release
|
||||||
|
DEPENDS deployAPK${name}
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(deploy deployAPK${name})
|
||||||
|
add_dependencies(deploy deployAAB${name})
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addSignedDeployAPK name android_src aliase keystore keystorePass targetDir extraLibs)
|
||||||
|
|
||||||
|
if(TARGET deployAPK${name})
|
||||||
|
message("the deployAPK${name} target already created!")
|
||||||
|
return()
|
||||||
|
|
||||||
|
endif(TARGET deployAPK${name})
|
||||||
|
|
||||||
|
IF(NOT DEFINED ENV{ANDROID_SDK_ROOT})
|
||||||
|
message("the ANDROID_SDK_ROOT is not defined. define ANDROID_SDK_ROOT variable and run cmake again!")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
IF(DEFINED ENV{ANDROID_API_VERSION})
|
||||||
|
set(ANDROID_PLATFORM_LEVEL $ENV{ANDROID_API_VERSION})
|
||||||
|
else()
|
||||||
|
set(ANDROID_PLATFORM_LEVEL 30)
|
||||||
|
endif()
|
||||||
|
message("The ANDROID_PLATFORM_LEVEL = ${ANDROID_PLATFORM_LEVEL}")
|
||||||
|
|
||||||
|
|
||||||
|
add_qt_android_apk(createAPK${name} ${name}
|
||||||
|
PACKAGE_SOURCES ${android_src}
|
||||||
|
# KEYSTORE ${keystore} ${aliase}
|
||||||
|
# KEYSTORE_PASSWORD ${keystorePass}
|
||||||
DEPENDS ${extraLibs}
|
DEPENDS ${extraLibs}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user