Release 12.0.0.18257
[platform/core/csapi/tizenfx.git] / packaging / maketfm.py
old mode 100644 (file)
new mode 100755 (executable)
index 959d733..8364ed1
@@ -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-tizen9.0, 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()