aapt2: sparse resource pulling from yaml

This commit is contained in:
Connor Tumbleson 2018-02-28 11:05:07 -05:00
parent 3c84590a1a
commit f05bd31e59
2 changed files with 9 additions and 1 deletions

View File

@ -283,6 +283,7 @@ public class Androlib {
mAndRes.setPackageRenamed(meta.packageInfo);
mAndRes.setVersionInfo(meta.versionInfo);
mAndRes.setSharedLibrary(meta.sharedLibrary);
mAndRes.setSparseResources(meta.sparseResources);
if (meta.sdkInfo != null && meta.sdkInfo.get("minSdkVersion") != null) {
String minSdkVersion = meta.sdkInfo.get("minSdkVersion");

View File

@ -302,6 +302,10 @@ final public class AndrolibResources {
mSharedLibrary = flag;
}
public void setSparseResources(boolean flag) {
mSparseResources = flag;
}
public String checkTargetSdkVersionBounds() {
int target = mapSdkShorthandToVersion(mTargetSdkVersion);
@ -407,7 +411,9 @@ final public class AndrolibResources {
cmd.add("--no-version-transitions");
cmd.add("--no-resource-deduping");
// TODO Sparse Resources
if (mSparseResources) {
cmd.add("--enable-sparse-encoding");
}
if (apkOptions.isFramework) {
cmd.add("-x");
@ -1016,6 +1022,7 @@ final public class AndrolibResources {
private String mPackageId = null;
private boolean mSharedLibrary = false;
private boolean mSparseResources = false;
private final static String[] IGNORED_PACKAGES = new String[] {
"android", "com.htc", "miui", "com.lge", "com.lge.internal", "yi", "com.miui.core", "flyme",