Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5353 from mozilla-services/dont-ship-test-files
Browse files Browse the repository at this point in the history
Fix #5241, don't ship files in test/ with Firefox
  • Loading branch information
ianb committed Feb 12, 2019
2 parents b004b5c + b4d3873 commit bd5122c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions bin/update_mozbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
import re

skipFiles = [
"manifest.json.template"
"manifest.json.template",
"test",
]


def getFullFileList(outputLoc, dirName):
result = {dirName: []}
for entry in os.listdir(outputLoc):
if entry in skipFiles:
continue
if os.path.isdir(os.path.join(outputLoc, entry)):
result.update(getFullFileList(os.path.join(outputLoc, entry), os.path.join(dirName, entry)))
elif entry not in skipFiles:
if dirName:
result[dirName].append(os.path.join(dirName, entry))
else:
result[dirName].append(entry)
elif dirName:
result[dirName].append(os.path.join(dirName, entry))
else:
result[dirName].append(entry)

return result

Expand All @@ -37,7 +39,10 @@ def rewriteMozBuild(outputLoc, fileList):
if not fileList[dir]:
continue

mozBuildPathName = '["' + '"]["'.join(dir.split(os.sep)) + '"]'
if not dir:
mozBuildPathName = ""
else:
mozBuildPathName = '["' + '"]["'.join(dir.split(os.sep)) + '"]'

insertion_text += \
"FINAL_TARGET_FILES.features['screenshots@mozilla.org']%s += [\n" % mozBuildPathName + \
Expand All @@ -59,7 +64,7 @@ def rewriteMozBuild(outputLoc, fileList):
def main(mcRepoPath, mcSubDir):
outputLoc = os.path.join(mcRepoPath, mcSubDir)

fileList = getFullFileList(os.path.join(outputLoc, "webextension"), "webextension")
fileList = getFullFileList(outputLoc, "")

rewriteMozBuild(outputLoc, fileList)

Expand Down

0 comments on commit bd5122c

Please sign in to comment.