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 tree = ET.parse("../pkg/Tizen.NET/Tizen.NET.nuspec")
10 for meta_child in root.iter():
11 if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
12 for depen_child in meta_child:
13 if depen_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}dependencies":
14 for group in depen_child:
15 tfm = group.attrib["targetFramework"].lower()
16 tfm = tfm.replace(".", "")
17 tfm = tfm.replace("20", "2.0")
21 tfm_list = list(set(tfm_list))
22 tfm_list.sort(reverse=True)
24 f = open(spec_dir,'r')
25 origin_data = f.read()
28 new_data = origin_data.replace("@tfm_support@", ':'.join(tfm_list))
30 f = open(spec_dir, 'w')