mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
more cleanup
This commit is contained in:
@@ -8,7 +8,7 @@ import java.util.regex.Pattern;
|
||||
import processing.app.debug.RunnerListener;
|
||||
import processing.app.tools.android.LogEntry.Severity;
|
||||
|
||||
public class AndroidDevice implements AndroidDeviceProperties {
|
||||
class AndroidDevice implements AndroidDeviceProperties {
|
||||
private final AndroidEnvironment env;
|
||||
private final String id;
|
||||
private final Set<Integer> activeProcesses = new HashSet<Integer>();
|
||||
@@ -160,7 +160,7 @@ public class AndroidDevice implements AndroidDeviceProperties {
|
||||
activeProcesses.remove(pid);
|
||||
}
|
||||
|
||||
String[] generateAdbCommand(final String... cmd) {
|
||||
private String[] generateAdbCommand(final String... cmd) {
|
||||
final String[] adbCmd = new String[3 + cmd.length];
|
||||
adbCmd[0] = "adb";
|
||||
adbCmd[1] = "-s";
|
||||
|
||||
@@ -2,7 +2,7 @@ package processing.app.tools.android;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class AndroidSDK {
|
||||
class AndroidSDK {
|
||||
private final File sdk;
|
||||
private final File tools;
|
||||
private final File androidTool;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class AndroidTool implements Tool {
|
||||
.compile("^\"([^\"]*)\"$");
|
||||
|
||||
// make sure that $ANDROID_SDK/tools has been added to the PATH
|
||||
protected boolean checkPath() {
|
||||
private boolean checkPath() {
|
||||
final String canonicalTools;
|
||||
try {
|
||||
canonicalTools = sdk.getTools().getCanonicalPath();
|
||||
@@ -254,7 +254,7 @@ public class AndroidTool implements Tool {
|
||||
return new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
|
||||
}
|
||||
|
||||
protected boolean checkCore() {
|
||||
private boolean checkCore() {
|
||||
// File target = new File(Base.getSketchbookFolder(),
|
||||
// ANDROID_CORE_FILENAME);
|
||||
final File target = getCoreZipFile();
|
||||
|
||||
@@ -20,7 +20,7 @@ import processing.app.debug.RunnerException;
|
||||
import processing.app.preproc.PdePreprocessor;
|
||||
import processing.core.PApplet;
|
||||
|
||||
public class Build {
|
||||
class Build {
|
||||
static SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd.HHmm");
|
||||
|
||||
static String basePackage = "processing.android.test";
|
||||
@@ -388,8 +388,8 @@ public class Build {
|
||||
}
|
||||
}
|
||||
|
||||
void writeAndroidManifest(final File file, final String sketchName,
|
||||
final String className) {
|
||||
private void writeAndroidManifest(final File file, final String sketchName,
|
||||
final String className) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
writer
|
||||
@@ -418,14 +418,14 @@ public class Build {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeBuildProps(final File file) {
|
||||
private void writeBuildProps(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("application-package=" + getPackageName());
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeBuildXML(final File file, final String projectName) {
|
||||
private void writeBuildXML(final File file, final String projectName) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
|
||||
@@ -478,14 +478,14 @@ public class Build {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeDefaultProps(final File file) {
|
||||
private void writeDefaultProps(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("target=Google Inc.:Google APIs:" + sdkVersion);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeLocalProps(final File file) {
|
||||
private void writeLocalProps(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
final String sdkPath = sdk.getSdk().getAbsolutePath();
|
||||
if (Base.isWindows()) {
|
||||
@@ -500,7 +500,7 @@ public class Build {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeRes(final File resFolder, final String className)
|
||||
private void writeRes(final File resFolder, final String className)
|
||||
throws RunnerException {
|
||||
final File layoutFolder = mkdirs(resFolder, "layout");
|
||||
final File layoutFile = new File(layoutFolder, "main.xml");
|
||||
@@ -519,7 +519,7 @@ public class Build {
|
||||
return result;
|
||||
}
|
||||
|
||||
void writeResLayoutMain(final File file) {
|
||||
private void writeResLayoutMain(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
writer
|
||||
@@ -551,7 +551,7 @@ public class Build {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
void writeLibraries(final File libsFolder, final File assetsFolder)
|
||||
private void writeLibraries(final File libsFolder, final File assetsFolder)
|
||||
throws IOException {
|
||||
// Copy any libraries to the 'libs' folder
|
||||
final Sketch sketch = editor.getSketch();
|
||||
@@ -627,7 +627,7 @@ public class Build {
|
||||
* Place quotes around a string to avoid dreadful syntax mess of escaping
|
||||
* quotes near quoted strings. Mmmm!
|
||||
*/
|
||||
static final String q(final String what) {
|
||||
private static final String q(final String what) {
|
||||
return "\"" + what + "\"";
|
||||
}
|
||||
}
|
||||
@@ -25,13 +25,13 @@ import java.io.IOException;
|
||||
import processing.app.Base;
|
||||
import processing.core.PApplet;
|
||||
|
||||
public class Device {
|
||||
class Device {
|
||||
|
||||
private static final ProcessHelper LIST_DEVICES_CMD = new ProcessHelper(
|
||||
"adb",
|
||||
"devices");
|
||||
|
||||
static final String ADB_DEVICES_ERROR = "Received unfamiliar output from “adb devices”.\n"
|
||||
private static final String ADB_DEVICES_ERROR = "Received unfamiliar output from “adb devices”.\n"
|
||||
+ "The device list may have errors.";
|
||||
|
||||
static final int DEFAULT_WIDTH = 320;
|
||||
@@ -68,7 +68,8 @@ public class Device {
|
||||
// /dev/input/event0: 0001 0066 00000000
|
||||
}
|
||||
|
||||
static void sendKey(final String device, final int key) throws IOException {
|
||||
private static void sendKey(final String device, final int key)
|
||||
throws IOException {
|
||||
final String inputDevice = device.startsWith("emulator") ? "/dev/input/event0"
|
||||
: "/dev/input/event3";
|
||||
final String[] cmd = new String[] {
|
||||
|
||||
@@ -24,8 +24,7 @@ class EmulatorController {
|
||||
|
||||
// launch emulator because it's not running yet
|
||||
final String[] cmd = new String[] {
|
||||
"emulator", "-avd", AVD.ECLAIR.name, "-port", portString, "-netfast",
|
||||
"-no-boot-anim" };
|
||||
"emulator", "-avd", AVD.ECLAIR.name, "-port", portString, "-no-boot-anim" };
|
||||
System.err.println("Launching emulator");
|
||||
final Process p = Runtime.getRuntime().exec(cmd);
|
||||
// "emulator: ERROR: the user data image is used by another emulator. aborting"
|
||||
|
||||
@@ -3,7 +3,7 @@ package processing.app.tools.android;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class LogEntry {
|
||||
class LogEntry {
|
||||
public static enum Severity {
|
||||
Verbose(false), Debug(false), Info(false), Warning(true), Error(true), Fatal(
|
||||
true);
|
||||
@@ -13,7 +13,7 @@ public class LogEntry {
|
||||
this.useErrorStream = useErrorStream;
|
||||
}
|
||||
|
||||
static Severity fromChar(final char c) {
|
||||
private static Severity fromChar(final char c) {
|
||||
if (c == 'V') {
|
||||
return Verbose;
|
||||
} else if (c == 'D') {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package processing.app.tools.android;
|
||||
|
||||
public interface ProcessOutputListener {
|
||||
public void handleStdout(final String line);
|
||||
|
||||
public void handleStderr(final String line);
|
||||
}
|
||||
@@ -82,11 +82,11 @@ class StreamPump implements Runnable {
|
||||
private class WriterLineProcessor implements LineProcessor {
|
||||
private final PrintWriter writer;
|
||||
|
||||
WriterLineProcessor(final OutputStream out) {
|
||||
private WriterLineProcessor(final OutputStream out) {
|
||||
this.writer = new PrintWriter(out, true);
|
||||
}
|
||||
|
||||
WriterLineProcessor(final Writer writer) {
|
||||
private WriterLineProcessor(final Writer writer) {
|
||||
this.writer = new PrintWriter(writer, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user