From: Artur Signell Date: Tue, 11 Sep 2012 12:24:04 +0000 (+0300) Subject: Compile themes without sprites if SmartSprites is not found X-Git-Tag: 7.0.0.beta1~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=919b56eaf88dbc3905d8ff176945b00b0d59b529;p=vaadin-framework.git Compile themes without sprites if SmartSprites is not found --- diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java index 669e311f82..90e3faf10e 100644 --- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java @@ -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."); + } } }