diff options
author | Xavier Ducrohet <xav@android.com> | 2010-04-27 17:05:04 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-04-27 17:21:30 -0700 |
commit | b2e132cffd83c46aa836d0b06ca2c66de87fff2e (patch) | |
tree | b8cdc8b3f0f41d7ae9fed692d83ea10fc6a7ae2f /apkbuilder | |
parent | 0fd2efc6912586032d5dbe6d5c63e242cf65a31a (diff) | |
download | sdk-b2e132cffd83c46aa836d0b06ca2c66de87fff2e.zip sdk-b2e132cffd83c46aa836d0b06ca2c66de87fff2e.tar.gz sdk-b2e132cffd83c46aa836d0b06ca2c66de87fff2e.tar.bz2 |
Add ABI filtering and version code injection in the Ant rules and tasks.
Change-Id: Ic8e41c1ad5343b32d2766427ba271a79c88b3b66
Diffstat (limited to 'apkbuilder')
-rw-r--r-- | apkbuilder/src/com/android/apkbuilder/internal/ApkBuilderImpl.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/apkbuilder/src/com/android/apkbuilder/internal/ApkBuilderImpl.java b/apkbuilder/src/com/android/apkbuilder/internal/ApkBuilderImpl.java index d8e0123..3189c41 100644 --- a/apkbuilder/src/com/android/apkbuilder/internal/ApkBuilderImpl.java +++ b/apkbuilder/src/com/android/apkbuilder/internal/ApkBuilderImpl.java @@ -148,7 +148,8 @@ public final class ApkBuilderImpl { throw new WrongOptionException("Missing value for -nf"); } - processNativeFolder(new File(args[index++]), mDebugMode, nativeLibraries); + processNativeFolder(new File(args[index++]), mDebugMode, nativeLibraries, + mVerbose, null /*abiFilter*/); } else if ("-storetype".equals(argument)) { // quick check on the next argument. if (index == args.length) { @@ -317,19 +318,38 @@ public final class ApkBuilderImpl { * <p/>The root folder must include folders that include .so files. * @param root the native root folder. * @param nativeLibraries the collection to add native libraries to. + * @param verbose verbose mode. + * @param abiFilter optional ABI filter. If non-null only the given ABI is included. * @throws ApkCreationException */ public static void processNativeFolder(File root, boolean debugMode, - Collection<ApkFile> nativeLibraries) throws ApkCreationException { + Collection<ApkFile> nativeLibraries, boolean verbose, String abiFilter) + throws ApkCreationException { if (root.isDirectory() == false) { throw new ApkCreationException(root.getAbsolutePath() + " is not a folder!"); } File[] abiList = root.listFiles(); + if (verbose) { + System.out.println("Processing native folder: " + root.getAbsolutePath()); + if (abiFilter != null) { + System.out.println("ABI Filter: " + abiFilter); + } + } + if (abiList != null) { for (File abi : abiList) { if (abi.isDirectory()) { // ignore files + + // check the abi filter and reject all other ABIs + if (abiFilter != null && abiFilter.equals(abi.getName()) == false) { + if (verbose) { + System.out.println("Rejecting ABI " + abi.getName()); + } + continue; + } + File[] libs = abi.listFiles(); if (libs != null) { for (File lib : libs) { |