System.out.println("WOApplication.copyEmbeddedFrameworks: directory = " + directory);
}
}
}
else {
Copy cp = new Copy();
cp.setOwningTarget(getOwningTarget());
cp.setProject(getProject());
cp.setTaskName(getTaskName());
cp.setLocation(getLocation());
cp.setTodir(embeddedFrameworksDir());
// The purpose of this is to create filesets that actually
// allow the framework directory to be copied into the
// WOApplication directory. If we didn't do this, we'd
// have to append '/' or '/**' to the end of the includes
// in the <frameworks> tag.
boolean hasEmbeddedFrameworkSets = false;
for (FrameworkSet frameworkSet : getFrameworkSets()) {
if (!frameworkSet.getEmbed()) {
continue;
}
File root = frameworkSet.getDir(getProject());
DirectoryScanner directoryScanner = frameworkSet.getDirectoryScanner(getProject());
String[] directories = directoryScanner.getIncludedDirectories();
for (String directory : directories) {
if (!directory.endsWith(".framework")) {
throw new BuildException("The includeded directory '" + directory + "' must end with '.framework'");
}
FileSet newFileSet = new FileSet();
newFileSet.setDir(root);
PatternSet.NameEntry include = newFileSet.createInclude();
include.setName(directory + "/**");
cp.addFileset(newFileSet);
hasEmbeddedFrameworkSets = true;
}
}
if (hasEmbeddedFrameworkSets) {
cp.execute();
}
}
}