-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vcpkg] Added python script to generate all packages file list, added…
… to azur… (#12177) * Added python script to generate all packages file list, added to azure pipeline to build at the end of the run * fixed an issue that causes some leading slashes were being removed * Header Database now includes hpp files for C++ header files * Changed Header Database to include all files under \include\ folder * Apply suggestions from code review, changing condition from eq to ne Co-authored-by: Billy O'Neal <[email protected]> * Update last condition from eq to ne Co-authored-by: Billy O'Neal <[email protected]>
- Loading branch information
1 parent
8974699
commit aa2b9ef
Showing
5 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
import os.path | ||
import sys | ||
|
||
|
||
keyword = "include/" | ||
|
||
def getFiles(path): | ||
files = os.listdir(path) | ||
return list(filter(lambda x: x[0] != '.', files)) | ||
|
||
def gen_all_file_strings(path, files, headers, output): | ||
for file in files: | ||
package = file[:file.find("_")] | ||
f = open(path + file) | ||
for line in f: | ||
idx = line.strip().find(keyword) | ||
if idx >= 0 and line.strip()[-1] != "/": | ||
headers.write(package + ":" + line[idx + len(keyword):]) | ||
output.write(package + ":" + line[idx-1:]) | ||
elif line.strip()[-1] != "/": | ||
output.write(package + ":" + line[line.find("/"):]) | ||
f.close() | ||
|
||
def main(path): | ||
try: | ||
os.mkdir("scripts/list_files") | ||
except FileExistsError: | ||
print("Path already exists, continuing...") | ||
|
||
headers = open("scripts/list_files/VCPKGHeadersDatabase.txt", mode='w') | ||
output = open("scripts/list_files/VCPKGDatabase.txt", mode='w') | ||
gen_all_file_strings(path, getFiles(path), headers, output) | ||
headers.close() | ||
output.close() | ||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) | ||
|
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