<property name="gwt.user.super.src" location="${gwt.basedir}/user/super" />
<property name="work.dir" location="work" />
- <property name="theme-version" location="9.9.9.INTERNAL-DEBUG-BUILD" />
<echo>Using gwt files from ${gwt.user.classes} and
${gwt.dev.classes}</echo>
<jvmarg value="-Djava.awt.headless=true" />
<arg value="--theme" />
<arg value="${theme}" />
- <arg value="--theme-version" />
- <arg value="${theme-version}" />
<arg value="--theme-folder" />
<arg value="WebContent/VAADIN/themes" />
</java>
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
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();
}
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) {
// 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) {
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;
+ " 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 + " ("
<copy todir="${theme.result.dir}">
<fileset dir="${theme.source.dir}">
- <include name="${theme}/**" />
+ <include name="${theme}/**/*.scss" />
+ </fileset>
+ <filterset refid="filter-vaadin.version"/>
+ </copy>
+ <copy todir="${theme.result.dir}">
+ <fileset dir="${theme.source.dir}">
+ <exclude name="${theme}/**/*.scss" />
</fileset>
</copy>
</target>
<arg value="${theme}" />
<arg value="--theme-folder" />
<arg value="${theme.result.dir}" />
- <arg value="--theme-version" />
- <arg value="${vaadin.version}" />
<jvmarg value="-Xss8M" />
<jvmarg value="-XX:MaxPermSize=256M" />
<jvmarg value="-Djava.awt.headless=true" />