use of com.intellij.packaging.impl.elements.DirectoryCopyPackagingElement in project intellij-plugins by JetBrains.
the class FlashBCOutputSourceItem method createElements.
@NotNull
public List<? extends PackagingElement<?>> createElements(@NotNull final ArtifactEditorContext context) {
final String outputFilePath = myBc.getActualOutputFilePath();
final String outputFolderPath = PathUtil.getParentPath(outputFilePath);
switch(myType) {
case OutputFile:
return Collections.singletonList(new FileCopyPackagingElement(outputFilePath));
case OutputFileAndHtmlWrapper:
final List<PackagingElement<?>> result = new ArrayList<>();
result.add(new FileCopyPackagingElement(outputFilePath));
result.add(new FileCopyPackagingElement(outputFolderPath + "/" + BCUtils.getWrapperFileName(myBc)));
final VirtualFile wrapperDir = LocalFileSystem.getInstance().findFileByPath(myBc.getWrapperTemplatePath());
if (wrapperDir != null && wrapperDir.isDirectory()) {
for (VirtualFile file : wrapperDir.getChildren()) {
if (!FlexCommonUtils.HTML_WRAPPER_TEMPLATE_FILE_NAME.equals(file.getName())) {
if (file.isDirectory()) {
final DirectoryCopyPackagingElement packagingElement = new DirectoryCopyPackagingElement(outputFolderPath + "/" + file.getName());
result.add(PackagingElementFactory.getInstance().createParentDirectories(file.getName(), packagingElement));
} else {
result.add(new FileCopyPackagingElement(outputFolderPath + "/" + file.getName()));
}
}
}
}
return result;
case OutputFolderContents:
return Collections.singletonList(new DirectoryCopyPackagingElement(outputFolderPath));
default:
assert false;
return Collections.emptyList();
}
}
Aggregations