2023-02-18 16:47:25 +00:00
|
|
|
Import("env")
|
|
|
|
|
|
|
|
import fnmatch
|
|
|
|
import os
|
2023-02-18 17:00:19 +00:00
|
|
|
import json
|
2023-02-18 16:47:25 +00:00
|
|
|
|
|
|
|
def verify_json(source, target, env):
|
|
|
|
for root, dirnames, files in os.walk("data"):
|
|
|
|
for file in files:
|
|
|
|
if file.endswith(".json"):
|
2023-02-18 17:00:19 +00:00
|
|
|
print("Validating " + root + '/' + file + '...')
|
|
|
|
json.load(open(root + '/' + file, 'r'))
|
2023-02-18 16:47:25 +00:00
|
|
|
|
2023-12-20 09:47:26 +00:00
|
|
|
usedTasks = set()
|
|
|
|
|
|
|
|
for root, dirnames, files in os.walk("data/profiles/"):
|
|
|
|
for file in files:
|
|
|
|
if file.endswith(".json"):
|
|
|
|
data = json.load(open(root + '/' + file, 'r'))
|
|
|
|
for task in data['tasks']:
|
|
|
|
usedTasks.add(task)
|
|
|
|
|
|
|
|
for sceneName in data['scenes']:
|
|
|
|
for task in data['scenes'][sceneName]:
|
|
|
|
usedTasks.add(task)
|
|
|
|
|
|
|
|
print("Used tasks:")
|
|
|
|
for task in sorted(usedTasks):
|
|
|
|
print("- " + task)
|
|
|
|
|
2023-02-18 16:47:25 +00:00
|
|
|
env.AddPreAction("buildfs", verify_json)
|