am d54c92b3: am e336525b: Merge change 24650 into eclair

Merge commit 'd54c92b3a169c0f31d39512a5b0bc6c09a090122'

* commit 'd54c92b3a169c0f31d39512a5b0bc6c09a090122':
  Add <jarfile> tag to ApkBuilder ant task
This commit is contained in:
Android (Google) Code Review
2009-09-16 18:20:25 -07:00
committed by Android Git Automerger
2 changed files with 25 additions and 7 deletions

View File

@@ -68,7 +68,8 @@ public class ApkBuilderTask extends Task {
private final ArrayList<Value> mZipList = new ArrayList<Value>(); private final ArrayList<Value> mZipList = new ArrayList<Value>();
private final ArrayList<Value> mFileList = new ArrayList<Value>(); private final ArrayList<Value> mFileList = new ArrayList<Value>();
private final ArrayList<Value> mSourceList = new ArrayList<Value>(); private final ArrayList<Value> mSourceList = new ArrayList<Value>();
private final ArrayList<Value> mJarList = new ArrayList<Value>(); private final ArrayList<Value> mJarfolderList = new ArrayList<Value>();
private final ArrayList<Value> mJarfileList = new ArrayList<Value>();
private final ArrayList<Value> mNativeList = new ArrayList<Value>(); private final ArrayList<Value> mNativeList = new ArrayList<Value>();
private final ArrayList<FileInputStream> mZipArchives = new ArrayList<FileInputStream>(); private final ArrayList<FileInputStream> mZipArchives = new ArrayList<FileInputStream>();
@@ -141,7 +142,16 @@ public class ApkBuilderTask extends Task {
*/ */
public Object createJarfolder() { public Object createJarfolder() {
Value file = new Value(); Value file = new Value();
mJarList.add(file); mJarfolderList.add(file);
return file;
}
/**
* Returns an object representing a nested <var>jarfile</var> element.
*/
public Object createJarfile() {
Value file = new Value();
mJarfileList.add(file);
return file; return file;
} }
@@ -183,10 +193,15 @@ public class ApkBuilderTask extends Task {
} }
// now go through the list of jar folders. // now go through the list of jar folders.
for (Value v : mJarList) { for (Value v : mJarfolderList) {
ApkBuilderImpl.processJarFolder(v.mPath, mResourcesJars); ApkBuilderImpl.processJarFolder(v.mPath, mResourcesJars);
} }
// now go through the list of jar files.
for (Value v : mJarfileList) {
ApkBuilderImpl.processJarFile(v.mPath, mResourcesJars);
}
// now the native lib folder. // now the native lib folder.
for (Value v : mNativeList) { for (Value v : mNativeList) {
String parameter = v.mPath; String parameter = v.mPath;

View File

@@ -249,15 +249,18 @@ public final class ApkBuilderImpl {
for (String file : files) { for (String file : files) {
String path = f.getAbsolutePath() + File.separator + file; String path = f.getAbsolutePath() + File.separator + file;
FileInputStream input = new FileInputStream(path); processJarFile(parameter, resourcesJars);
resourcesJars.add(input);
} }
} else { } else {
FileInputStream input = new FileInputStream(parameter); processJarFile(parameter, resourcesJars);
resourcesJars.add(input);
} }
} }
public static void processJarFile(String jarfilePath, Collection<FileInputStream> resourcesJars)
throws FileNotFoundException {
FileInputStream input = new FileInputStream(jarfilePath);
resourcesJars.add(input);
}
/** /**
* Processes a {@link File} that could be a {@link ApkFile}, or a folder containing * Processes a {@link File} that could be a {@link ApkFile}, or a folder containing