-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_properties.sh
More file actions
executable file
·134 lines (125 loc) · 2.24 KB
/
Copy pathcheck_properties.sh
File metadata and controls
executable file
·134 lines (125 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/bash
if [[ -z "$1" ]]; then
echo "Usage: $0 PATH_TO_FASTBUILD_REPO" >&2
exit 1
fi
fastbuild_repo="$1"
if [[ ! -d "${fastbuild_repo}/Code/Tools/FBuild" ]]; then
echo "Path ${fastbuild_repo} doesn't look like a FASTBuild repository" >&2
exit 1
fi
if [[ ! -r "syntax/fastbuild.vim" ]]; then
echo "Can't find syntax/fastbuild.vim" >&2
exit 1
fi
property_regex='[.^"][A-Z][A-Z0-9]*[a-z][A-Za-z0-9]*"'
known_properties="$(mktemp)"
sed -n -e '/^syn keyword fbProperty/ s/^\(\w* \)*//p' "syntax/fastbuild.vim" \
| sort > "${known_properties}"
property_candidates="$(mktemp)"
grep -r --include *.h --include *.cpp -h "${property_regex}" "${fastbuild_repo}/Code/Tools/FBuild/FBuildCore" \
| sed -e '/^ *\/\//d; /WritePGItem/d; /PROFILE_SECTION/d; /DoSectionTitle/d; /REFLECT.*MetaHidden()/d; /REFLECT.*MetaEmbedMembers()/d' \
| grep -o "${property_regex}" \
| sed -e 's/^[.^"]//; s/"$//' \
| sort -u > "${property_candidates}"
false_positives="$(mktemp)"
cat > "${false_positives}" <<EOF
Alias
Any
ArrayOfStrings
ArrayOfStructs
Bool
CacheFreeMemory
CacheInit
CacheOutputInfo
CachePublish
CacheRetrieve
CacheShutdown
CacheTrim
Client
ClientThread
CompilerInputFile
Connection
Copy
CopyDir
CopyFile
CppForm
CSAssembly
Debug
Directory
Dynamic
Error
ExcludePaths
ExcludePatterns
Exe
Exec
Fa
FastBuild
Fd
File
FilesToExclude
Fo
ForEach
Fp
Gm
Idle
If
Int
Job
JobResult
Library
Linux
Manifest
NoJobAvailable
Object
ObjectList
Organization
Patterns
PBXLegacyTarget
PBXNativeTarget
PBXProject
PCHObjectFileName
PreBuild
PrecompiledHeader
Print
Proxy
Recursive
Release
RemoteWorkerThread
RemoveDir
RequestFile
RequestJob
RequestManifest
Server
ServerStatus
ServerThread
Settings
Sources
Static
Status
String
Struct
Test
Unavailable
Uncacheable
Unity
Using
VCXProj
VCXProject
VSSolution
Win32
Windows
WorkerThread
XCodeProj
XCodeProject
Yc
Yu
Zi
EOF
echo "Known properties not found in FASTBuild source code:"
comm -23 "${known_properties}" "${property_candidates}"
echo "Potential new properties:"
comm -13 "${known_properties}" <(comm -23 "${property_candidates}" "${false_positives}")
echo "False positives not found in property candidates (sanity check):"
comm -23 "${false_positives}" "${property_candidates}"
rm -f "${known_properties}" "${property_candidates}" "${false_positives}"