From dbcc55a196cd0d1cab7053b339d937c5a614eb8e Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 9 Oct 2015 17:06:01 +0300 Subject: [PATCH 1/3] cleanup /src|gen folders to remove stalled/unused Java files --- modules/java/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 1a1512d36..68d3ff9ca 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -7,6 +7,13 @@ if(IOS OR WINRT OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JN ocv_module_disable(java) endif() +if(EXISTS ${CMAKE_BINARY_DIR}/src) + execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/src") +endif() +if(EXISTS ${CMAKE_BINARY_DIR}/gen) + execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/gen") +endif() + set(the_description "The java bindings") ocv_add_module(java BINDINGS opencv_core opencv_imgproc) ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp") From a21be6706df0266fa9c915bf94df1066478e6694 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 12 Oct 2015 14:27:05 +0300 Subject: [PATCH 2/3] android: force OpenCV library target to "android-21" --- platforms/android/build-tests/test_ant_build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/android/build-tests/test_ant_build.py b/platforms/android/build-tests/test_ant_build.py index 8ed2bdd66..73ac4d018 100644 --- a/platforms/android/build-tests/test_ant_build.py +++ b/platforms/android/build-tests/test_ant_build.py @@ -17,7 +17,7 @@ class TestAntBuild(unittest.TestCase): self.sample_dir = os.path.join(self.workdir, "project") def shortDescription(self): - return "TARGET: %s, SAMPLE: %s" % (self.target, os.path.basename(self.src_sample_dir)) + return "TARGET: %r, SAMPLE: %s" % (self.target, os.path.basename(self.src_sample_dir)) def setUp(self): if os.path.exists(self.workdir): @@ -32,7 +32,7 @@ class TestAntBuild(unittest.TestCase): shutil.rmtree(self.workdir) def runTest(self): - cmd = [os.path.join(os.environ["ANDROID_SDK"], "tools", "android"), "update", "project", "-p", self.lib_dir, "-t", self.target] + cmd = [os.path.join(os.environ["ANDROID_SDK"], "tools", "android"), "update", "project", "-p", self.lib_dir, "-t", self.target[0]] retcode = subprocess.call(cmd) self.assertEqual(retcode, 0, "android update opencv project failed") @@ -40,7 +40,7 @@ class TestAntBuild(unittest.TestCase): retcode = subprocess.call(cmd) self.assertEqual(retcode, 0, "opencv ant build failed") - cmd = [os.path.join(os.environ["ANDROID_SDK"], "tools", "android"), "update", "project", "-p", self.sample_dir, "-t", self.target, "-l", os.path.relpath(self.lib_dir, self.sample_dir)] + cmd = [os.path.join(os.environ["ANDROID_SDK"], "tools", "android"), "update", "project", "-p", self.sample_dir, "-t", self.target[1], "-l", os.path.relpath(self.lib_dir, self.sample_dir)] retcode = subprocess.call(cmd) self.assertEqual(retcode, 0, "android update sample project failed") @@ -50,7 +50,7 @@ class TestAntBuild(unittest.TestCase): def suite(workdir, opencv_lib_path, opencv_samples_path): suite = unittest.TestSuite() - for target in ["android-14", "android-17"]: + for target in [("android-21", "android-14"), ("android-21", "android-17")]: for item in os.listdir(opencv_samples_path): item = os.path.join(opencv_samples_path, item) if (os.path.exists(os.path.join(item, "AndroidManifest.xml"))): From ddd91bcebf0b6661a785be4db8540a7a1c5f2d94 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 12 Oct 2015 18:12:34 +0300 Subject: [PATCH 3/3] android: add targetSdkVersion="21" --- modules/java/android_lib/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java/android_lib/AndroidManifest.xml b/modules/java/android_lib/AndroidManifest.xml index 1943221e9..228c6cfbb 100644 --- a/modules/java/android_lib/AndroidManifest.xml +++ b/modules/java/android_lib/AndroidManifest.xml @@ -4,5 +4,5 @@ android:versionCode="@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@@OPENCV_VERSION_PATCH@0" android:versionName="@OPENCV_VERSION@"> - +