Browse Source

Compile themes without sprites if SmartSprites is not found

tags/7.0.0.beta1
Artur Signell 11 years ago
parent
commit
919b56eaf8
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java

+ 14
- 7
theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java View File

@@ -86,7 +86,6 @@ public class CompileTheme {
+ scss.toString().length() + " bytes)");

createSprites(themeFolder, themeName);
System.out.println("Used SmartSprites to create sprites");
File oldCss = new File(stylesCssName);
File newCss = new File(stylesCssDir + "styles-sprite.css");

@@ -105,12 +104,20 @@ public class CompileTheme {

private static void createSprites(String themeFolder, String themeName)
throws FileNotFoundException, IOException {
String[] parameters = new String[] { "--sprite-png-depth", "AUTO",
"--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8",
"--root-dir-path", themeFolder + File.separator + themeName,
"--log-level", "WARN" };

org.carrot2.labs.smartsprites.SmartSprites.main(parameters);
try {
String[] parameters = new String[] { "--sprite-png-depth", "AUTO",
"--css-file-suffix", "-sprite", "--css-file-encoding",
"UTF-8", "--root-dir-path",
themeFolder + File.separator + themeName, "--log-level",
"WARN" };

org.carrot2.labs.smartsprites.SmartSprites.main(parameters);
System.out.println("Generated sprites");

} catch (NoClassDefFoundError e) {
System.err
.println("Could not find smartsprites. No sprites were generated. The theme should still work.");
}

}
}

Loading…
Cancel
Save