diff --git a/.github/workflows/asi-vcxproj-check.yml b/.github/workflows/asi-vcxproj-check.yml new file mode 100644 index 000000000..84a742ebf --- /dev/null +++ b/.github/workflows/asi-vcxproj-check.yml @@ -0,0 +1,17 @@ +name: ChaosMod.vcxproj Check + +on: push + +jobs: + tests: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v4 + + - name: Run scripts/asi_vcxproj_check.py + run: python scripts/asi_vcxproj_check.py ChaosMod/ ChaosMod.vcxproj diff --git a/scripts/asi_vcxproj_check.py b/scripts/asi_vcxproj_check.py new file mode 100644 index 000000000..4027692ea --- /dev/null +++ b/scripts/asi_vcxproj_check.py @@ -0,0 +1,38 @@ +import os +import sys + +BLACKLISTED_SUBDIRS = ( "x64" ".cache" "build" ) + +if len(sys.argv) < 3: + print("Need source directory and file as parameter!") + exit(1) + +SOURCE_DIR = sys.argv[1] +PROJECT_FILE = sys.argv[2] + +source_files = [] +project_files = [] +is_successful = True + +for subdir, dirs, files in os.walk(SOURCE_DIR, topdown = True): + subdir = "" if subdir == SOURCE_DIR else (subdir[len(SOURCE_DIR):].replace("/", "\\") + "\\") + + for file in files: + if file.endswith(".cpp") or file.endswith(".h"): + source_files.append(f"{subdir}{file}") + + dirs[:] = [dir for dir in dirs if not dir in BLACKLISTED_SUBDIRS] + +with open(SOURCE_DIR + PROJECT_FILE, "r") as _in: + for line in _in: + if "