</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">
*/
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";
* @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);
}
/**
* @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
/* 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@";
}
+ "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() {