-
Notifications
You must be signed in to change notification settings - Fork 164
[java_api] [coco_detection_android_demo] Updating build.gradle to build libraries in Linux for android deployment #927
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ plugins { | |
| import org.gradle.internal.os.OperatingSystem | ||
|
|
||
| println 'Operating system: ' + OperatingSystem.current() | ||
| def arch = System.getProperty("os.arch") | ||
| def arch = System.getenv('CURRENT_ANDROID_PLATFORM_TYPE') ?: "arm-v8" | ||
| def ov_arch = arch; | ||
| println 'CPU architecture: ' + arch | ||
|
|
||
|
|
@@ -14,7 +14,7 @@ def nativesCPP; | |
| def openvinoVersion = "2024.2" | ||
|
|
||
| def native_resources = [] | ||
| def tbb_dir = System.getenv('TBB_DIR') | ||
| def tbb_dir = System.getenv('TBB_DIR') ?: System.getenv('OPV_HOME_DIR') + "/one-tbb-install/lib/cmake/TBB" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one-tbb-install directory can be changed, it's just example and there cannot be a universal way to find TBB, that why System.getenv('TBB_DIR') is required |
||
| if (tbb_dir) { | ||
| if (new File(tbb_dir + "/../lib/").exists()) { | ||
| native_resources.add(tbb_dir + "/../lib/"); | ||
|
|
@@ -34,15 +34,18 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") { | |
| ov_arch = "armhf"; | ||
| } | ||
|
|
||
| def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: System.getenv('OPV_HOME_DIR') + "/openvino_install" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as TBB |
||
| println ">>> INTEL_OPENVINO_DIR -> ${openVinoDir}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add logging or remove simple print messages in demos |
||
|
|
||
| if (OperatingSystem.current().isMacOsX()) { | ||
| nativesCPP = 'macosx-' | ||
| native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch + "/Release"); | ||
| native_resources.add(openVinoDir + "/runtime/lib/" + ov_arch + "/Release"); | ||
| } else if (OperatingSystem.current().isLinux()) { | ||
| nativesCPP = 'linux-' | ||
| native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch); | ||
| native_resources.add(openVinoDir + "/runtime/lib/" + ov_arch); | ||
| } else if (OperatingSystem.current().isWindows()) { | ||
| nativesCPP = 'windows-' | ||
| native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/" + ov_arch + "/Release"); | ||
| native_resources.add(openVinoDir + "/runtime/bin/" + ov_arch + "/Release"); | ||
| } else { | ||
| logger.warn('Unknown operating system!') | ||
| } | ||
|
|
@@ -58,6 +61,7 @@ native_resources.each { | |
| tree.visit { FileVisitDetails details -> | ||
| if (!details.file.isDirectory()) { | ||
| resources_list += details.file.name + "\n" | ||
| println ">>> Adding ${details.file.name} to native_resources" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sames sa with logging |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -91,4 +95,4 @@ test { | |
| systemProperty 'MODELS_PATH', System.getProperty('MODELS_PATH') | ||
| systemProperty 'device', System.getProperty('device') | ||
| } | ||
| test.onlyIf { project.hasProperty('run_tests') } | ||
| test.onlyIf { project.hasProperty('run_tests') } | ||
Uh oh!
There was an error while loading. Please reload this page.