def add_from_lua_api(my_path):
# add all api from *.lua
apis = set()
files = glob.glob(my_path + '/**/*.lua', recursive=True)
# files = ['xmake/languages/asm/load.lua']
apireg = re.compile(r'^ +(, +)?"\w+\.(\w+)"$',re.MULTILINE)
for fil in files:
with io.open(fil , encoding='latin-1') as f:
content = f.read()
for match in apireg.finditer(content):
# print(match[0] , match[2])
apis.add(match[2])
return apis
scan apis by regex '^ +(, +)?"\w+\.(\w+)"$'
and add them to xmakeCommands
scan apis by regex
'^ +(, +)?"\w+\.(\w+)"$'
and add them toxmakeCommands