summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-11 14:01:53 +0300
committerArtur Signell <artur@vaadin.com>2012-09-11 14:06:49 +0300
commitae4dbf6912fc6d874d8e0bbd6f0b015066c91929 (patch)
treee0ddfb453832057e6da947df74318f30ef4d04cc
parent6ebd899ed4b089dd11cad76b43ff8131463239a2 (diff)
downloadvaadin-framework-ae4dbf6912fc6d874d8e0bbd6f0b015066c91929.tar.gz
vaadin-framework-ae4dbf6912fc6d874d8e0bbd6f0b015066c91929.zip
Always try to compile sprites but use original styles.css if no sprites were found (#9299)
-rw-r--r--theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java21
-rw-r--r--themes-compiled/build.xml1
2 files changed, 11 insertions, 11 deletions
diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
index cb3f9abbe5..669e311f82 100644
--- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
+++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
@@ -33,7 +33,6 @@ public class CompileTheme {
"the version to add to the compiled theme");
options.addOption("f", "theme-folder", true,
"the folder containing the theme");
- options.addOption("s", "sprites", false, "use smartsprites");
CommandLineParser parser = new PosixParser();
CommandLine params = parser.parse(options, args);
if (!params.hasOption("theme") || !params.hasOption("theme-folder")) {
@@ -45,10 +44,9 @@ public class CompileTheme {
String themeName = params.getOptionValue("theme");
String themeFolder = params.getOptionValue("theme-folder");
String themeVersion = params.getOptionValue("theme-version");
- boolean useSprites = params.hasOption("sprites");
try {
- processSassTheme(themeFolder, themeName, useSprites, themeVersion);
+ processSassTheme(themeFolder, themeName, themeVersion);
System.out.println("Compiling theme " + themeName + " successful");
} catch (Exception e) {
System.err.println("Compiling theme " + themeName + " failed");
@@ -57,7 +55,7 @@ public class CompileTheme {
}
private static void processSassTheme(String themeFolder, String themeName,
- boolean useSmartSprites, String version) throws Exception {
+ String version) throws Exception {
StringBuffer cssHeader = new StringBuffer();
@@ -87,16 +85,19 @@ public class CompileTheme {
System.out.println("Compiled CSS to " + stylesCssName + " ("
+ scss.toString().length() + " bytes)");
- if (useSmartSprites) {
- createSprites(themeFolder, themeName);
- System.out.println("Used SmartSprites to create sprites");
- File oldCss = new File(stylesCssName);
+ createSprites(themeFolder, themeName);
+ System.out.println("Used SmartSprites to create sprites");
+ File oldCss = new File(stylesCssName);
+ File newCss = new File(stylesCssDir + "styles-sprite.css");
+
+ if (newCss.exists()) {
+ // Theme contained sprites. Renamed "styles-sprite.css" ->
+ // "styles.css"
oldCss.delete();
- File newCss = new File(stylesCssDir + "styles-sprite.css");
boolean ok = newCss.renameTo(oldCss);
if (!ok) {
- System.out.println("Rename " + newCss + " -> " + oldCss
+ throw new RuntimeException("Rename " + newCss + " -> " + oldCss
+ " failed");
}
}
diff --git a/themes-compiled/build.xml b/themes-compiled/build.xml
index 69ca9cff67..b5e27c882f 100644
--- a/themes-compiled/build.xml
+++ b/themes-compiled/build.xml
@@ -80,7 +80,6 @@
<arg value="${theme.result.dir}" />
<arg value="--theme-version" />
<arg value="${vaadin.version}" />
- <arg value="--sprites" />
<jvmarg value="-Xss8M" />
<jvmarg value="-XX:MaxPermSize=256M" />
<jvmarg value="-Djava.awt.headless=true" />