Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

MAVEN-129: Support for additional folders #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ protected void doExecute() throws Exception {
getLog().info("Parent theme artifact ID " + parentThemeArtifactId);
getLog().info("Parent theme version " + parentThemeArtifactVersion);
getLog().info("Parent theme ID " + parentThemeId);
getLog().info("Parent theme additional folders2 = " + parentThemeFolders);


String[] excludes = null;
String[] includes = null;
Expand Down Expand Up @@ -324,6 +326,29 @@ protected void mergeTheme(

cleanUpTemplates(targetTemplatesDir);
}

// additional folders => iterate and copy from parent theme
if ( parentThemeFolders != null && !"".equals(parentThemeFolders)) {
String[] folders = parentThemeFolders.split(",");
for(String folder : folders) {
File sourceAddFolderDir = new File(
sourceDir, sourceTheme.getRootPath() + folder);

if (sourceAddFolderDir.exists()) {
File targetAddFolderDir = new File(
webappDir, targetTheme.getRootPath() + folder);

targetAddFolderDir.mkdirs();

FileUtils.copyDirectory(sourceAddFolderDir, targetAddFolderDir);

getLog().info(
"Copying " + sourceAddFolderDir + " to " + targetAddFolderDir);

cleanUpTemplates(targetAddFolderDir);
}
}
}
}

protected void mergeTheme(Theme sourceTheme, Theme targetTheme)
Expand Down Expand Up @@ -463,6 +488,11 @@ protected Theme readTheme(String themeId, File liferayLookAndFeelXml)
* @parameter default-value="_styled"
*/
private String parentThemeId;

/**
* @parameter parentThemeFolders additionnal folders to copy
*/
private String parentThemeFolders;

/**
* @parameter
Expand Down