Skip to content

Commit

Permalink
Merge pull request opencv#19501 from komakai:android-ndk22
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Feb 14, 2021
2 parents 6f6dd22 + 2cb48e0 commit ad66b07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cmake/android/android_gradle_projects.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# https://developer.android.com/studio/releases/gradle-plugin
set(ANDROID_GRADLE_PLUGIN_VERSION "3.2.1" CACHE STRING "Android Gradle Plugin version (3.0+)")
set(ANDROID_GRADLE_PLUGIN_VERSION "3.2.1" CACHE STRING "Android Gradle Plugin version")
message(STATUS "Android Gradle Plugin version: ${ANDROID_GRADLE_PLUGIN_VERSION}")

set(GRADLE_VERSION "5.6.4" CACHE STRING "Gradle version")
message(STATUS "Gradle version: ${GRADLE_VERSION}")

set(ANDROID_COMPILE_SDK_VERSION "26" CACHE STRING "Android compileSdkVersion")
set(ANDROID_MIN_SDK_VERSION "21" CACHE STRING "Android minSdkVersion")
set(ANDROID_TARGET_SDK_VERSION "26" CACHE STRING "Android minSdkVersion")
Expand Down Expand Up @@ -38,9 +41,11 @@ set(ANDROID_ABI_FILTER "${ANDROID_INSTALL_ABI_FILTER}")
configure_file("${OpenCV_SOURCE_DIR}/samples/android/build.gradle.in" "${ANDROID_TMP_INSTALL_BASE_DIR}/${ANDROID_INSTALL_SAMPLES_DIR}/build.gradle" @ONLY)
install(FILES "${ANDROID_TMP_INSTALL_BASE_DIR}/${ANDROID_INSTALL_SAMPLES_DIR}/build.gradle" DESTINATION "${ANDROID_INSTALL_SAMPLES_DIR}" COMPONENT samples)

configure_file("${OpenCV_SOURCE_DIR}/platforms/android/gradle-wrapper/gradle/wrapper/gradle-wrapper.properties.in" "${ANDROID_BUILD_BASE_DIR}/gradle/wrapper/gradle-wrapper.properties" @ONLY)
install(FILES "${ANDROID_BUILD_BASE_DIR}/gradle/wrapper/gradle-wrapper.properties" DESTINATION "${ANDROID_INSTALL_SAMPLES_DIR}/gradle/wrapper" COMPONENT samples)

set(GRADLE_WRAPPER_FILES
"gradle/wrapper/gradle-wrapper.jar"
"gradle/wrapper/gradle-wrapper.properties"
"gradlew.bat"
"gradlew"
"gradle.properties"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-@GRADLE_VERSION@-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions platforms/android/ndk-22.config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ABIs = [
ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON', ANDROID_GRADLE_PLUGIN_VERSION='4.1.2', GRADLE_VERSION='6.5')),
ABI("3", "arm64-v8a", None, cmake_vars=dict(ANDROID_GRADLE_PLUGIN_VERSION='4.1.2', GRADLE_VERSION='6.5')),
ABI("5", "x86_64", None, cmake_vars=dict(ANDROID_GRADLE_PLUGIN_VERSION='4.1.2', GRADLE_VERSION='6.5')),
ABI("4", "x86", None, cmake_vars=dict(ANDROID_GRADLE_PLUGIN_VERSION='4.1.2', GRADLE_VERSION='6.5')),
]

0 comments on commit ad66b07

Please sign in to comment.