зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1274497 - Avoid running adb every time we run make on Android builds. r=gps
As seen in bug 1274273, the build system is running adb uselessly. Moreover, on automation, adb doesn't even run, because it requires a more recent glibc than available, adding confusing error messages to the logs.
This commit is contained in:
Родитель
2d6fb1ed77
Коммит
b47ba46ecf
|
@ -18,19 +18,22 @@ ifneq ($(ANDROID_SERIAL),)
|
||||||
export ANDROID_SERIAL
|
export ANDROID_SERIAL
|
||||||
else
|
else
|
||||||
# Determine if there's more than one device connected
|
# Determine if there's more than one device connected
|
||||||
android_devices=$(filter device,$(shell $(ADB) devices))
|
android_devices=$(words $(filter device,$(shell $(ADB) devices)))
|
||||||
ifeq ($(android_devices),)
|
define no_device
|
||||||
install::
|
|
||||||
@echo 'No devices are connected. Connect a device or start an emulator.'
|
@echo 'No devices are connected. Connect a device or start an emulator.'
|
||||||
@exit 1
|
@exit 1
|
||||||
else
|
endef
|
||||||
ifneq ($(android_devices),device)
|
define multiple_devices
|
||||||
install::
|
|
||||||
@echo 'Multiple devices are connected. Define ANDROID_SERIAL to specify the install target.'
|
@echo 'Multiple devices are connected. Define ANDROID_SERIAL to specify the install target.'
|
||||||
$(ADB) devices
|
$(ADB) devices
|
||||||
@exit 1
|
@exit 1
|
||||||
endif
|
endef
|
||||||
endif
|
|
||||||
|
install::
|
||||||
|
@# Use foreach to avoid running adb multiple times here
|
||||||
|
$(foreach val,$(android_devices),\
|
||||||
|
$(if $(filter 0,$(val)),$(no_device),\
|
||||||
|
$(if $(filter-out 1,$(val)),$(multiple_devices))))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install::
|
install::
|
||||||
|
|
Загрузка…
Ссылка в новой задаче