mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix attributions
This commit is contained in:
@@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* AndroidDevice n1 = env.getHardware();</pre>
|
||||
*
|
||||
* @author Jonathan Feinberg <jdf@us.ibm.com>
|
||||
* @author Jonathan Feinberg <jdf@pobox.com>
|
||||
*
|
||||
*/
|
||||
public class AndroidEnvironment implements AndroidEnvironmentProperties {
|
||||
|
||||
@@ -21,7 +21,6 @@ package processing.app.tools.android;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import processing.core.PApplet;
|
||||
|
||||
/**
|
||||
* Class to handle calling Runtime.exec() and stuffing output and error streams
|
||||
@@ -37,7 +36,14 @@ class ProcessHelper {
|
||||
}
|
||||
|
||||
public String getCommand() {
|
||||
return PApplet.join(cmd, " ");
|
||||
final StringBuffer buffer = new StringBuffer();
|
||||
for (int i = 0; i < cmd.length; i++) {
|
||||
if (i != 0) {
|
||||
buffer.append(" ");
|
||||
}
|
||||
buffer.append(cmd[i]);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,6 +82,8 @@ class ProcessHelper {
|
||||
final StringWriter errWriter = new StringWriter();
|
||||
final long startTime = System.currentTimeMillis();
|
||||
|
||||
final String prettyCommand = getCommand();
|
||||
// System.err.println("ProcessHelper: begin " + prettyCommand);
|
||||
final Process process = Runtime.getRuntime().exec(cmd);
|
||||
|
||||
final StreamPump outpump = new StreamPump(process.getInputStream())
|
||||
@@ -92,11 +100,13 @@ class ProcessHelper {
|
||||
}
|
||||
errpump.start();
|
||||
try {
|
||||
return new ProcessResult(getCommand(), process.waitFor(), outWriter
|
||||
.toString(), errWriter.toString(), System.currentTimeMillis()
|
||||
- startTime);
|
||||
final int result = process.waitFor();
|
||||
final long time = System.currentTimeMillis() - startTime;
|
||||
// System.err.println("ProcessHelper: " + time + "ms: " + prettyCommand);
|
||||
return new ProcessResult(prettyCommand, result, outWriter.toString(),
|
||||
errWriter.toString(), time);
|
||||
} catch (final InterruptedException e) {
|
||||
System.err.println("Interrupted: " + getCommand());
|
||||
System.err.println("Interrupted: " + prettyCommand);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jonathan Feinberg <jdf@us.ibm.com>
|
||||
* @author Jonathan Feinberg <jdf@pobox.com>
|
||||
*
|
||||
*/
|
||||
class SketchLogCatter implements LineProcessor {
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.concurrent.ThreadFactory;
|
||||
* text, and not for arbitrary binary cruft.</b> It's handy for reading
|
||||
* the output of processes that emit textual data, for example.
|
||||
*
|
||||
* @author Jonathan Feinberg <jdf@us.ibm.com>
|
||||
* @author Jonathan Feinberg <jdf@pobox.com>
|
||||
*
|
||||
*/
|
||||
class StreamPump implements Runnable {
|
||||
|
||||
Reference in New Issue
Block a user