-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new Docker environment with Android build tools v30 #26
Added new Docker environment with Android build tools v30 #26
Conversation
Switched to Android command line tools instead of deprecated sdk-tools. - Java JRE 17 - Gradle 7.5.1 - CMake 3.22.1 The environment requires namespace definition in build.gradle.
&& mkdir -p $ANDROID_HOME/cmdline-tools/latest \ | ||
&& mv cmdline-tools/* $ANDROID_HOME/cmdline-tools/latest/ \ | ||
&& tree $ANDROID_HOME \ | ||
&& echo "y\n" > /tmp/yes \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this script for installing SDK some time ago: https://github.com/mshabunin/opencv-android-build/blob/master/scripts/get_sdk.sh
- might be necessary to run
sdkmanager --update
first - you can run
yes | sdkmanager --licenses
once and skip license request further - why run several commands when
sdkmanager --install <pkg> <pkg> <pkg> ...
form can be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
# Image name: quay.io/opencv-ci/opencv-androidsdk-30 | ||
# For 4.x branch | ||
|
||
FROM ubuntu:20.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no 22.04?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used the same base image as before. It does not actually matters here, because most of work is done by cross tools.
software-properties-common \ | ||
build-essential ccache ninja-build \ | ||
python3 python3-pip curl zip unzip file \ | ||
openjdk-8-jdk openjdk-17-jre libncurses5 tree \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 JDKs are necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JDK 8 is used for Android code. JRE 17 is used for SDK tools, Gradle, etc.
apt-get install -y --no-install-recommends git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /opt/gradle && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to install system gradle package? I thought that required version will be automatically downloaded by project if necessary.
For example we can see in the logs that gradle 5.6.4 has been used despite having 7.5.1 installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try align gradle version here and in main repo: opencv/opencv#24473. The goal is to re-use everything from docker and do not download tools on the go.
Updated Android samples for modern Android studio. Added OpenCV from Maven support. #24473 Updated samples for recent Android studio: - added namespace field that is required in build.gradle files - replaced _switch_ by _if-else_ because it doesn't work with constants from resources - added missed log library dependency in face-detection/jni/CMakeLists.txt - use local.properties to define NDK location Added support for OpenCV from Maven. Now you can choose 3 possible sources of OpenCV lib in settings.gradle: SDK path, local Maven repository, public Maven repository. (Creating Maven repository from SDK is added here #24456 ) There are differences in project configs for SDK and Maven versions: - different dependencies in build.gradle - different OpenCV library names in CMakeLists.txt - SDK version requires OpenCV_DIR definition Requires: - opencv/ci-gha-workflow#124 - opencv-infrastructure/opencv-gha-dockerfile#26
Updated Android samples for modern Android studio. Added OpenCV from Maven support. opencv#24473 Updated samples for recent Android studio: - added namespace field that is required in build.gradle files - replaced _switch_ by _if-else_ because it doesn't work with constants from resources - added missed log library dependency in face-detection/jni/CMakeLists.txt - use local.properties to define NDK location Added support for OpenCV from Maven. Now you can choose 3 possible sources of OpenCV lib in settings.gradle: SDK path, local Maven repository, public Maven repository. (Creating Maven repository from SDK is added here opencv#24456 ) There are differences in project configs for SDK and Maven versions: - different dependencies in build.gradle - different OpenCV library names in CMakeLists.txt - SDK version requires OpenCV_DIR definition Requires: - opencv/ci-gha-workflow#124 - opencv-infrastructure/opencv-gha-dockerfile#26
Updated Android samples for modern Android studio. Added OpenCV from Maven support. opencv#24473 Updated samples for recent Android studio: - added namespace field that is required in build.gradle files - replaced _switch_ by _if-else_ because it doesn't work with constants from resources - added missed log library dependency in face-detection/jni/CMakeLists.txt - use local.properties to define NDK location Added support for OpenCV from Maven. Now you can choose 3 possible sources of OpenCV lib in settings.gradle: SDK path, local Maven repository, public Maven repository. (Creating Maven repository from SDK is added here opencv#24456 ) There are differences in project configs for SDK and Maven versions: - different dependencies in build.gradle - different OpenCV library names in CMakeLists.txt - SDK version requires OpenCV_DIR definition Requires: - opencv/ci-gha-workflow#124 - opencv-infrastructure/opencv-gha-dockerfile#26
Updated Android samples for modern Android studio. Added OpenCV from Maven support. opencv#24473 Updated samples for recent Android studio: - added namespace field that is required in build.gradle files - replaced _switch_ by _if-else_ because it doesn't work with constants from resources - added missed log library dependency in face-detection/jni/CMakeLists.txt - use local.properties to define NDK location Added support for OpenCV from Maven. Now you can choose 3 possible sources of OpenCV lib in settings.gradle: SDK path, local Maven repository, public Maven repository. (Creating Maven repository from SDK is added here opencv#24456 ) There are differences in project configs for SDK and Maven versions: - different dependencies in build.gradle - different OpenCV library names in CMakeLists.txt - SDK version requires OpenCV_DIR definition Requires: - opencv/ci-gha-workflow#124 - opencv-infrastructure/opencv-gha-dockerfile#26
Switched to Android command line tools instead of deprecated sdk-tools.
The environment requires namespace definition in build.gradle.