Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Java

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/main/java/net/jangaroo/smartsprites/maven
.gitignore
README.md
pom.xml

README.md

smartsprites-maven-plugin

Small plugin enabling you to integrate SmartSprites into your maven build process. Current SmartSprites version used is 0.2.10.

Following you will find an example including ALL(!!) options with their default values. Please understand that not all of these configuration parameters are mandatory to run SmartSprites. The descriptions for each tag are taken directly from SmartSprites

<plugin>

  <groupId>net.jangaroo</groupId>
  <artifactId>smartsprites-maven-plugin</artifactId>
  <version>1.8</version>

  <configuration>
    <rootDirPath>src/main/sprites</rootDirPath>
    <cssFiles></cssFiles>
    <outputDirPath>${basedir}/target/generated-resources/META-INF/resources/spritesheets</outputDirPath>
    <documentRootDirPath></documentRootDirPath>
    <logLevel>WARN</logLevel>
    <spritePngDepth>AUTO</spritePngDepth>
    <spritePngIeSix>false</spritePngIeSix>
    <cssFileEncoding>UTF-8</cssFileEncoding>
    <cssFileSuffix></cssFileSuffix>
  </configuration>

  <executions>
    <execution>
      <id>createSprites</id>
      <phase>generate-resources</phase>
      <goals>
        <goal>createSprites</goal>
      </goals>
    </execution>
  </executions>

</plugin>

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.

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.

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.

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.

logLevel

Message logging level, optional, default: WARN.

Messages less important than log-level will not be shown. SmartSprites has 3 levels of log messages (in the increasing order of importance): INFO: information messages, can be safely ignored IE6NOTICE: notices related to possible quality loss when creating IE6-friendly sprite images, see also the IE6-friendly PNG option WARN: warnings related to syntax, IO and sprite rendering quality loss problems that may cause the converted sprite-based designs look broken

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.

spritePngIeSix Enables generation of IE6-friendly sprite images, optional, default: disabled.

If sprite-png-ie6 is specified, for each PNG sprite image with partial transparencies (alpha channel) or more than 255 colors and any transparencies, SmartSprites will generate a corresponding color-reduced PNG8 file for IE6.

An extra IE6-only CSS rule will be added to the generated CSS file to ensure that IE6 (and only IE6) uses the color-reduced version: #web { width: 17px; height: 17px; background-repeat: no-repeat; background-image: url('../img/mysprite.png'); -background-image: url('../img/mysprite-ie6.png'); background-position: left -0px; }

See also the sprite-matte-color property.

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.

cssFileSuffix

Suffix to be appended to the processed CSS file name, optional, default: null.

Something went wrong with that request. Please try again.