From 71a8cc928a541f312d3ad376cdbc52b68d3c64ec Mon Sep 17 00:00:00 2001 From: Christopher Orr Date: Mon, 4 Dec 2017 00:48:37 +0100 Subject: [PATCH] Warn if snapshots are enabled but not supported by the SDK Tools. Supposedly snapshots (nowadays resurrected as "Quick Boot") should work, but I haven't managed to get them to work via the command-line tools, so until we figure that out, they'll remain disabled for recent versions of the SDK Tools. --- .../hudson/plugins/android_emulator/AndroidEmulator.java | 5 +++++ .../hudson/plugins/android_emulator/Messages.properties | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java b/src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java index dc84b851..91ace298 100644 --- a/src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java +++ b/src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java @@ -350,6 +350,11 @@ private Environment doSetUp(final AbstractBuild build, final Launcher laun Proc adbStart2 = emu.getToolProcStarter(adbStartCmd).stdout(logger).stderr(logger).start(); adbStart2.joinWithTimeout(5L, TimeUnit.SECONDS, listener); + // Show warning about snapshots being enabled, but not supported + if (useSnapshots && !androidSdk.supportsSnapshots()) { + log(logger, Messages.SNAPSHOTS_NOT_SUPPORTED()); + } + // Determine whether we need to create the first snapshot final SnapshotState snapshotState; if (useSnapshots && androidSdk.supportsSnapshots()) { diff --git a/src/main/resources/hudson/plugins/android_emulator/Messages.properties b/src/main/resources/hudson/plugins/android_emulator/Messages.properties index aa939800..5cf60eec 100644 --- a/src/main/resources/hudson/plugins/android_emulator/Messages.properties +++ b/src/main/resources/hudson/plugins/android_emulator/Messages.properties @@ -77,6 +77,7 @@ COULD_NOT_CREATE_EMULATOR=Could not create Android emulator: {0} SETTING_HARDWARE_PROPERTIES=Setting hardware properties: DELAYING_START_UP=Waiting {0} seconds before starting emulator... STARTING_EMULATOR=Starting Android emulator +SNAPSHOTS_NOT_SUPPORTED=Snapshots are enabled, but cannot be used as they are not supported by the current SDK Tools STARTING_EMULATOR_FROM_SNAPSHOT=Starting Android emulator from snapshot STARTING_EMULATOR_SNAPSHOT_INIT=Starting Android emulator and creating initial snapshot ERASING_EXISTING_EMULATOR_DATA=Erasing existing emulator data...