[Build] Modify the script that generates the TFM list (#5703)
authorJongHeonChoi <j-h.choi@samsung.com>
Mon, 13 Nov 2023 02:05:32 +0000 (11:05 +0900)
committerGitHub <noreply@github.com>
Mon, 13 Nov 2023 02:05:32 +0000 (11:05 +0900)
packaging/500.tizenfx_upgrade.sh
packaging/csapi-tizenfx.spec
packaging/csapi-tizenfx.spec.in
packaging/makerid.py
packaging/makeruntimeversion.py [deleted file]
packaging/makespec.sh
packaging/maketfm.py

index 6b175c5..a4f4daa 100644 (file)
@@ -3,6 +3,6 @@
 
 PATH=/bin:/usr/bin
 
-vconftool set -f -t int db/dotnet/tizen_api_version 10
-vconftool set -f -t string db/dotnet/tizen_rid_version "4.0.0:5.0.0:5.5.0:6.0.0:6.5.0:7.0.0"
-vconftool set -f -t string db/dotnet/tizen_tfm_support "tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40"
+vconftool set -f -t int db/dotnet/tizen_api_version 11
+vconftool set -f -t string db/dotnet/tizen_rid_version "8.0.0:7.0.0:6.5.0:6.0.0:5.5.0:5.0.0:4.0.0"
+vconftool set -f -t string db/dotnet/tizen_tfm_support "net6.0-tizen8.0:net6.0-tizen:net6.0:tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40"
index f642fbc..6008af7 100644 (file)
@@ -12,9 +12,8 @@
 %define DOTNET_LIBRARY_PATH /usr/share/dotnet.tizen/lib
 %define DOTNET_NUGET_SOURCE /nuget
 
-%define TIZEN_NET_RUNTIME_IDENTIFIERS 4.0.0:5.0.0:5.5.0:6.0.0:6.5.0:7.0.0:8.0.0
-%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40
-%define DOTNET_CORE_RUNTIME_VERSION 6.0
+%define TIZEN_NET_RUNTIME_IDENTIFIERS 8.0.0:7.0.0:6.5.0:6.0.0:5.5.0:5.0.0:4.0.0
+%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS net6.0-tizen8.0:net6.0-tizen:net6.0:tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40
 
 %define UPGRADE_SCRIPT_PATH /usr/share/upgrade/scripts
 
@@ -219,14 +218,10 @@ install -p -m 755 packaging/500.tizenfx_upgrade.sh %{buildroot}%{UPGRADE_SCRIPT_
 %post
 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
-/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
-/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
-/usr/bin/vconftool set -t string db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION} -f
 mkdir -p %{DOTNET_LIBRARY_PATH}
 touch %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 echo "db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS}" > %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 echo "db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS}" >> %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
-echo "db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION}" >> %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 
 %files
 %license LICENSE
index 1c0dfaf..17db927 100644 (file)
@@ -13,7 +13,6 @@
 
 %define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
 %define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS @tfm_support@
-%define DOTNET_CORE_RUNTIME_VERSION 6.0
 
 %define UPGRADE_SCRIPT_PATH /usr/share/upgrade/scripts
 
@@ -218,14 +217,10 @@ install -p -m 755 packaging/500.tizenfx_upgrade.sh %{buildroot}%{UPGRADE_SCRIPT_
 %post
 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
-/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
-/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
-/usr/bin/vconftool set -t string db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION} -f
 mkdir -p %{DOTNET_LIBRARY_PATH}
 touch %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 echo "db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS}" > %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 echo "db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS}" >> %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
-echo "db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION}" >> %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 
 %files
 %license LICENSE
index c101198..bded638 100755 (executable)
@@ -23,7 +23,7 @@ with open(runtime_dir) as json_file:
             rid_list.append(key)
 
     rid_list = list(set(rid_list))
-    rid_list.sort()
+    rid_list.sort(reverse=True)
 
     f = open(spec_dir,'r')
     origin_data = f.read()
diff --git a/packaging/makeruntimeversion.py b/packaging/makeruntimeversion.py
deleted file mode 100755 (executable)
index 1713f0f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-import os
-import xml.etree.ElementTree as ET
-
-scrpit_dir = os.path.dirname(os.path.abspath(__file__))
-spec_dir = os.path.join(scrpit_dir, "csapi-tizenfx.spec")
-nuspec_file = os.path.join(scrpit_dir, "../pkg/Tizen.NET/Tizen.NET.nuspec")
-tree = ET.parse(nuspec_file)
-root = tree.getroot()
-
-runtime_list = []
-for meta_child in root.iter():
-    if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
-        for depen_child in meta_child:
-            if depen_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}dependencies":
-                for group in depen_child:
-                    tfm = group.attrib["targetFramework"].lower()
-                    if tfm.startswith(".net"):
-                        if len(tfm) != 15:
-                            runtime_list.append(tfm.replace(".net", "").strip())
-
-runtime_list = list(set(runtime_list))
-runtime_list.sort(reverse=True)
-
-f = open(spec_dir,'r')
-origin_data = f.read()
-f.close()
-
-new_data = origin_data.replace("@dotnet_core_version@", ':'.join(runtime_list))
-
-f = open(spec_dir, 'w')
-f.write(new_data)
-f.close()
index 85f04f8..103b285 100755 (executable)
@@ -30,6 +30,3 @@ python $SCRIPT_DIR/makerid.py
 
 # Update TFM
 python $SCRIPT_DIR/maketfm.py
-
-# Update Runtime Version
-python $SCRIPT_DIR/makeruntimeversion.py
index 959d733..477e1b6 100755 (executable)
@@ -1,4 +1,4 @@
-import os
+import os, re
 import xml.etree.ElementTree as ET
 
 scrpit_dir = os.path.dirname(os.path.abspath(__file__))
@@ -7,8 +7,9 @@ nuspec_file = os.path.join(scrpit_dir, "../pkg/Tizen.NET/Tizen.NET.nuspec")
 tree = ET.parse(nuspec_file)
 root = tree.getroot()
 
-tfm_list1 = []
-tfm_list2 = []
+tfm_list1 = [] #tizen90, tizen80, tizen70, tizen60, tizen50, tizen40
+tfm_list2 = [] #tizen10.0
+tfm_list3 = [] #net6.0-tizen8.0, net6.0-tizen, net6.0
 for meta_child in root.iter():
     if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
         for depen_child in meta_child:
@@ -20,12 +21,21 @@ for meta_child in root.iter():
                             tfm_list1.append(tfm.replace(".", "").strip())
                         else:
                             tfm_list2.append(tfm.strip())
+                    elif tfm.startswith("net"):
+                        if len(tfm) < 8:
+                            tfm_list3.append(tfm.strip() + "-tizen")
+                        tfm_list3.append(tfm.strip())
+
 
 tfm_list1 = list(set(tfm_list1))
 tfm_list1.sort(reverse=True)
 tfm_list2 = list(set(tfm_list2))
 tfm_list2.sort(reverse=True)
-tfm_list = tfm_list2 + tfm_list1
+tfm_list3 = list(set(tfm_list3))
+tfm_list3.sort(key=len)
+tfm_list3.sort(key=lambda s: float(re.search(r'(\d+)\.', s).group()[0]))
+tfm_list3.reverse()
+tfm_list = tfm_list3 + tfm_list2 + tfm_list1
 
 f = open(spec_dir,'r')
 origin_data = f.read()