Unverified Commit ccd4bc04 authored by ColinTree's avatar ColinTree Committed by Jeffrey I. Schiller

Permit sub-directories in extensions

Permit sub-packages stored in sub-directories in extensions. Before this
change sub-packages were mistakenly placed in the main package’s
directory, resulting in a non-functional situation

Fixes #962

Change-Id: I8797cdca8fb98485264d7f691b5f90eb83f20fd6
parent c0374682
......@@ -160,12 +160,7 @@ public class ExternalComponentGenerator {
String extensionDirPath = externalComponentsDirPath + File.separator + packageName;
String extensionTempDirPath = externalComponentsTempDirPath + File.separator + packageName;
String extensionFileDirPath = extensionDirPath + File.separator + "files";
String extensionClassPath = packageName.replace('.', File.separatorChar);
String extensionTempClassDirPath = extensionTempDirPath + File.separator + extensionClassPath;
if (!new File(extensionTempClassDirPath).mkdirs()) {
throw new IOException("Unable to create temporary path for extension build");
}
copyRelatedExternalClasses(androidRuntimeClassDirPath, packageName, extensionTempClassDirPath);
copyRelatedExternalClasses(androidRuntimeClassDirPath, packageName, extensionTempDirPath);
JSONArray buildInfos = new JSONArray();
for (ExternalComponentInfo info : extensions) {
......@@ -313,7 +308,11 @@ public class ExternalComponentGenerator {
copyFile(fileEntry.getAbsolutePath(), destPath + File.separator + fileEntry.getName());
}
} else if (fileEntry.isDirectory()) {
copyRelatedExternalClasses(fileEntry.getAbsolutePath(), extensionPackage, destPath);
String newDestPath=destPath + fileEntry.getAbsolutePath().substring(srcFolder.getAbsolutePath().length());
if (!new File(newDestPath).mkdirs()) {
throw new IOException("Unable to create temporary path for extension build");
}
copyRelatedExternalClasses(fileEntry.getAbsolutePath(), extensionPackage, newDestPath);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment