From 2b0d4893c803c38159462cb4f815dcf33feed1d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 11 Oct 2012 18:17:41 +0300 Subject: [PATCH] Only ignore NoClassDefFoundError if SmartSprites is missing (#9943) Change-Id: I50f33a3bbd648555bc59b8591bc84f8723a4eff4 --- .../com/vaadin/buildhelpers/CompileTheme.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java index 90e3faf10e..47c519d09e 100644 --- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java @@ -105,19 +105,22 @@ public class CompileTheme { private static void createSprites(String themeFolder, String themeName) throws FileNotFoundException, IOException { 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"); - + // Try loading the class separately from using it to avoid + // hiding other classpath issues + Class smartSpritesClass = org.carrot2.labs.smartsprites.SmartSprites.class; } catch (NoClassDefFoundError e) { System.err .println("Could not find smartsprites. No sprites were generated. The theme should still work."); + return; } + 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"); + } } -- 2.39.5