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();
|
return antRunner.runTestsOnEmulator();
|
||||||
}
|
}
|
||||||
finally {
|
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;
|
package org.jetbrains.jet.compiler;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Natalia.Ukhorskaya
|
* @author Natalia.Ukhorskaya
|
||||||
*/
|
*/
|
||||||
@@ -34,6 +36,12 @@ public class PathManager {
|
|||||||
return getAndroidSdkRoot() + "/platforms";
|
return getAndroidSdkRoot() + "/platforms";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAndroidEmulatorRoot() {
|
||||||
|
String androidEmulatorRoot = tmpFolder + "/emulator";
|
||||||
|
new File(androidEmulatorRoot).mkdirs();
|
||||||
|
return androidEmulatorRoot;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPlatformToolsFolderInAndroidSdk() {
|
public String getPlatformToolsFolderInAndroidSdk() {
|
||||||
return getAndroidSdkRoot() + "/platform-tools";
|
return getAndroidSdkRoot() + "/platform-tools";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ public class Emulator {
|
|||||||
commandLine.addParameter("--force");
|
commandLine.addParameter("--force");
|
||||||
commandLine.addParameter("-n");
|
commandLine.addParameter("-n");
|
||||||
commandLine.addParameter("my_avd");
|
commandLine.addParameter("my_avd");
|
||||||
|
commandLine.addParameter("-p");
|
||||||
|
commandLine.addParameter(pathManager.getAndroidEmulatorRoot());
|
||||||
commandLine.addParameter("-t");
|
commandLine.addParameter("-t");
|
||||||
commandLine.addParameter("1");
|
commandLine.addParameter("1");
|
||||||
return commandLine;
|
return commandLine;
|
||||||
|
|||||||
Reference in New Issue
Block a user