diff options
author | Artur Signell <artur@vaadin.com> | 2013-06-06 23:48:25 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-06-07 06:34:23 +0000 |
commit | bca14c0d095f63275cdbe46aca946673465c56d6 (patch) | |
tree | b180c39230d71afae5ea2852f845e1cac2ddf76b /theme-compiler | |
parent | 1b0a214100e6270abea8b9f415a0873de88aab95 (diff) | |
download | vaadin-framework-bca14c0d095f63275cdbe46aca946673465c56d6.tar.gz vaadin-framework-bca14c0d095f63275cdbe46aca946673465c56d6.zip |
Correctly report theme version in the debug window (#11442)
* Adds a special v-vaadin-version selector for detecting the theme version
* The version in the base theme is replaced during build (for releases) and by the current version also when compiling in the IDE
Change-Id: Id6b94ab2edead61602fed021b7152f6e46be809f
Diffstat (limited to 'theme-compiler')
-rw-r--r-- | theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java index 3cd08c4abc..dece1691f0 100644 --- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java @@ -29,6 +29,7 @@ import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; import com.vaadin.sass.internal.ScssStylesheet; +import com.vaadin.shared.Version; /** * Helper to combine css divided into separate per component dirs into one to @@ -44,8 +45,6 @@ public class CompileTheme { public static void main(String[] args) throws IOException, ParseException { Options options = new Options(); options.addOption("t", "theme", true, "the theme to compile"); - options.addOption("v", "theme-version", true, - "the version to add to the compiled theme"); options.addOption("f", "theme-folder", true, "the folder containing the theme"); CommandLineParser parser = new PosixParser(); @@ -58,11 +57,11 @@ public class CompileTheme { } String themeName = params.getOptionValue("theme"); String themeFolder = params.getOptionValue("theme-folder"); - String themeVersion = params.getOptionValue("theme-version"); // Regular theme try { - processSassTheme(themeFolder, themeName, "styles", themeVersion); + processSassTheme(themeFolder, themeName, "styles", + Version.getFullVersion()); System.out.println("Compiling theme " + themeName + " styles successful"); } catch (Exception e) { @@ -73,7 +72,7 @@ public class CompileTheme { // Legacy theme w/o .themename{} wrapping try { processSassTheme(themeFolder, themeName, "legacy-styles", - themeVersion); + Version.getFullVersion()); System.out.println("Compiling theme " + themeName + " legacy-styles successful"); } catch (Exception e) { @@ -88,11 +87,6 @@ public class CompileTheme { StringBuffer cssHeader = new StringBuffer(); - version = version.replaceAll("\\.", "_"); - cssHeader.append(".v-theme-version:after {content:\"" + version - + "\";}\n"); - cssHeader.append(".v-theme-version-" + version + " {display: none;}\n"); - String stylesCssDir = themeFolder + File.separator + themeName + File.separator; @@ -107,10 +101,9 @@ public class CompileTheme { + " not found"); } scss.compile(); - BufferedWriter out = new BufferedWriter(new FileWriter(stylesCssName)); out.write(cssHeader.toString()); - out.write(scss.toString()); + out.write(scss.toString().replace("@version@", version)); out.close(); System.out.println("Compiled CSS to " + stylesCssName + " (" |