Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
In general Launcher may not be serializable.
By the time the closure is executing, you are already on the target
platform, so you'd be better off just asking your JVM
(File.separatorChar, etc) about the current platform.
  • Loading branch information
kohsuke committed Sep 17, 2012
1 parent e87ee60 commit a531f90
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -3,6 +3,7 @@
import static hudson.plugins.android_emulator.AndroidEmulator.log;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
import hudson.Functions;
import hudson.Launcher;
import hudson.model.BuildListener;
import hudson.model.Computer;
Expand Down Expand Up @@ -323,11 +324,11 @@ private static String getPlatformForEmulator(Launcher launcher, final EmulatorCo
* @param emuConfig The emulator whose target platform we want to determine.
* @return The platform identifier.
*/
private static String getPlatformFromExistingEmulator(final Launcher launcher,
private static String getPlatformFromExistingEmulator(Launcher launcher,
final EmulatorConfig emuConfig) throws IOException, InterruptedException {
return launcher.getChannel().call(new Callable<String, IOException>() {
public String call() throws IOException {
File metadataFile = emuConfig.getAvdMetadataFile(launcher.isUnix());
File metadataFile = emuConfig.getAvdMetadataFile(!Functions.isWindows());
Map<String, String> metadata = Utils.parseConfigFile(metadataFile);
return metadata.get("target");
}
Expand Down

0 comments on commit a531f90

Please sign in to comment.