public class ThemeBuilderOverlays extends Object
ThemeBuilder
that performs the various overlays during the build process
There are three main overlay (copy) processes executed during the theme building:
Constructor and Description |
---|
ThemeBuilderOverlays() |
Modifier and Type | Method and Description |
---|---|
protected static void |
copyAssetsToWorkingDir(String webappSourceDir,
String themeBuilderOutputDir,
List<String> additionalThemeDirectories,
List<String> additionalPluginDirectories)
Invoked at the beginning of the build process to move assets from the web source directory to the
output directory, where they can be further processed
|
protected static void |
overlayAdditionalDirs(File themeDirectory,
Properties themeProperties,
String webappSourceDir,
String themeBuilderOutputDir)
Performs any additional overlays that have been configured for the theme (with the
additionalOverlays property) |
protected static void |
overlayParentAssets(String themeName,
File themeDirectory,
Properties themeProperties,
Map<String,String> themeNamePathMapping)
Overlays assets from a parent theme (if there is a parent) to a child theme
|
protected static Map<String,String> |
parseAdditionalOverlaysStr(String additionalOverlaysStr)
Helper method that parses the configuration string for additional overlays into a Map where
the key is the source path and the map value is the target path
|
public ThemeBuilderOverlays()
protected static void copyAssetsToWorkingDir(String webappSourceDir, String themeBuilderOutputDir, List<String> additionalThemeDirectories, List<String> additionalPluginDirectories) throws IOException
Note: Not all web resources are copied, just the assets that are needed to build all themes. This includes all the theme directories, plugin directories, and KRAD scripts directory
webappSourceDir
- absolute path to the web source directorythemeBuilderOutputDir
- absolute path to the target directory, where assets will be copied
to and processed. If the directory does not exist it will be createdadditionalThemeDirectories
- list of additional theme paths that should be copied to
the output directoryadditionalPluginDirectories
- list of additional plugin paths that should be copied to
the output directoryIOException
protected static void overlayParentAssets(String themeName, File themeDirectory, Properties themeProperties, Map<String,String> themeNamePathMapping)
If the given theme has a parent (determined by the parent property in the theme properties), all files from the parent theme directory are copied to the given theme directory unless:
parentExcludes
themeName
- name of the theme to be processedthemeDirectory
- directory for the theme (parent assets will be copied here)themeProperties
- properties for the theme, used to retrieve the parent configuration and the
parent excludesthemeNamePathMapping
- mapping of theme names to theme paths, used to find the parent theme
directory pathprotected static void overlayAdditionalDirs(File themeDirectory, Properties themeProperties, String webappSourceDir, String themeBuilderOutputDir)
additionalOverlays
property)
Additional overlays can take any directory or file from the web application, and move into the theme directory or one of its subdirectores. This is useful if there are dependencies in script that needs to be moved so they are present for the minified version
themeDirectory
- directory for the theme where directories will be copied tothemeProperties
- properties for the theme to process, used to pull the additionalOverlays
configurationwebappSourceDir
- absolute path to the web source directory, if the source overlay directory is not
currently present in the output directory, we need to go back and pull it from sourcethemeBuilderOutputDir
- absolute path to the output directory, used to pull the source overly directoryprotected static Map<String,String> parseAdditionalOverlaysStr(String additionalOverlaysStr)
Each mapping in the string should be separated by a comma. Within the mapping, the source path should be given, followed by the target path in parenthesis ex. sourcePath(targetPath),sourcePath2(targetPath2)
additionalOverlaysStr
- string to parse into additional overlay mappingsCopyright © 2005–2014 The Kuali Foundation. All rights reserved.