Skip to content

Unify build.gradle generation for Android projects #24686

@asmorkalov

Description

@asmorkalov

System Information

Platform: Android (any version)

Detailed description

Related PR: #24685

modules/java/build.gradle.in and modules/java/android_sdk/android_gradle_lib/build.gradle are used for the same purpose in build folder and install folder and have very similar content. Need to unify the templates and use one of them for all purposes.

~/Projects/opencv/modules/java$ grep -Rin "build.gradle"
android_sdk/CMakeLists.txt:111:configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.gradle.in" "${CMAKE_CURRENT_BINARY_DIR}/build.gradle" @ONLY)
android_sdk/CMakeLists.txt:112:install(FILES "${CMAKE_CURRENT_BINARY_DIR}/build.gradle" DESTINATION ${JAVA_INSTALL_ROOT}/.. COMPONENT java)
android_sdk/CMakeLists.txt:133:  if(NOT file STREQUAL "build.gradle")
android_sdk/CMakeLists.txt:169:configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.gradle.in" "${ANDROID_TMP_INSTALL_BASE_DIR}/opencv/build.gradle" @ONLY)
android_sdk/CMakeLists.txt:170:install(FILES "${ANDROID_TMP_INSTALL_BASE_DIR}/opencv/build.gradle" DESTINATION ${JAVA_INSTALL_ROOT}/.. COMPONENT java)
android_sdk/build.gradle.in:37:// - or add "project(':opencv')" dependency into app/build.gradle:
android_sdk/build.gradle.in:65:// - Add "OpenCV_DIR" and enable C++ exceptions/RTTI support via app/build.gradle
android_sdk/build.gradle.in:78:// - (optional) Limit/filter ABIs to build ('android' scope of 'app/build.gradle'):
android_sdk/build.gradle.in:79://   Useful information: https://developer.android.com/studio/build/gradle-tips.html (Configure separate APKs per ABI)

Steps to reproduce

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions