mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 23:43:01 +00:00
23 lines
648 B
Python
23 lines
648 B
Python
import uuid
|
|
|
|
item_format = ''' <ClCompile Include="{FILENAME}">
|
|
<Filter>{TOP_FILTER}\\{PATH}</Filter>
|
|
</ClCompile>'''
|
|
|
|
def gen_item_group(top_filter, filename):
|
|
with open(filename, 'r') as f:
|
|
sources = f.readlines()
|
|
|
|
print(' <ItemGroup>')
|
|
current_filter = ''
|
|
for s in sources:
|
|
s = s.replace('\n', '').replace('\r', '').replace('/','\\')
|
|
path = s.rpartition('\\')[0].replace('..\\', '')
|
|
print(item_format
|
|
.replace('{FILENAME}', s)
|
|
.replace('{TOP_FILTER}', top_filter)
|
|
.replace('{PATH}', path))
|
|
print(' </ItemGroup>')
|
|
|
|
gen_item_group('Source Files', 'source.txt')
|
|
gen_item_group('Header Files', 'headers.txt')
|