more android tweaks for new sdk, things now working again

This commit is contained in:
benfry
2009-12-06 18:54:51 +00:00
parent b762d4c2b5
commit d9499ce009
4 changed files with 51 additions and 12 deletions

View File

@@ -5,6 +5,9 @@ X why aren't mouse drag events coming through?
X http://dev.processing.org/bugs/show_bug.cgi?id=1382
X "taskdef class com.android.ant.SetupTask cannot be found" on Linux
X http://dev.processing.org/bugs/show_bug.cgi?id=1407
X update to r4 of android sdk
X this release will not run on r3 or earlier
X download core.zip from local files
P1 this is embarrassing, need to fix ASAP
P2 need to fix before beta release

View File

@@ -65,7 +65,7 @@ public class Android implements Tool {
static final String ADB_SOCKET_PORT = "29892";
static final String ANDROID_CORE_URL =
"http://dev.processing.org/android/core.zip";
"http://dev.processing.org/processing/android/core.zip";
static final String ANDROID_CORE_FILENAME =
"processing-android-core.zip";
@@ -195,10 +195,35 @@ public class Android implements Tool {
*/
return true;
}
static protected File getCoreZipFile() {
// for debugging only, check to see if this is an svn checkout
File debugFile = new File("../../../android/core.zip");
if (!debugFile.exists() && Base.isMacOS()) {
// current path might be inside Processing.app, so need to go much higher
debugFile = new File("../../../../../../../android/core.zip");
}
if (debugFile.exists()) {
System.out.println("Using version of core.zip from local SVN checkout.");
return debugFile;
// } else {
// //System.out.println("no core.zip at " + debugFile.getAbsolutePath());
// try {
// System.out.println("no core.zip at " + debugFile.getCanonicalPath());
// } catch (IOException e) {
// e.printStackTrace();
// }
}
// otherwise do the usual
return new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
}
protected boolean checkCore() {
File target = new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
//File target = new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
File target = getCoreZipFile();
if (!target.exists()) {
try {
URL url = new URL(ANDROID_CORE_URL);
@@ -756,7 +781,7 @@ public class Android implements Tool {
System.out.println("creating runner");
//System.out.println("editor from Android is " + editor);
AndroidRunner ar = new AndroidRunner(editor, editor.getSketch());
System.out.println("launching vm");
// System.out.println("launching vm");
return ar.launch(ADB_SOCKET_PORT);
//System.out.println("vm launched");

View File

@@ -422,11 +422,16 @@ public class Build {
writer.println(" <property file=\"default.properties\"/>");
writer.println(" <path id=\"android.antlibs\">");
writer.println(" <pathelement path=\"${sdk-location}/tools/lib/anttasks.jar\" />");
writer.println(" <pathelement path=\"${sdk-location}/tools/lib/sdklib.jar\" />");
writer.println(" <pathelement path=\"${sdk-location}/tools/lib/androidprefs.jar\" />");
writer.println(" <pathelement path=\"${sdk-location}/tools/lib/apkbuilder.jar\" />");
writer.println(" <pathelement path=\"${sdk-location}/tools/lib/jarutils.jar\" />");
// writer.println(" <pathelement path=\"${sdk-location}/tools/lib/anttasks.jar\" />");
// writer.println(" <pathelement path=\"${sdk-location}/tools/lib/sdklib.jar\" />");
// writer.println(" <pathelement path=\"${sdk-location}/tools/lib/androidprefs.jar\" />");
// writer.println(" <pathelement path=\"${sdk-location}/tools/lib/apkbuilder.jar\" />");
// writer.println(" <pathelement path=\"${sdk-location}/tools/lib/jarutils.jar\" />");
writer.println(" <pathelement path=\"${sdk.dir}/tools/lib/anttasks.jar\" />");
writer.println(" <pathelement path=\"${sdk.dir}/tools/lib/sdklib.jar\" />");
writer.println(" <pathelement path=\"${sdk.dir}/tools/lib/androidprefs.jar\" />");
writer.println(" <pathelement path=\"${sdk.dir}/tools/lib/apkbuilder.jar\" />");
writer.println(" <pathelement path=\"${sdk.dir}/tools/lib/jarutils.jar\" />");
writer.println(" </path>");
writer.println(" <taskdef name=\"setup\"");
@@ -466,7 +471,8 @@ public class Build {
void writeLocalProps(File file) {
PrintWriter writer = PApplet.createWriter(file);
writer.println("sdk-location=" + Android.sdkPath);
//writer.println("sdk-location=" + Android.sdkPath); // r3 of the sdk
writer.println("sdk.dir=" + Android.sdkPath); // r4 of the sdk
writer.flush();
writer.close();
}
@@ -519,9 +525,7 @@ public class Build {
void writeLibs(File libsFolder) {
libsFolder.mkdirs();
//InputStream input = getClass().getResourceAsStream("processing-core.zip");
File file =
new File(Base.getSketchbookFolder(), Android.ANDROID_CORE_FILENAME);
InputStream input = PApplet.createInput(file);
InputStream input = PApplet.createInput(Android.getCoreZipFile());
PApplet.saveStream(new File(libsFolder, "processing-core.jar"), input);
}

View File

@@ -1,6 +1,11 @@
0174 pde (private)
X fix ant.jar/ant-launcher.jar error in the windows/linux build scripts
X http://dev.processing.org/bugs/show_bug.cgi?id=1403
X replace com.apple.eawt.Application invocation to deal with deprecation
X this may cause problems with older releases (or on 10.4 or 10.5), not sure
X application = new com.apple.eawt.Application();
X application = com.apple.eawt.Application.getApplication();
_ move build scripts to something better like ant
_ too much to maintain the multiple versions, too much code
@@ -10,6 +15,8 @@ _ this would also mean requiring a java installation for building
_ so may as well move the jdk stuff outside of the build
_ http://ant.apache.org/manual/CoreTasks/get.html
The com.apple.eawt.Application now has a setDefaultMenuBar(JMenuBar) method that sets a default menu bar when no other Frames are open.
_ lack of java.awt.Polygon import breaks the yellowtail example
_ just add a simple poly class? or don't use a poly?