@Extension public static AdministrativeMonitor init() { String migrationTarget = SystemProperties.getString(ZFSInstaller.class.getName() + ".migrate"); if(migrationTarget!=null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if(migrate(listener,migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. Functions.printStackTrace(e, listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if(zi.isActivated()) return zi; return null; }
@Extension public static AdministrativeMonitor init() { String migrationTarget = System.getProperty(ZFSInstaller.class.getName() + ".migrate"); if (migrationTarget != null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if (migrate(listener, migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. e.printStackTrace(listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if (zi.isActivated()) { return zi; } return null; }
@Extension public static AdministrativeMonitor init() { String migrationTarget = System.getProperty(ZFSInstaller.class.getName() + ".migrate"); if(migrationTarget!=null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if(migrate(listener,migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. e.printStackTrace(listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if(zi.isActivated()) return zi; return null; }
out = listener.getLogger(); } else { out = new ForkOutputStream(out, listener.getLogger());
@Extension public static AdministrativeMonitor init() { String migrationTarget = System.getProperty(ZFSInstaller.class.getName() + ".migrate"); if(migrationTarget!=null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if(migrate(listener,migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. e.printStackTrace(listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if(zi.isActivated()) return zi; return null; }
@Extension public static AdministrativeMonitor init() { String migrationTarget = System.getProperty(ZFSInstaller.class.getName() + ".migrate"); if(migrationTarget!=null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if(migrate(listener,migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. e.printStackTrace(listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if(zi.isActivated()) return zi; return null; }
/** * Uninstalls the given Android package ID from the given Android device. * * @param build The build for which we should uninstall the package. * @param launcher The launcher for the remote node. * @param logger Where log output should be redirected to. * @param androidSdk The Android SDK to use. * @param deviceIdentifier The device from which the package should be removed. * @param packageId The ID of the Android package to remove from the given device. * @return {@code true} iff uninstallation completed successfully. * @throws IOException If execution failed. * @throws InterruptedException If execution failed. */ @SuppressFBWarnings("DM_DEFAULT_ENCODING") protected static boolean uninstallApk(AbstractBuild<?, ?> build, Launcher launcher, PrintStream logger, AndroidSdk androidSdk, String deviceIdentifier, String packageId) throws IOException, InterruptedException { AndroidEmulator.log(logger, Messages.UNINSTALLING_APK(packageId)); ByteArrayOutputStream stdout = new ByteArrayOutputStream(); ForkOutputStream forkStream = new ForkOutputStream(logger, stdout); final SdkCliCommand adbCmd = SdkCliCommandFactory.getCommandsForSdk(androidSdk). getAdbUninstallPackageCommand(deviceIdentifier, packageId); Utils.runAndroidTool(launcher, build.getEnvironment(TaskListener.NULL), forkStream, logger, androidSdk, adbCmd, null, UNINSTALL_TIMEOUT); // The package manager simply returns "Success" or "Failure" on stdout return stdout.toString().contains("Success"); }
@Extension public static AdministrativeMonitor init() { String migrationTarget = SystemProperties.getString(ZFSInstaller.class.getName() + ".migrate"); if(migrationTarget!=null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamTaskListener listener = new StreamTaskListener(new ForkOutputStream(System.out, out)); try { if(migrate(listener,migrationTarget)) { // completed successfully return new MigrationCompleteNotice(); } } catch (Exception e) { // if we let any exception from here, it will prevent Hudson from starting. Functions.printStackTrace(e, listener.error("Migration failed")); } // migration failed return new MigrationFailedNotice(out); } // install the monitor if applicable ZFSInstaller zi = new ZFSInstaller(); if(zi.isActivated()) return zi; return null; }
protected @Override ExecuteStreamHandler getExecuteStreamHandler(InputStream input) { return handler = new RedirectingStreamHandler( // stdout goes to the changelog parser, // but we also send this to Ant logger so that we can see it at sufficient debug level new ForkOutputStream(new RedirectingOutputStream(parser), new LogOutputStream(this, Project.MSG_VERBOSE)), // stderr goes to the logger, too new LogOutputStream(this, Project.MSG_WARN), input); }
protected @Override ExecuteStreamHandler getExecuteStreamHandler(InputStream input) { return handler = new RedirectingStreamHandler( // stdout goes to the changelog parser, // but we also send this to Ant logger so that we can see it at sufficient debug level new ForkOutputStream(new RedirectingOutputStream(parser), new LogOutputStream(this, Project.MSG_VERBOSE)), // stderr goes to the logger, too new LogOutputStream(this, Project.MSG_WARN), input); }
int r = hg.launch(args).stdout(new ForkOutputStream(os, errorLog)).pwd(repository).join(); if(r!=0) { Util.copyStream(new ByteArrayInputStream(errorLog.toByteArray()), listener.getLogger());
new ForkOutputStream(baos, listener.getLogger()))) { return true;
new ForkOutputStream(baos, listener.getLogger()))) { return null; new ForkOutputStream(baos, listener.getLogger()))) { return null;
int r = launch(launcher).cmds(args).envs(env).stdout(new ForkOutputStream(os, errorLog)).pwd(repository).join(); if(r!=0) { Util.copyStream(new ByteArrayInputStream(errorLog.toByteArray()), listener.getLogger());
new ForkOutputStream(baos, listener.getLogger()))) { return null;
ForkOutputStream forkStream = new ForkOutputStream(logger, stdout); final SdkCliCommand sdkInstallApkCmd = SdkCliCommandFactory.getCommandsForSdk(androidSdk) .getAdbInstallPackageCommand(deviceIdentifier, apkPath.getName());
ForkOutputStream emulatorLogger = new ForkOutputStream(logger, emulatorOutput);