Merge pull request #24843 from asmorkalov:as/android_drop_aidl

Removed Android AIDL from build scrips and tutorials as it's not need since 4.9.0
pull/24854/head
Alexander Smorkalov 11 months ago committed by GitHub
commit ebc637d07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmake/android/android_gradle_projects.cmake
  2. 3
      doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.markdown
  3. 4
      modules/java/CMakeLists.txt
  4. 1
      modules/java/android_sdk/android_gradle_lib/build.gradle
  5. 4
      modules/java/android_sdk/build.gradle.in
  6. 4
      modules/java/generator/gen_java.py
  7. 2
      platforms/android/aar-template/OpenCV/build.gradle.template
  8. 1
      samples/android/15-puzzle/build.gradle.in
  9. 1
      samples/android/camera-calibration/build.gradle.in
  10. 1
      samples/android/color-blob-detection/build.gradle.in
  11. 1
      samples/android/face-detection/build.gradle.in
  12. 1
      samples/android/image-manipulations/build.gradle.in
  13. 1
      samples/android/mobilenet-objdetect/build.gradle.in
  14. 1
      samples/android/qr-detection/build.gradle.in
  15. 1
      samples/android/tutorial-1-camerapreview/build.gradle.in
  16. 1
      samples/android/tutorial-2-mixedprocessing/build.gradle.in
  17. 1
      samples/android/tutorial-3-cameracontrol/build.gradle.in
  18. 1
      samples/android/tutorial-4-opencl/build.gradle.in
  19. 1
      samples/android/video-recorder/build.gradle.in

@ -89,15 +89,11 @@ else()
ocv_update(OPENCV_ANDROID_NAMESPACE_DECLARATION "")
endif()
# set android gradle java version in build.gradle and set aidl config
if(NOT (ANDROID_GRADLE_PLUGIN_VERSION VERSION_LESS "8.0.0"))
# AGP-8.0 requires a minimum JDK version of JDK17
ocv_update(ANDROID_GRADLE_JAVA_VERSION_INIT "17")
# Enable aidl configuration for OpenCV compile with AGP-8.0
ocv_update(ANDROID_GRADLE_BUILD_FEATURE_AIDL "buildFeatures { aidl true }")
else()
ocv_update(ANDROID_GRADLE_JAVA_VERSION_INIT "1_8")
ocv_update(ANDROID_GRADLE_BUILD_FEATURE_AIDL "")
endif()
set(ANDROID_GRADLE_JAVA_VERSION "${ANDROID_GRADLE_JAVA_VERSION_INIT}" CACHE STRING "Android Gradle Java version")

@ -76,11 +76,10 @@ In addition to this instruction you can use some video guide, for example [this
@endcode
The fix was found [here](https://stackoverflow.com/questions/73225714/import-opencv-sdk-to-android-studio-chipmunk)
6. OpenCV project uses `aidl` and `buildConfig` features. Please enable them in
6. OpenCV project uses `buildConfig` feature. Please enable it in
`MyApplication/OpenCV/build.gradle` file to `android` block:
@code{.gradle}
buildFeatures{
aidl true
buildConfig true
}

@ -17,7 +17,7 @@ ocv_add_module(java BINDINGS opencv_core opencv_imgproc PRIVATE_REQUIRED opencv_
include(${CMAKE_CURRENT_SOURCE_DIR}/common.cmake)
# UTILITY: glob specific sources and append them to list (type is in H, CPP, JAVA, AIDL)
# UTILITY: glob specific sources and append them to list (type is in H, CPP, JAVA)
macro(glob_more_specific_sources _type _root _output)
unset(_masks)
if(${_type} STREQUAL "H")
@ -26,8 +26,6 @@ macro(glob_more_specific_sources _type _root _output)
set(_masks "${_root}/cpp/*.cpp")
elseif(${_type} STREQUAL "JAVA")
set(_masks "${_root}/java/*.java" "${_root}/java/*.java.in")
elseif(${_type} STREQUAL "AIDL")
set(_masks "${_root}/java/*.aidl")
endif()
if (_masks)
file(GLOB _result ${_masks})

@ -42,7 +42,6 @@ android {
main {
jniLibs.srcDirs = ['../../jni']
java.srcDirs = ['src'] // TODO Use original files instead of copied into build directory
aidl.srcDirs = ['src']
res.srcDirs = ['@OpenCV_SOURCE_DIR@/modules/java/android_sdk/android_gradle_lib/res']
manifest.srcFile 'AndroidManifest.xml'
}

@ -121,8 +121,6 @@ android {
targetCompatibility JavaVersion.VERSION_@ANDROID_GRADLE_JAVA_VERSION_INIT@
}
@ANDROID_GRADLE_BUILD_FEATURE_AIDL@
buildTypes {
debug {
packagingOptions {
@ -139,7 +137,6 @@ android {
}
buildFeatures {
aidl true
prefabPublishing true
buildConfig true
}
@ -153,7 +150,6 @@ android {
main {
jniLibs.srcDirs = ['native/libs']
java.srcDirs = ['java/src']
aidl.srcDirs = ['java/src']
res.srcDirs = ['java/res']
manifest.srcFile 'java/AndroidManifest.xml'
}

@ -1240,13 +1240,13 @@ JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete
def copy_java_files(java_files_dir, java_base_path, default_package_path='org/opencv/'):
global total_files, updated_files
java_files = []
re_filter = re.compile(r'^.+\.(java|aidl|kt)(.in)?$')
re_filter = re.compile(r'^.+\.(java|kt)(.in)?$')
for root, dirnames, filenames in os.walk(java_files_dir):
java_files += [os.path.join(root, filename) for filename in filenames if re_filter.match(filename)]
java_files = [f.replace('\\', '/') for f in java_files]
re_package = re.compile(r'^package +(.+);')
re_prefix = re.compile(r'^.+[\+/]([^\+]+).(java|aidl|kt)(.in)?$')
re_prefix = re.compile(r'^.+[\+/]([^\+]+).(java|kt)(.in)?$')
for java_file in java_files:
src = checkFileRemap(java_file)
with open(src, 'r') as f:

@ -39,7 +39,6 @@ android {
}
}
buildFeatures {
aidl true
prefabPublishing true
buildConfig true
}
@ -52,7 +51,6 @@ android {
main {
java.srcDirs = ['src/main/java']
//jniLibs.srcDirs = ['libs']
aidl.srcDirs = ['src/main/java']
}
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -33,7 +33,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -35,7 +35,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

@ -19,7 +19,6 @@ android {
sourceSets {
main {
java.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
aidl.srcDirs = @ANDROID_SAMPLE_JAVA_PATH@
res.srcDirs = @ANDROID_SAMPLE_RES_PATH@
manifest.srcFile '@ANDROID_SAMPLE_MANIFEST_PATH@'
}

Loading…
Cancel
Save