summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/build.xml4
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/CompileDefaultTheme.java29
-rwxr-xr-xsrc/com/vaadin/terminal/gwt/client/VDebugConsole.java7
3 files changed, 34 insertions, 6 deletions
diff --git a/build/build.xml b/build/build.xml
index 5f84d8b83c..10dce77b31 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -868,11 +868,13 @@
</javac>
</target>
- <target name="defaulttheme">
+ <target name="defaulttheme" depends="init">
<echo>Combining default themes css files</echo>
<!-- ensure buildhelpers are compiled -->
<javac source="1.5" target="1.5" srcdir="build/buildhelpers" classpath="build/smartsprites/lib/smartsprites-0.2.3-itmill.jar"/>
<java classname="com.vaadin.buildhelpers.CompileDefaultTheme" failonerror="yes" fork="yes">
+ <arg value="-version" />
+ <arg value="${version.full}"/>
<classpath>
<pathelement location="build/buildhelpers" />
<fileset dir="build/smartsprites/lib">
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
diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
index f3a59460e0..45b8c9353b 100755
--- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
+++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java
@@ -39,7 +39,7 @@ public final class VDebugConsole extends VOverlay implements Console {
/* Initialize version numbers from string replaced by build-script. */
static {
if ("@VERSION@".equals("@" + "VERSION" + "@")) {
- VERSION = "5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD";
+ VERSION = "9.9.9.INTERNAL-DEBUG-BUILD";
} else {
VERSION = "@VERSION@";
}
@@ -184,6 +184,11 @@ public final class VDebugConsole extends VOverlay implements Console {
+ "version than the one used on server. Unexpected "
+ "behavior may occur.");
}
+
+ log("<div class=\"v-theme-version v-theme-version-"
+ + VERSION.replaceAll("\\.", "_")
+ + "\">Warning: widgetset version " + VERSION
+ + " does not seem to match theme version </div>");
}
private EventPreview dragpreview = new EventPreview() {