2 import xml.etree.ElementTree as ET
4 scrpit_dir = os.path.dirname(os.path.abspath(__file__))
5 spec_dir = os.path.join(scrpit_dir, "csapi-tizenfx.spec")
6 nuspec_file = os.path.join(scrpit_dir, "../pkg/Tizen.NET/Tizen.NET.nuspec")
7 tree = ET.parse(nuspec_file)
12 for meta_child in root.iter():
13 if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
14 for depen_child in meta_child:
15 if depen_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}dependencies":
16 for group in depen_child:
17 tfm = group.attrib["targetFramework"].lower()
18 if tfm.startswith("tizen"):
20 tfm_list1.append(tfm.replace(".", "").strip())
22 tfm_list2.append(tfm.strip())
24 tfm_list1 = list(set(tfm_list1))
25 tfm_list1.sort(reverse=True)
26 tfm_list2 = list(set(tfm_list2))
27 tfm_list2.sort(reverse=True)
28 tfm_list = tfm_list2 + tfm_list1
30 f = open(spec_dir,'r')
31 origin_data = f.read()
34 new_data = origin_data.replace("@tfm_support@", ':'.join(tfm_list))
36 f = open(spec_dir, 'w')