mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Move ProcessHelper and its friends to the processing-app, so they can be used by the unit tests
This commit is contained in:
@@ -4,6 +4,8 @@ import java.io.IOException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import processing.app.Base;
|
||||
import processing.util.exec.ProcessHelper;
|
||||
import processing.util.exec.ProcessResult;
|
||||
|
||||
public class AVD {
|
||||
// Tempting to switch to WVGA854 (854x480), the same aspect ratio
|
||||
|
||||
@@ -10,6 +10,10 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import processing.app.debug.RunnerListener;
|
||||
import processing.app.tools.android.LogEntry.Severity;
|
||||
import processing.util.exec.LineProcessor;
|
||||
import processing.util.exec.ProcessRegistry;
|
||||
import processing.util.exec.ProcessResult;
|
||||
import processing.util.exec.StreamPump;
|
||||
|
||||
class AndroidDevice implements AndroidDeviceProperties {
|
||||
private final AndroidEnvironment env;
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import processing.app.tools.android.EmulatorController.State;
|
||||
import processing.util.exec.ProcessResult;
|
||||
|
||||
/**
|
||||
* <pre> AndroidEnvironment env = AndroidEnvironment.getInstance();
|
||||
|
||||
@@ -7,6 +7,8 @@ import javax.swing.JOptionPane;
|
||||
import processing.app.Base;
|
||||
import processing.app.Platform;
|
||||
import processing.app.Preferences;
|
||||
import processing.util.exec.ProcessHelper;
|
||||
import processing.util.exec.ProcessResult;
|
||||
|
||||
class AndroidSDK {
|
||||
private final File sdk;
|
||||
|
||||
@@ -3,6 +3,8 @@ package processing.app.tools.android;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import processing.app.Preferences;
|
||||
import processing.util.exec.ProcessRegistry;
|
||||
import processing.util.exec.StreamPump;
|
||||
|
||||
class EmulatorController {
|
||||
public static enum State {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package processing.app.tools.android;
|
||||
|
||||
interface LineProcessor {
|
||||
void processLine(final String line);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package processing.util.exec;
|
||||
|
||||
public interface LineProcessor {
|
||||
void processLine(final String line);
|
||||
}
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.tools.android;
|
||||
package processing.util.exec;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
@@ -28,7 +28,7 @@ import java.io.StringWriter;
|
||||
*
|
||||
* @author Jonathan Feinberg <jdf@pobox.com>
|
||||
*/
|
||||
class ProcessHelper {
|
||||
public class ProcessHelper {
|
||||
private final String[] cmd;
|
||||
|
||||
public ProcessHelper(final String... cmd) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package processing.app.tools.android;
|
||||
package processing.util.exec;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package processing.app.tools.android;
|
||||
package processing.util.exec;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
+2
-5
@@ -1,7 +1,4 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package processing.app.tools.android;
|
||||
package processing.util.exec;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
@@ -26,7 +23,7 @@ import java.util.concurrent.ThreadFactory;
|
||||
* @author Jonathan Feinberg <jdf@pobox.com>
|
||||
*
|
||||
*/
|
||||
class StreamPump implements Runnable {
|
||||
public class StreamPump implements Runnable {
|
||||
private static final ExecutorService threads = Executors
|
||||
.newCachedThreadPool(new ThreadFactory() {
|
||||
public Thread newThread(final Runnable r) {
|
||||
Reference in New Issue
Block a user