Bug 1155349 - set packageFilename in mach properties; r=glandium

This commit is contained in:
Mike Shal 2015-05-13 14:26:53 -04:00
parent d1cc1b3152
commit 1ace684ee5
2 changed files with 8 additions and 6 deletions

View File

@ -40,7 +40,7 @@ def getMarProperties(filename, partial=False):
'%sMarHash' % martype: mar_hash,
}
def getUrlProperties(filename):
def getUrlProperties(filename, package):
# let's create a switch case using name-spaces/dict
# rather than a long if/else with duplicate code
property_conditions = [
@ -57,9 +57,7 @@ def getUrlProperties(filename):
('codeCoverageURL', lambda m: m.endswith('code-coverage-gcno.zip')),
('sdkUrl', lambda m: m.endswith(('sdk.tar.bz2', 'sdk.zip'))),
('testPackagesUrl', lambda m: m.endswith('test_packages.json')),
# packageUrl must be last!
('packageUrl', lambda m: (not m.endswith('.json') and
not m.endswith('tests.zip'))),
('packageUrl', lambda m: m.endswith(package)),
]
url_re = re.compile(r'''^(https?://.*?\.(?:tar\.bz2|dmg|zip|apk|rpm|mar|tar\.gz|json))$''')
properties = {}
@ -102,10 +100,13 @@ if __name__ == '__main__':
parser.add_argument("--upload-files", required=True, nargs="+",
action="store", dest="upload_files",
help="List of files to be uploaded.")
parser.add_argument("--package", required=True,
action="store", dest="package",
help="Filename of the build package")
args = parser.parse_args()
json_data = getMarProperties(args.complete_mar_file)
json_data.update(getUrlProperties(args.upload_output))
json_data.update(getUrlProperties(args.upload_output, args.package))
if args.partial_mar_file:
json_data.update(getMarProperties(args.partial_mar_file, partial=True))
@ -119,6 +120,7 @@ if __name__ == '__main__':
json_data['partialInfo'] = getPartialInfo(json_data)
json_data['uploadFiles'] = args.upload_files
json_data['packageFilename'] = args.package
with open('mach_build_properties.json', 'w') as outfile:
json.dump(json_data, outfile, indent=4)

View File

@ -99,7 +99,7 @@ automation/l10n-check: automation/pretty-l10n-check
automation/update-packaging: automation/pretty-update-packaging
automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
$(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES))
$(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES)) --package $(PACKAGE)
# We need the log from make upload to grep it for urls in order to set
# properties.