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 if tfm.startswith(".net"):
19 runtime_list.append(tfm.replace(".net", "").strip())
21 runtime_list = list(set(runtime_list))
22 runtime_list.sort(reverse=True)
24 f = open(spec_dir,'r')
25 origin_data = f.read()
28 new_data = origin_data.replace("@dotnet_core_version@", ':'.join(runtime_list))
30 f = open(spec_dir, 'w')