OpenCV version swithed to 4 digit in GUI and package revision number.

pull/572/head
Alexander Smorkalov 12 years ago
parent 9f15daf0a0
commit ddc2e334da
  1. 2
      android/libinfo/info.c
  2. 4
      android/package/AndroidManifest.xml
  3. 10
      android/service/engine/jni/NativeService/PackageInfo.cpp
  4. 14
      android/service/engine/jni/Tests/PackageInfoTest.cpp
  5. 22
      android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java

@ -7,7 +7,7 @@ const char* GetLibraryList(void);
JNIEXPORT jstring JNICALL Java_org_opencv_android_StaticHelper_getLibraryList(JNIEnv *, jclass);
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) "_" ANDROID_PACKAGE_PLATFORM
#define PACKAGE_REVISION CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE)
#define PACKAGE_REVISION CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE) "." CVAUX_STR(CV_VERSION_REVISION)
const char* GetPackageName(void)
{

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.lib_v@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@_@ANDROID_PACKAGE_PLATFORM@"
android:versionCode="@OPENCV_VERSION_PATCH@@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@ANDROID_PACKAGE_RELEASE@" >
android:versionCode="@OPENCV_VERSION_PATCH@@OPENCV_VERSION_TWEAK@@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@OPENCV_VERSION_TWEAK@.@ANDROID_PACKAGE_RELEASE@" >
<uses-sdk android:minSdkVersion="@ANDROID_SDK_VERSION@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>

@ -136,8 +136,18 @@ inline int SplitVersion(const vector<string>& features, const string& package_ve
// Taking release and build number from package revision
vector<string> tmp2 = SplitStringVector(package_version, '.');
if (tmp2.size() == 2)
{
// the 2nd digit is revision
result += atoi(tmp2[0].c_str())*100 + 00;
}
else
{
// the 2nd digit is part of library version
// the 3rd digit is revision
result += atoi(tmp2[0].c_str())*100 + atoi(tmp2[1].c_str());
}
}
else
{
// TODO: Report package name format error

@ -157,6 +157,20 @@ TEST(PackageInfo, MipsFromFullName)
}
#endif
TEST(PackageInfo, Check2DigitRevision)
{
PackageInfo info("org.opencv.lib_v23_armv7a_neon", "/data/data/org.opencv.lib_v23_armv7_neon", "4.1");
EXPECT_EQ(2030400, info.GetVersion());
EXPECT_EQ(ARCH_ARMv7 | FEATURES_HAS_NEON, info.GetCpuID());
}
TEST(PackageInfo, Check3DigitRevision)
{
PackageInfo info("org.opencv.lib_v23_armv7a_neon", "/data/data/org.opencv.lib_v23_armv7_neon", "4.1.5");
EXPECT_EQ(2030401, info.GetVersion());
EXPECT_EQ(ARCH_ARMv7 | FEATURES_HAS_NEON, info.GetCpuID());
}
TEST(PackageInfo, Comparator1)
{
PackageInfo info1(2040000, PLATFORM_UNKNOWN, ARCH_X86);

@ -299,10 +299,9 @@ public class ManagerActivity extends Activity
else
NativeLibDir = "/data/data/" + mInstalledPackageInfo[i].packageName + "/lib";
OpenCVLibraryInfo NativeInfo = new OpenCVLibraryInfo(NativeLibDir);
if (PackageName.equals("org.opencv.engine"))
{
OpenCVLibraryInfo NativeInfo = new OpenCVLibraryInfo(NativeLibDir);
if (NativeInfo.status())
{
PublicName = "Built-in OpenCV library";
@ -348,9 +347,7 @@ public class ManagerActivity extends Activity
if (null != ActivePackagePath)
{
int start = ActivePackagePath.indexOf(mInstalledPackageInfo[i].packageName);
int stop = start + mInstalledPackageInfo[i].packageName.length();
if (start >= 0 && ActivePackagePath.charAt(stop) == '/')
if (ActivePackagePath.equals(NativeLibDir))
{
temp.put("Activity", "y");
Tags = "active";
@ -405,13 +402,22 @@ public class ManagerActivity extends Activity
if (OpenCVersion == null || PackageVersion == null)
return "unknown";
int dot = PackageVersion.indexOf(".");
if (dot == -1 || OpenCVersion.length() == 0)
String[] revisions = PackageVersion.split("\\.");
if (revisions.length <= 1 || OpenCVersion.length() == 0)
return "unknown";
else
if (revisions.length == 2)
// the 2nd digit is revision
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
revisions[0] + " rev " + revisions[1];
else
// the 2nd digit is part of library version
// the 3rd digit is revision
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
PackageVersion.substring(0, dot) + " rev " + PackageVersion.substring(dot+1);
revisions[0] + "." + revisions[1] + " rev " + revisions[2];
}
protected String ConvertPackageName(String Name, String Version)

Loading…
Cancel
Save