[NUI] Check NUI internal API version, Remove tizenfx build dependency from dali ...
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 9 Feb 2018 04:19:50 +0000 (13:19 +0900)
committerGitHub <noreply@github.com>
Fri, 9 Feb 2018 04:19:50 +0000 (13:19 +0900)
packaging/makespec.sh
packaging/version.txt
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/internal/VersionCheck.cs

index b183d7cd9766dc9569f6224b9d26170c23252476..0c19cb6f6c454619fc7974fbf4e9f55216db48d2 100755 (executable)
@@ -7,7 +7,7 @@ VERSION_FILE=$SCRIPT_DIR/version.txt
 RPMSPEC=$SCRIPT_DIR/csapi-tizenfx.spec
 RPMSPEC_IN=$RPMSPEC.in
 
-CHECK_NATIVE_DEPS=1
+CHECK_NATIVE_DEPS=0
 
 source $VERSION_FILE
 
index 6c04e91ddf587f85c90855b458972b72476d4f12..eb4e0a427b4bb1682b14e332f0f1681ba616aaf1 100755 (executable)
@@ -7,7 +7,7 @@ NUGET_VERSION=4.0.1-preview1-99999
 INTERNAL_NUGET_VERSION=4.0.1.999
 
 # RPM Version Suffix
-RPM_VERSION_SUFFIX=nui85
+RPM_VERSION_SUFFIX=nui401
 
 # Native Dependencies
-DALI_VERSION=1.2.85
+DALI_VERSION=0
index 71945bd3a80410671a662757e1bd60be8f14c62e..f4bc28d53c57a256a62da9a57675d70d5c394f52 100755 (executable)
@@ -1742,5 +1742,8 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_STOP_get")]
         public static extern int ImageView_IMAGE_VISUAL_ACTION_STOP_get();
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_NUI_InternalAPIVersionCheck")]
+        public static extern bool InternalAPIVersionCheck(ref int ver1, ref int ver2, ref int ver3);
+
     }
 }
index 7039acc93246b1ed5692e0395c8a8010caa80117..a6e157fc7277d3da881aff4a2401ff18486cc091 100755 (executable)
  */
 
 using System;
+using System.Diagnostics;
 
 namespace Tizen.NUI
 {
     //This version should be updated and synced for every Dali native release
     internal static class Version
     {
-        public const int daliVer1 = 1;
-        public const int daliVer2 = 2;
-        public const int daliVer3 = 85;
-        public const int nuiVer1 = 1;
-        public const int nuiVer2 = 2;
-        public const int nuiVer3 = 85;
-        public const string nuiRelease = "";
-
+        //Lower than dali_1.2.85 : NUI internal API version 400
+        //dali_1.2.86 : NUI internal API version 401
+        public const int nuiAPIVer = 401;
+        public const int reservedVer1 = 0;
+        public const int reservedVer2 = 0;
 
         static internal bool DaliVersionMatchWithNUI()
         {
@@ -39,27 +37,39 @@ namespace Tizen.NUI
 
             try
             {
-                if (NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3))
+                if (NDalicManualPINVOKE.InternalAPIVersionCheck(ref ver1, ref ver2, ref ver3) == true)
                 {
-                    if (ver1 != daliVer1 || ver2 != daliVer2 || ver3 != daliVer3)
+                    if (ver1 != nuiAPIVer)
                     {
-                        NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
-                        throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+                        NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+                        throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
                     }
                 }
                 else
                 {
-                    NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
-                    throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+                    NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+                    throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
                 }
             }
             catch (Exception)
             {
-                NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
-                throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+                NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+                throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
             }
-            NUILog.Debug($"version info: nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3}, dali= { ver1 }.{ ver2}.{ ver3}");
+
+            PrintDaliNativeVersion();
             return true;
         }
+
+        [Conditional("DEBUG_ON")]
+        static private void PrintDaliNativeVersion()
+        {
+            int ver1 = -1;
+            int ver2 = -1;
+            int ver3 = -1;
+
+            NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3);
+            NUILog.Debug($"DALi Version: ({ver1}.{ver2}.{ver3}), NUI API Version: ({nuiAPIVer})");
+        }
     }
 }