1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/moz-automation.mk Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,115 @@ 1.4 +# 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +ifneq (,$(filter automation/%,$(MAKECMDGOALS))) 1.10 +ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION)))) 1.11 +MAKEFLAGS += --output-sync=target 1.12 +else 1.13 +.NOTPARALLEL: 1.14 +endif 1.15 +endif 1.16 + 1.17 +include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk 1.18 + 1.19 +# Log file from the 'make upload' step. We need this to parse out the URLs of 1.20 +# the uploaded files. 1.21 +AUTOMATION_UPLOAD_OUTPUT = $(DIST)/automation-upload.txt 1.22 + 1.23 +# Helper variables to convert from MOZ_AUTOMATION_* variables to the 1.24 +# corresponding the make target 1.25 +tier_BUILD_SYMBOLS = buildsymbols 1.26 +tier_L10N_CHECK = l10n-check 1.27 +tier_PRETTY_L10N_CHECK = pretty-l10n-check 1.28 +tier_INSTALLER = installer 1.29 +tier_PRETTY_INSTALLER = pretty-installer 1.30 +tier_PACKAGE = package 1.31 +tier_PRETTY_PACKAGE = pretty-package 1.32 +tier_PACKAGE_TESTS = package-tests 1.33 +tier_PRETTY_PACKAGE_TESTS = pretty-package-tests 1.34 +tier_UPDATE_PACKAGING = update-packaging 1.35 +tier_PRETTY_UPDATE_PACKAGING = pretty-update-packaging 1.36 +tier_UPLOAD_SYMBOLS = uploadsymbols 1.37 +tier_UPLOAD = upload 1.38 + 1.39 +# Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in 1.40 +# TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted 1.41 +# here in the order that they will be executed (since mach doesn't know of the 1.42 +# dependencies between them). 1.43 +moz_automation_symbols = \ 1.44 + PACKAGE_TESTS \ 1.45 + PRETTY_PACKAGE_TESTS \ 1.46 + BUILD_SYMBOLS \ 1.47 + UPLOAD_SYMBOLS \ 1.48 + PACKAGE \ 1.49 + PRETTY_PACKAGE \ 1.50 + INSTALLER \ 1.51 + PRETTY_INSTALLER \ 1.52 + UPDATE_PACKAGING \ 1.53 + PRETTY_UPDATE_PACKAGING \ 1.54 + L10N_CHECK \ 1.55 + PRETTY_L10N_CHECK \ 1.56 + UPLOAD \ 1.57 + $(NULL) 1.58 +MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,$(MOZ_AUTOMATION_$(sym))),$(tier_$(sym)))) 1.59 + 1.60 +# Dependencies between automation build steps 1.61 +automation/uploadsymbols: automation/buildsymbols 1.62 + 1.63 +automation/update-packaging: automation/package 1.64 +automation/pretty-update-packaging: automation/pretty-package 1.65 +automation/pretty-update-packaging: automation/pretty-installer 1.66 + 1.67 +automation/l10n-check: automation/package 1.68 +automation/l10n-check: automation/installer 1.69 +automation/pretty-l10n-check: automation/pretty-package 1.70 +automation/pretty-l10n-check: automation/pretty-installer 1.71 + 1.72 +automation/upload: automation/installer 1.73 +automation/upload: automation/package 1.74 +automation/upload: automation/package-tests 1.75 +automation/upload: automation/buildsymbols 1.76 +automation/upload: automation/update-packaging 1.77 + 1.78 +# automation/{pretty-}package should depend on build (which is implicit due to 1.79 +# the way client.mk invokes automation/build), but buildsymbols changes the 1.80 +# binaries/libs, and that's what we package/test. 1.81 +automation/pretty-package: automation/buildsymbols 1.82 + 1.83 +# The 'pretty' versions of targets run before the regular ones to avoid 1.84 +# conflicts in writing to the same files. 1.85 +automation/installer: automation/pretty-installer 1.86 +automation/package: automation/pretty-package 1.87 +automation/package-tests: automation/pretty-package-tests 1.88 +automation/l10n-check: automation/pretty-l10n-check 1.89 +automation/update-packaging: automation/pretty-update-packaging 1.90 + 1.91 +automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS)) 1.92 + $(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) 1.93 + 1.94 +# We need the log from make upload to grep it for urls in order to set 1.95 +# properties. 1.96 +AUTOMATION_EXTRA_CMDLINE-upload = 2>&1 | tee $(AUTOMATION_UPLOAD_OUTPUT) 1.97 + 1.98 +# Note: We have to force -j1 here, at least until bug 1036563 is fixed. 1.99 +AUTOMATION_EXTRA_CMDLINE-l10n-check = -j1 1.100 +AUTOMATION_EXTRA_CMDLINE-pretty-l10n-check = -j1 1.101 + 1.102 +# And force -j1 here until bug 1077670 is fixed. 1.103 +AUTOMATION_EXTRA_CMDLINE-package-tests = -j1 1.104 +AUTOMATION_EXTRA_CMDLINE-pretty-package-tests = -j1 1.105 + 1.106 +# The commands only run if the corresponding MOZ_AUTOMATION_* variable is 1.107 +# enabled. This means, for example, if we enable MOZ_AUTOMATION_UPLOAD, then 1.108 +# 'buildsymbols' will only run if MOZ_AUTOMATION_BUILD_SYMBOLS is also set. 1.109 +# However, the target automation/buildsymbols will still be executed in this 1.110 +# case because it is a prerequisite of automation/upload. 1.111 +define automation_commands 1.112 +$(call BUILDSTATUS,TIER_START $1) 1.113 +@$(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1) 1.114 +$(call BUILDSTATUS,TIER_FINISH $1) 1.115 +endef 1.116 + 1.117 +automation/%: 1.118 + $(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call automation_commands,$*))