mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Rename Android to AndroidTool to better reflect its purpose, preparing to create a non-processing-related Android stack
This commit is contained in:
+1
-1
@@ -40,7 +40,7 @@ import processing.core.PApplet;
|
||||
// http://dl.google.com/android/android-sdk_r3-mac.zip
|
||||
// http://dl.google.com/android/repository/tools_r03-macosx.zip
|
||||
|
||||
public class Android implements Tool {
|
||||
public class AndroidTool implements Tool {
|
||||
static String sdkPath;
|
||||
|
||||
static String toolName = "android";
|
||||
@@ -160,7 +160,8 @@ public class Build {
|
||||
final File libsFolder = mkdirs(androidFolder, "libs");
|
||||
final File assetsFolder = mkdirs(androidFolder, "assets");
|
||||
|
||||
final InputStream input = PApplet.createInput(Android.getCoreZipFile());
|
||||
final InputStream input = PApplet.createInput(AndroidTool
|
||||
.getCoreZipFile());
|
||||
PApplet.saveStream(new File(libsFolder, "processing-core.jar"), input);
|
||||
|
||||
try {
|
||||
@@ -493,9 +494,9 @@ public class Build {
|
||||
// Windows needs backslashes escaped, or it will also accept forward
|
||||
// slashes in the build file. We're using the forward slashes since this
|
||||
// path gets concatenated with a lot of others that use forwards anyway.
|
||||
writer.println("sdk.dir=" + Android.sdkPath.replace('\\', '/'));
|
||||
writer.println("sdk.dir=" + AndroidTool.sdkPath.replace('\\', '/'));
|
||||
} else {
|
||||
writer.println("sdk.dir=" + Android.sdkPath);
|
||||
writer.println("sdk.dir=" + AndroidTool.sdkPath);
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
|
||||
@@ -71,13 +71,6 @@ public class Device {
|
||||
|
||||
static boolean checkDefaults() {
|
||||
try {
|
||||
// if (!avdDonut.exists()) {
|
||||
// if (!avdDonut.create()) {
|
||||
// Base.showWarning("Android Error",
|
||||
// "An error occurred while running “android create avd”\n" +
|
||||
// "to set up the default Android emulator.", null);
|
||||
// }
|
||||
// }
|
||||
if (!avdEclair.exists()) {
|
||||
if (!avdEclair.create()) {
|
||||
Base.showWarning("Android Error", AVD_CREATE_ERROR, null);
|
||||
@@ -92,7 +85,8 @@ public class Device {
|
||||
}
|
||||
|
||||
protected boolean exists() throws IOException {
|
||||
final ProcessHelper p = new ProcessHelper(Android.toolName, "list", "avds");
|
||||
final ProcessHelper p = new ProcessHelper(AndroidTool.toolName, "list",
|
||||
"avds");
|
||||
try {
|
||||
if (p.execute(true) == 0) {
|
||||
for (final String line : p.getStdout().split("\n")) {
|
||||
@@ -113,7 +107,7 @@ public class Device {
|
||||
}
|
||||
|
||||
protected boolean create() throws IOException {
|
||||
final ProcessHelper p = new ProcessHelper(Android.toolName, "create",
|
||||
final ProcessHelper p = new ProcessHelper(AndroidTool.toolName, "create",
|
||||
"avd", "-n", name, "-t", target,
|
||||
"-c", "64M");
|
||||
|
||||
@@ -240,7 +234,7 @@ public class Device {
|
||||
startIndex++;
|
||||
String[] devices = new String[lines.length - startIndex];
|
||||
int deviceIndex = 0;
|
||||
for (int i = startIndex; i < lines.length - 1; i++) {
|
||||
for (int i = startIndex; i < lines.length; i++) {
|
||||
final String line = lines[i];
|
||||
final int tab = line.indexOf('\t');
|
||||
if (tab != -1) {
|
||||
|
||||
@@ -39,11 +39,11 @@ public class Reset implements Tool {
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (Android.sdkPath == null) {
|
||||
if (AndroidTool.sdkPath == null) {
|
||||
JOptionPane.showMessageDialog(editor, "Before using the reset command, "
|
||||
+ "you must first enable Android Mode.");
|
||||
} else {
|
||||
Android.resetServer(editor);
|
||||
AndroidTool.resetServer(editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user