use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class GradleRunner method build.
public void build() {
System.out.println("Building gradle project...");
RunResult result = RunUtils.execute(generateCommandLine("build"));
OutputUtils.checkResult(result);
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class Emulator method stopRedundantEmulators.
private void stopRedundantEmulators(PathManager pathManager) {
GeneralCommandLine commandLineForListOfDevices = createAdbCommand();
commandLineForListOfDevices.addParameter("devices");
RunResult runResult = RunUtils.execute(commandLineForListOfDevices);
OutputUtils.checkResult(runResult);
Matcher matcher = EMULATOR_PATTERN.matcher(runResult.getOutput());
boolean isDdmsStopped = false;
while (matcher.find()) {
System.out.println("Stopping redundant emulator...");
GeneralCommandLine commandLineForStoppingEmulators = new GeneralCommandLine();
if (SystemInfo.isWindows) {
commandLineForStoppingEmulators.setExePath("taskkill");
commandLineForStoppingEmulators.addParameter("/F");
commandLineForStoppingEmulators.addParameter("/IM");
commandLineForStoppingEmulators.addParameter("emulator-arm.exe");
OutputUtils.checkResult(RunUtils.execute(commandLineForStoppingEmulators));
break;
} else {
if (!isDdmsStopped && SystemInfo.isUnix) {
stopEmulator();
stopDdmsProcess();
isDdmsStopped = true;
}
commandLineForStoppingEmulators.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/adb");
commandLineForStoppingEmulators.addParameter("-s");
commandLineForStoppingEmulators.addParameter(matcher.group());
commandLineForStoppingEmulators.addParameter("emu");
commandLineForStoppingEmulators.addParameter("kill");
OutputUtils.checkResult(RunUtils.execute(commandLineForStoppingEmulators));
}
}
OutputUtils.checkResult(RunUtils.execute(commandLineForListOfDevices));
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class Emulator method runTestsViaAdb.
public String runTestsViaAdb() {
System.out.println("Running tests via adb...");
GeneralCommandLine adbCommand = createAdbCommand();
//adb shell am instrument -w -r org.jetbrains.kotlin.android.tests/android.test.InstrumentationTestRunner
adbCommand.addParameters("shell", "am", "instrument", "-w", "-r", "org.jetbrains.kotlin.android.tests/android.test.InstrumentationTestRunner");
RunResult execute = RunUtils.execute(adbCommand);
return execute.getOutput();
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class GradleRunner method clean.
public void clean() {
System.out.println("Building gradle project...");
RunResult result = RunUtils.execute(generateCommandLine("clean"));
OutputUtils.checkResult(result);
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class AntRunner method compileSources.
public void compileSources() {
System.out.println("Compiling sources...");
RunResult result = RunUtils.execute(generateCommandLine("debug"));
OutputUtils.checkResult(result);
}
Aggregations