summaryrefslogtreecommitdiffstats
path: root/build/buildhelpers/com/vaadin
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2009-12-08 14:29:24 +0000
committerMarc Englund <marc.englund@itmill.com>2009-12-08 14:29:24 +0000
commit2a1aeaee2b0f57e55cb0f8c814520945d0f04752 (patch)
tree11ccb505ddb26d2fe54578cade80af4f62dd2329 /build/buildhelpers/com/vaadin
parent987197f475571687b59d80122b928ba3c170693f (diff)
downloadvaadin-framework-2a1aeaee2b0f57e55cb0f8c814520945d0f04752.tar.gz
vaadin-framework-2a1aeaee2b0f57e55cb0f8c814520945d0f04752.zip
Theme version check for #3416
svn changeset:10202/svn branch:6.2
Diffstat (limited to 'build/buildhelpers/com/vaadin')
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java b/build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java
index 96d5a3440a..b4c016d434 100644
--- a/build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java
+++ b/build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java
@@ -19,6 +19,8 @@ import java.util.Comparator;
*/
public class CompileDefaultTheme {
+ private static final String ARG_VERSION = "-version";
+
private static final String THEME_DIR = "./WebContent/VAADIN/themes/";
private static final String BASE = "base";
private static final String RUNO = "runo";
@@ -29,9 +31,18 @@ public class CompileDefaultTheme {
* @throws IOException
*/
public static void main(String[] args) throws IOException {
- combineTheme(new String[] { BASE }, false);
- combineTheme(new String[] { BASE, RUNO }, false);
- combineTheme(new String[] { BASE, REINDEER }, true);
+ String ver = null;
+ for (int i = 0; i < args.length; i++) {
+ if (ARG_VERSION.equals(args[i])) {
+ if (args.length >= i) {
+ ver = args[i + 1];
+ }
+ break;
+ }
+ }
+ combineTheme(new String[] { BASE }, false, ver);
+ combineTheme(new String[] { BASE, RUNO }, false, ver);
+ combineTheme(new String[] { BASE, REINDEER }, true, ver);
}
/**
@@ -46,10 +57,20 @@ public class CompileDefaultTheme {
* @throws IOException
*/
private static void combineTheme(String[] themeNames,
- boolean useSmartSprites) throws IOException {
+ boolean useSmartSprites, String version) throws IOException {
StringBuffer combinedCss = new StringBuffer();
+ // Theme version
+ if (version == null) {
+ version = "9.9.9.INTERNAL-DEBUG-BUILD";
+ }
+ version = version.replaceAll("\\.", "_");
+ combinedCss.append(".v-theme-version:after {content:\"" + version
+ + "\";}\n");
+ combinedCss.append(".v-theme-version-" + version
+ + " {display: none;}\n");
+
for (int j = 0; j < themeNames.length; j++) {
File f = new File(THEME_DIR + themeNames[j]);
combinedCss