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