summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-06-03 11:32:37 +0200
committerGitHub <noreply@github.com>2018-06-03 11:32:37 +0200
commitfcc1db69ed783a9505d032009f84326fd83dd47c (patch)
tree8869df1a328c099b012c33a9bd1ced1a20dfc87d
parentd89e339a5ac91945e75c2ed6a8d4e39034def870 (diff)
parent93774317fae6b7f370a43c50f8811e1f8e1f0d5c (diff)
downloadUXP-fcc1db69ed783a9505d032009f84326fd83dd47c.tar
UXP-fcc1db69ed783a9505d032009f84326fd83dd47c.tar.gz
UXP-fcc1db69ed783a9505d032009f84326fd83dd47c.tar.lz
UXP-fcc1db69ed783a9505d032009f84326fd83dd47c.tar.xz
UXP-fcc1db69ed783a9505d032009f84326fd83dd47c.zip
Merge pull request #429 from JustOff/PR_unpreprocessed_files
Check if there are any unpreprocessed files in '@MOZ_OBJDIR@/dist/bin'
-rw-r--r--python/mozbuild/mozbuild/mach_commands.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index f654db769..1bd5b8d34 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -541,6 +541,16 @@ class Build(MachCommandBase):
# as when doing OSX Universal builds)
pass
+ # Check if there are any unpreprocessed files in '@MOZ_OBJDIR@/dist/bin'
+ # See python/mozbuild/mozbuild/preprocessor.py#L293-L309 for the list of directives
+ # We skip if, ifdef, ifndef, else, elif, elifdef and elifndef, because they are never used alone
+ grepcmd = 'grep -E -r "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\
+ + '--include=\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf} '\
+ + self.topobjdir + '/dist/bin | grep -v ".css:#"'
+ grepresult = subprocess.Popen(grepcmd, stdout=subprocess.PIPE, shell=True).communicate()[0]
+ if grepresult:
+ print('\nERROR: preprocessor was not applied to the following files:\n\n' + grepresult)
+
return status
@Command('configure', category='build',