3 # Look for CXX files that are not referenced by any makefile
9 a
= subprocess
.Popen("git ls-files", stdout
=subprocess
.PIPE
, shell
=True, encoding
='utf8')
12 if filename
.find(".cxx") != -1 \
13 and filename
.find("precompiled") == -1 \
14 and filename
.find("/workben") == -1 \
15 and not filename
.startswith("odk/examples/") \
16 and not filename
.startswith("bridges/") \
17 and not filename
.startswith("compilerplugins/") \
18 and filename
.find("/qa/") == -1 \
19 and filename
.find("/test/") == -1 \
20 and not filename
.startswith("testtools/") \
21 and not filename
.startswith("vcl/") \
22 and not filename
.startswith("cli_ure/"):
23 sourceFiles
.add(filename
.strip())
25 a
= subprocess
.Popen("git ls-files */*.mk", stdout
=subprocess
.PIPE
, shell
=True, encoding
='utf8')
27 for makefilename
in txt
:
28 makefilename
= makefilename
.strip()
29 with
open(makefilename
, "r") as makefile
:
30 moduleName
= makefilename
[:makefilename
.find("/")]
34 if state
== 0 and "_add_exception_objects" in line
:
36 elif state
== 1 and line
!= "))":
37 s
= line
.replace("\\","").replace(")", "").strip()
38 # parse line like: $(call gb_Helper_optional,AVMEDIA,svx/source/sidebar/media/MediaPlaybackPanel) \
42 sourceFiles
.discard(s
+ ".cxx")
49 print("files not listed in makefile")
50 print("----------------------------")
51 for x
in sorted(sourceFiles
):