Android module: create emulator in tmp folder, catch exceptions during stopping emulator
This commit is contained in:
+7
-1
@@ -203,7 +203,13 @@ public class CodegenTestsOnAndroidRunner {
|
||||
return antRunner.runTestsOnEmulator();
|
||||
}
|
||||
finally {
|
||||
emulator.stopEmulator();
|
||||
try {
|
||||
emulator.stopEmulator();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.err.println("Exception during stopping emulator:");
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.jet.compiler;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Natalia.Ukhorskaya
|
||||
*/
|
||||
@@ -34,6 +36,12 @@ public class PathManager {
|
||||
return getAndroidSdkRoot() + "/platforms";
|
||||
}
|
||||
|
||||
public String getAndroidEmulatorRoot() {
|
||||
String androidEmulatorRoot = tmpFolder + "/emulator";
|
||||
new File(androidEmulatorRoot).mkdirs();
|
||||
return androidEmulatorRoot;
|
||||
}
|
||||
|
||||
public String getPlatformToolsFolderInAndroidSdk() {
|
||||
return getAndroidSdkRoot() + "/platform-tools";
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ public class Emulator {
|
||||
commandLine.addParameter("--force");
|
||||
commandLine.addParameter("-n");
|
||||
commandLine.addParameter("my_avd");
|
||||
commandLine.addParameter("-p");
|
||||
commandLine.addParameter(pathManager.getAndroidEmulatorRoot());
|
||||
commandLine.addParameter("-t");
|
||||
commandLine.addParameter("1");
|
||||
return commandLine;
|
||||
|
||||
Reference in New Issue
Block a user