Created
October 4, 2012 08:41
-
-
Save d-led/3832290 to your computer and use it in GitHub Desktop.
filter vcxproj files into a lua table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('pugilua') | |
local doc=pugi.xml_document() | |
local res=doc:load_file [[..\pugilua.vcxproj]] | |
print('Parsed: '..res.description) | |
assert(res.valid) | |
local text='{\n' | |
local query1=doc:root():select_nodes('/Project/ItemGroup/ClCompile | /Project/ItemGroup/ClInclude') | |
local n=query1.size | |
for i=0,n-1 do | |
text=text..'\t\''..query1:get(i):node():attribute('Include').value..'\''..'\n' | |
end | |
text=text..'}' | |
print(text) | |
--local f = assert(io.open("dump.txt", "w")) | |
--f:write(text) | |
--f:close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment