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