Correctly rebuild /libs & /lib folder on [b]uild

This commit is contained in:
Connor Tumbleson 2015-04-22 07:21:02 -05:00
parent 960d111a1e
commit e407fe839b

View File

@ -285,6 +285,7 @@ public class Androlib {
buildResources(appDir, (Map<String, Object>) meta.get("usesFramework")); buildResources(appDir, (Map<String, Object>) meta.get("usesFramework"));
buildLib(appDir); buildLib(appDir);
buildLibs(appDir);
buildCopyOriginalFiles(appDir); buildCopyOriginalFiles(appDir);
buildApk(appDir, outFile); buildApk(appDir, outFile);
@ -516,15 +517,24 @@ public class Androlib {
} }
} }
public void buildLib(File appDir) public void buildLib(File appDir) throws AndrolibException {
throws AndrolibException { buildLibrary(appDir, "lib");
File working = new File(appDir, "lib"); }
public void buildLibs(File appDir) throws AndrolibException {
buildLibrary(appDir, "libs");
}
public void buildLibrary(File appDir, String folder) throws AndrolibException {
File working = new File(appDir, folder);
if (! working.exists()) { if (! working.exists()) {
return; return;
} }
File stored = new File(appDir, APK_DIRNAME + "/lib");
File stored = new File(appDir, APK_DIRNAME + "/" + folder);
if (apkOptions.forceBuildAll || isModified(working, stored)) { if (apkOptions.forceBuildAll || isModified(working, stored)) {
LOGGER.info("Copying libs..."); LOGGER.info("Copying libs... (/" + folder + ")");
try { try {
OS.rmdir(stored); OS.rmdir(stored);
OS.cpdir(working, stored); OS.cpdir(working, stored);