summaryrefslogtreecommitdiff
path: root/tools/aapt/Main.cpp
diff options
context:
space:
mode:
authorRohit Agrawal <rohitagr@google.com>2016-04-21 16:29:58 -0700
committerRohit Agrawal <rohitagr@google.com>2016-04-21 18:00:53 -0700
commit86229cb622fccde8ab8cbe85eead91a34313a708 (patch)
treee84bce78081f926623a45c5f222a79c31d207acb /tools/aapt/Main.cpp
parent6a86fbe69d48c18ad1414ee04941ebc7f6a4eb0b (diff)
AAPT: ProGuard config for components in main dex.
Create an analogue of "aapt -G" which outputs a proguard configuration that keeps only components which need to be in the main dex. BUG: 27383099 Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1
Diffstat (limited to 'tools/aapt/Main.cpp')
-rw-r--r--tools/aapt/Main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index c424cc516b56..984d98e30f29 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -67,6 +67,7 @@ void usage(void)
" [--max-res-version VAL] \\\n"
" [-I base-package [-I base-package ...]] \\\n"
" [-A asset-source-dir] [-G class-list-file] [-P public-definitions-file] \\\n"
+ " [-D main-dex-class-list-file] \\\n"
" [-S resource-sources [-S resource-sources ...]] \\\n"
" [-F apk-file] [-J R-file-dir] \\\n"
" [--product product1,product2,...] \\\n"
@@ -120,6 +121,7 @@ void usage(void)
" localization=\"suggested\"\n"
" -A additional directory in which to find raw asset files\n"
" -G A file to output proguard options into.\n"
+ " -D A file to output proguard options for the main dex into.\n"
" -F specify the apk file to output\n"
" -I add an existing package to base include set\n"
" -J specify where to output R.java resource constant definitions\n"
@@ -390,6 +392,17 @@ int main(int argc, char* const argv[])
convertPath(argv[0]);
bundle.setProguardFile(argv[0]);
break;
+ case 'D':
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '-D' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ convertPath(argv[0]);
+ bundle.setMainDexProguardFile(argv[0]);
+ break;
case 'I':
argc--;
argv++;