smartsprites:smartsprites

Full name:

com.github.hazendaz.maven:smartsprites-maven-plugin:2.4.0:smartsprites

Description:

Goal which creates Spritesheets from given css and image files Explanation of every variable is taken directly from the smartsprites documentation (https://www.w3schools.com/css/css_image_sprites.asp)

For further information on the use of smartsprites please refer to: https://www.w3schools.com/css/css_image_sprites.asp

Attributes:

  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: generate-resources.

Optional Parameters

Name Type Since Description
<cssFileEncoding> String - The encoding to assume for input and output CSS files, default: UTF-8. For the list of allowed values, please see the list of encodings supported in Java.
Default: UTF-8
User Property: cssFileEncoding
<cssFileSuffix> String - Suffix to be appended to the processed CSS file name, optional, default: .
User Property: cssFileSuffix
<cssFiles> List<File> - Paths of CSS files to process, required if root-dir-path not specified, default: not specified.

SmartSprites will process all CSS files listed using this option. If css-files is to be used together with output-dir-path, root-dir-path must also be specified so that SmartSprites can preserve the directory structure found in root-dir-path in output-dir-path. If root-dir-path and output-dir-path are used, css-files outside of root-dir-path will be ignored.

Relative CSS file paths provided using this option will be resolved against the current working directory. Please note that SmartSprites will not expand any wildcards (like style/*.css), it assumes the expansion is performed at the command line shell level.

To specify the list of CSS files to process in the SmartSprites Ant task, use one or more nested fileset elements. Please see the build.xml file in the distribution archive for an example.


User Property: cssFiles
<documentRootDirPath> File - Document root path for document-root-relative (starting with /) image urls in CSS, optional, default: not specified.

All document-root-relative image and sprite URLs will be taken relative to document-root-dir-path. Also document-root-relative sprite URLs will be written relative to document-root-dir-path. You can leave this property empty if your CSS uses only CSS-relative image URLs. If the provided document root directory path is relative, it will be resolved against the current working directory.


User Property: documentRootDirPath
<logLevel> String - Message logging level, optional, default: WARN.

Messages less important than log-level will not be shown.

SmartSprites has 5 levels of log messages (in the increasing order of importance).

INFO: information messages, can be safely ignored.

DEPRECATION: Notice messages related to deprecated features.

WARN: Warning messages, ignoring can lead to the converted designs looking broken.

ERROR: Error messages, SmartSprites cannot perform processing.

STATUS: Status messages displayed at the end of processing.


Default: WARN
User Property: logLevel
<outputDirPath> File - Output directory for processed CSS files and CSS-relative sprite images, optional, default: not specified.

If a non-empty output-dir-path is specified, a non-empty root-dir-path must also be provided. The directory structure relative to the root-dir-path will be preserved in the output directory. E.g. if CSS files are contained in the css/base directory of root-dir-path, the processed results will be written to output-dir-path/css/base. Also, CSS-relative sprite images will be written to the output directory. Sprite images with document-root-relative URLs will be written relative to the document-root-dir-path. If the output-dir-path directory does not exist, it will be created. If the provided output directory path is relative, it will be resolved against the current working directory.

You can leave the output-dir-path empty, in which case the CSS files will be written next to the original CSS files with the css-file-suffix, and sprite images will be written relative to the original CSS files. If you are using a non-empty output-dir-path, you might want to use an empty css-file-suffix.


Default: ${project.build.directory}/generated-resources/META-INF/resources/spritesheets
User Property: outPutDirPath
<rootDirPath> File - Directory in which SmartSprites processing should be done, required if css-files not specified or if output-dir-path specified, default: not specified.

SmartSprites will process all files with the *.css extension found in root-dir-path or any subdirectory of it. For more fine-grained control over the processed CSS files, see the css-files option.

If the provided root directory path is relative, it will be resolved against the current working directory.


Default: ${project.basedir}/src/main/sprites
User Property: rootDirPath
<skip> boolean - To enable skipping run of plugin.
Default: false
User Property: skip
Alias: skip
<spritePngDepth> String - Color depth of sprites in the PNG format, optional, default: AUTO. AUTO: PNG color depth will be chosen automatically. If the sprite image does not contain partial transparencies (alpha channel) and has less than 256 colors, PNG8 will be used. Otherwise, the sprite will be saved in PNG24. DIRECT: PNG sprites will always be saved in the PNG24 format. INDEXED: PNG sprites will always be saved in the PNG8 format. If the sprite image contains partial transparencies (alpha channel) or has more than 255 colors, image quality loss may occur and appropriate warnings will be issued. See also the sprite-matte-color property.
Default: AUTO
User Property: spritePngDepth
<workingMode> String - To make sure the different modes are working correctly a mode has to be specified. Modes: - rootDirMode (rootDir is set, optionally outputdir! No css-Files!) - cssFilesMode (only cssFiles is set, no rootDir, no OutputDir) - cssFilesWithOutputDirMode (cssFiles are set, as well as rootDir and outputDir)
Default: rootDirMode
User Property: workingMode

Parameter Details

<cssFileEncoding>

The encoding to assume for input and output CSS files, default: UTF-8. For the list of allowed values, please see the list of encodings supported in Java.
  • Type: java.lang.String
  • Required: No
  • User Property: cssFileEncoding
  • Default: UTF-8

<cssFileSuffix>

Suffix to be appended to the processed CSS file name, optional, default: .
  • Type: java.lang.String
  • Required: No
  • User Property: cssFileSuffix

<cssFiles>

Paths of CSS files to process, required if root-dir-path not specified, default: not specified.

SmartSprites will process all CSS files listed using this option. If css-files is to be used together with output-dir-path, root-dir-path must also be specified so that SmartSprites can preserve the directory structure found in root-dir-path in output-dir-path. If root-dir-path and output-dir-path are used, css-files outside of root-dir-path will be ignored.

Relative CSS file paths provided using this option will be resolved against the current working directory. Please note that SmartSprites will not expand any wildcards (like style/*.css), it assumes the expansion is performed at the command line shell level.

To specify the list of CSS files to process in the SmartSprites Ant task, use one or more nested fileset elements. Please see the build.xml file in the distribution archive for an example.

  • Type: java.util.List<java.io.File>
  • Required: No
  • User Property: cssFiles

<documentRootDirPath>

Document root path for document-root-relative (starting with /) image urls in CSS, optional, default: not specified.

All document-root-relative image and sprite URLs will be taken relative to document-root-dir-path. Also document-root-relative sprite URLs will be written relative to document-root-dir-path. You can leave this property empty if your CSS uses only CSS-relative image URLs. If the provided document root directory path is relative, it will be resolved against the current working directory.

  • Type: java.io.File
  • Required: No
  • User Property: documentRootDirPath

<logLevel>

Message logging level, optional, default: WARN.

Messages less important than log-level will not be shown.

SmartSprites has 5 levels of log messages (in the increasing order of importance).

INFO: information messages, can be safely ignored.

DEPRECATION: Notice messages related to deprecated features.

WARN: Warning messages, ignoring can lead to the converted designs looking broken.

ERROR: Error messages, SmartSprites cannot perform processing.

STATUS: Status messages displayed at the end of processing.

  • Type: java.lang.String
  • Required: No
  • User Property: logLevel
  • Default: WARN

<outputDirPath>

Output directory for processed CSS files and CSS-relative sprite images, optional, default: not specified.

If a non-empty output-dir-path is specified, a non-empty root-dir-path must also be provided. The directory structure relative to the root-dir-path will be preserved in the output directory. E.g. if CSS files are contained in the css/base directory of root-dir-path, the processed results will be written to output-dir-path/css/base. Also, CSS-relative sprite images will be written to the output directory. Sprite images with document-root-relative URLs will be written relative to the document-root-dir-path. If the output-dir-path directory does not exist, it will be created. If the provided output directory path is relative, it will be resolved against the current working directory.

You can leave the output-dir-path empty, in which case the CSS files will be written next to the original CSS files with the css-file-suffix, and sprite images will be written relative to the original CSS files. If you are using a non-empty output-dir-path, you might want to use an empty css-file-suffix.

  • Type: java.io.File
  • Required: No
  • User Property: outPutDirPath
  • Default: ${project.build.directory}/generated-resources/META-INF/resources/spritesheets

<rootDirPath>

Directory in which SmartSprites processing should be done, required if css-files not specified or if output-dir-path specified, default: not specified.

SmartSprites will process all files with the *.css extension found in root-dir-path or any subdirectory of it. For more fine-grained control over the processed CSS files, see the css-files option.

If the provided root directory path is relative, it will be resolved against the current working directory.

  • Type: java.io.File
  • Required: No
  • User Property: rootDirPath
  • Default: ${project.basedir}/src/main/sprites

<skip>

To enable skipping run of plugin.
  • Type: boolean
  • Required: No
  • User Property: skip
  • Default: false
  • Alias: skip

<spritePngDepth>

Color depth of sprites in the PNG format, optional, default: AUTO. AUTO: PNG color depth will be chosen automatically. If the sprite image does not contain partial transparencies (alpha channel) and has less than 256 colors, PNG8 will be used. Otherwise, the sprite will be saved in PNG24. DIRECT: PNG sprites will always be saved in the PNG24 format. INDEXED: PNG sprites will always be saved in the PNG8 format. If the sprite image contains partial transparencies (alpha channel) or has more than 255 colors, image quality loss may occur and appropriate warnings will be issued. See also the sprite-matte-color property.
  • Type: java.lang.String
  • Required: No
  • User Property: spritePngDepth
  • Default: AUTO

<workingMode>

To make sure the different modes are working correctly a mode has to be specified. Modes: - rootDirMode (rootDir is set, optionally outputdir! No css-Files!) - cssFilesMode (only cssFiles is set, no rootDir, no OutputDir) - cssFilesWithOutputDirMode (cssFiles are set, as well as rootDir and outputDir)
  • Type: java.lang.String
  • Required: No
  • User Property: workingMode
  • Default: rootDirMode