mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
updating for newer android sdk tools
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
0202 android
|
||||
X fix problem with export menu, keys, toolbar being different
|
||||
X change default package name a bit
|
||||
X switch to SDK 8 (Android 2.2) as the minimum
|
||||
X update the project files for Android SDK Tools Revision 15 (now required)
|
||||
|
||||
_ launching on emulator not working well
|
||||
_ Latest android sdk breaks processing - new build.xml output required
|
||||
_ http://code.google.com/p/processing/issues/detail?id=876
|
||||
|
||||
_ if a sketch asks for android mode but it's not available
|
||||
_ (after a double-click)
|
||||
|
||||
@@ -33,8 +33,8 @@ import processing.mode.java.JavaBuild;
|
||||
|
||||
|
||||
class AndroidBuild extends JavaBuild {
|
||||
static final String basePackage = "processing.android.test";
|
||||
static final String sdkVersion = "7";
|
||||
static final String basePackage = "processing.changethispackage.beforesubmittingtothemarket";
|
||||
static final String sdkVersion = "8";
|
||||
static final String sdkTarget = "android-" + sdkVersion;
|
||||
|
||||
// private final Editor editor;
|
||||
@@ -129,13 +129,17 @@ class AndroidBuild extends JavaBuild {
|
||||
File tempManifest = new File(tmpFolder, "AndroidManifest.xml");
|
||||
manifest.writeBuild(tempManifest, sketchClassName, target.equals("debug"));
|
||||
|
||||
writeBuildProps(new File(tmpFolder, "build.properties"));
|
||||
writeAntProps(new File(tmpFolder, "ant.properties"));
|
||||
buildFile = new File(tmpFolder, "build.xml");
|
||||
writeBuildXML(buildFile, sketch.getName());
|
||||
writeDefaultProps(new File(tmpFolder, "default.properties"));
|
||||
writeProjectProps(new File(tmpFolder, "project.properties"));
|
||||
writeLocalProps(new File(tmpFolder, "local.properties"));
|
||||
writeRes(new File(tmpFolder, "res"), sketchClassName);
|
||||
|
||||
File proguardSrc = new File(sdk.getSdkFolder(), "tools/lib/proguard.cfg");
|
||||
File proguardDst = new File(tmpFolder, "proguard.cfg");
|
||||
Base.copyFile(proguardSrc, proguardDst);
|
||||
|
||||
final File libsFolder = mkdirs(tmpFolder, "libs");
|
||||
final File assetsFolder = mkdirs(tmpFolder, "assets");
|
||||
|
||||
@@ -242,14 +246,19 @@ class AndroidBuild extends JavaBuild {
|
||||
|
||||
|
||||
public File exportProject() throws IOException, SketchException {
|
||||
File projectFolder = build("debug");
|
||||
if (projectFolder == null) {
|
||||
return null;
|
||||
// File projectFolder = build("debug");
|
||||
// if (projectFolder == null) {
|
||||
// return null;
|
||||
// }
|
||||
// this will set debuggable to true in the .xml file
|
||||
target = "debug";
|
||||
File projectFolder = createProject();
|
||||
if (projectFolder != null) {
|
||||
File exportFolder = createExportFolder();
|
||||
Base.copyDir(projectFolder, exportFolder);
|
||||
return exportFolder;
|
||||
}
|
||||
|
||||
File exportFolder = createExportFolder();
|
||||
Base.copyDir(projectFolder, exportFolder);
|
||||
return exportFolder;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +393,7 @@ class AndroidBuild extends JavaBuild {
|
||||
}
|
||||
|
||||
|
||||
private void writeBuildProps(final File file) {
|
||||
private void writeAntProps(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("application-package=" + getPackageName());
|
||||
writer.flush();
|
||||
@@ -394,26 +403,38 @@ class AndroidBuild extends JavaBuild {
|
||||
|
||||
private void writeBuildXML(final File file, final String projectName) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
writer.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
|
||||
|
||||
|
||||
writer.println("<project name=\"" + projectName + "\" default=\"help\">");
|
||||
writer.println(" <property file=\"local.properties\"/>");
|
||||
writer.println(" <property file=\"build.properties\"/>");
|
||||
writer.println(" <property file=\"default.properties\"/>");
|
||||
|
||||
writer.println(" <loadproperties srcFile=\"local.properties\" />");
|
||||
writer.println(" <property file=\"ant.properties\" />");
|
||||
writer.println(" <loadproperties srcFile=\"project.properties\" />");
|
||||
|
||||
writer.println(" <fail message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project'\" unless=\"sdk.dir\" />");
|
||||
|
||||
writer.println(" <!-- version-tag: 1 -->"); // should this be 'custom' instead of 1?
|
||||
writer.println(" <import file=\"${sdk.dir}/tools/ant/build.xml\" />");
|
||||
|
||||
writer.println(" <path id=\"android.antlibs\">");
|
||||
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\"");
|
||||
writer.println(" classname=\"com.android.ant.SetupTask\"");
|
||||
writer.println(" classpathref=\"android.antlibs\" />");
|
||||
|
||||
writer.println(" <setup />");
|
||||
// writer.println(" <property file=\"local.properties\"/>");
|
||||
// writer.println(" <property file=\"build.properties\"/>");
|
||||
// writer.println(" <property file=\"default.properties\"/>");
|
||||
//
|
||||
// writer.println(" <path id=\"android.antlibs\">");
|
||||
// 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\"");
|
||||
// writer.println(" classname=\"com.android.ant.SetupTask\"");
|
||||
// writer.println(" classpathref=\"android.antlibs\" />");
|
||||
//
|
||||
// writer.println(" <setup />");
|
||||
|
||||
writer.println("</project>");
|
||||
writer.flush();
|
||||
@@ -421,7 +442,7 @@ class AndroidBuild extends JavaBuild {
|
||||
}
|
||||
|
||||
|
||||
private void writeDefaultProps(final File file) {
|
||||
private void writeProjectProps(final File file) {
|
||||
final PrintWriter writer = PApplet.createWriter(file);
|
||||
//writer.println("target=Google Inc.:Google APIs:" + sdkVersion);
|
||||
writer.println("target=" + sdkTarget);
|
||||
|
||||
@@ -101,7 +101,7 @@ public class AndroidToolbar extends EditorToolbar {
|
||||
break;
|
||||
|
||||
case EXPORT:
|
||||
if (shift) {
|
||||
if (!shift) {
|
||||
aeditor.handleExportPackage();
|
||||
} else {
|
||||
aeditor.handleExportProject();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
0202 core
|
||||
_ video problem with P3D
|
||||
|
||||
|
||||
_ add inputPath() and outputPath() -> sketch folder or sd card
|
||||
|
||||
3
todo.txt
3
todo.txt
@@ -1,5 +1,8 @@
|
||||
0202 pde
|
||||
X fix problem with serial not loading on macosx
|
||||
X fix problem with popup menus on the toolbar disappearing immediately (osx)
|
||||
X http://code.google.com/p/processing/issues/detail?id=846
|
||||
X http://code.google.com/p/processing/issues/detail?id=887
|
||||
|
||||
|
||||
_ make note of when library is not available (serial) with error msg
|
||||
|
||||
Reference in New Issue
Block a user