[NUI] Check NUI internal API version, Remove tizenfx build dependency from dali 83/169983/1
authordongsug.song <dongsug.song@samsung.com>
Mon, 12 Feb 2018 12:18:37 +0000 (21:18 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 12 Feb 2018 12:18:37 +0000 (21:18 +0900)
Change-Id: I8eb1a8620d03c75ded08d71ab2ec5d2da781ef72
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
packaging/csapi-tizenfx.spec [changed mode: 0644->0755]
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/internal/VersionCheck.cs

old mode 100644 (file)
new mode 100755 (executable)
index c4bac31..a9a391d
@@ -5,15 +5,12 @@
 ################################################################################################
 
 %define TIZEN_NET_API_VERSION 4
-%define TIZEN_NET_RPM_VERSION 4.0.1.73+nui85
-%define TIZEN_NET_NUGET_VERSION 4.0.1-preview1-00073
-%define TIZEN_NET_INTERNAL_NUGET_VERSION 4.0.1.73
-%define NATIVE_DALI_VERSION 1.2.85
+%define TIZEN_NET_RPM_VERSION 4.0.1.74+nui401
+%define TIZEN_NET_NUGET_VERSION 4.0.1-preview1-00074
+%define TIZEN_NET_INTERNAL_NUGET_VERSION 4.0.1.74
 
 ################################################################################################
 
-%define CHECK_NATIVE_DEPS 1
-
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
@@ -36,10 +33,6 @@ AutoReqProv: no
 BuildRequires: dotnet-build-tools
 Requires(post): /usr/bin/vconftool
 
-%if 0%{CHECK_NATIVE_DEPS}
-BuildRequires: dali = %{NATIVE_DALI_VERSION}
-%endif
-
 %description
 %{summary}
 
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})");
+        }
     }
 }