<subant buildpathref="build-path" target="clean">
</subant>
<delete dir="result" />
- <!-- Clean IVY cache (~/.ivy2) so no old artifacts are fetched from there -->
- <ivy:cleancache />
+ <!-- Clean IVY cache (~/.ivy2) so no old artifacts are fetched from there (leave everything but Vaadin artifacts) -->
+ <delete dir="${ivy.cache.dir}/com.vaadin">
+ </delete>
</target>
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private"/>
<conf name="tests" />
</configurations>
<publications>
<property name="extraParams" value="" />
<property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
- <ivy:resolve resolveid="common" conf="build" />
- <ivy:cachepath pathid="classpath.compile.widgetset" conf="build" />
+ <ivy:resolve resolveid="common" conf="compile-module" />
+ <ivy:cachepath pathid="classpath.compile.widgetset" conf="compile-module" />
<echo>Compiling ${module} to ${module.output.dir}</echo>
<mkdir dir="${module.output.dir}" />
<echo>Compiled ${module}</echo>
</target>
-
<target name="jar" depends="default-widgetset">
+ <antcall target="common.pom.xml">
+ </antcall>
<property name="result.jar" location="${result.dir}/lib/${module.name}-${vaadin.version}.jar" />
- <property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
<jar file="${result.jar}" compress="true">
- <fileset dir="${module.output.dir}">
+ <fileset dir="${result.dir}">
+ <include name="VAADIN/widgetsets/**" />
+ <include name="pom.xml" />
+ <exclude name="VAADIN/widgetsets/WEB-INF"/>
</fileset>
<fileset refid="common.files.for.all.jars" />
</jar>
</target>
<target name="publish-local" depends="jar">
- <antcall target="common.publish-local" />
+ <antcall target="common.publish-local">
+ <param name="conf" value="build" />
+ </antcall>
+ </ivy:publish>
+-->
</target>
- <target name="clean">
- <antcall target="common.clean" />
- </target>
+<target name="clean">
+ <antcall target="common.clean" />
+</target>
- <target name="tests">
- <!--<antcall target="common.tests.run" />-->
- <echo>WHAT? No tests for ${module.name}!</echo>
- </target>
+<target name="tests">
+ <!--<antcall target="common.tests.run" />-->
+ <echo>WHAT? No tests for ${module.name}!</echo>
+</target>
</project>
\ No newline at end of file
<configurations>
<conf name="build" />
+ <conf name="compile-module" visibility="private" />
</configurations>
<publications>
<artifact type="jar"></artifact>
</publications>
- <dependencies defaultconfmapping="*->build">
+ <dependencies>
<dependency org="com.vaadin" name="vaadin-server"
- rev="${vaadin.version}" />
+ rev="${vaadin.version}" conf="compile-module-> build" />
<dependency org="com.vaadin" name="vaadin-client"
- rev="${vaadin.version}" />
+ rev="${vaadin.version}" conf="compile-module-> build" />
<dependency org="com.vaadin" name="vaadin-client-compiler"
- rev="${vaadin.version}" />
+ rev="${vaadin.version}" conf="compile-module-> build" />
<dependency org="javax.validation" name="validation-api"
- rev="1.0.0.GA" conf="build-> default,sources" />
+ rev="1.0.0.GA" conf="compile-module-> default,sources" />
</dependencies>
</ivy-module>
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private"/>
</configurations>
<publications>
<artifact></artifact>
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private"/>
<conf name="tests" />
</configurations>
<publications>
<fail unless="result.dir" message="No result.dir parameter given" />
<property name="ivy.xml" location="${result.dir}/../ivy.xml" />
<property name="pom.xml" location="${result.dir}/pom.xml" />
- <ivy:makepom templatefile="${vaadin.basedir}/pom-template.xml" ivyfile="${ivy.xml}" pomfile="${pom.xml}" conf="build, build-provided">
+ <property name="conf" value="build, build-provided" />
+
+ <ivy:makepom templatefile="${vaadin.basedir}/pom-template.xml" ivyfile="${ivy.xml}" pomfile="${pom.xml}" conf="${conf}">
<mapping conf="build" scope="compile" />
<mapping conf="build-provided" scope="provided" />
</ivy:makepom>
<target name="publish-local" description="Publishes the given module to the local repository">
<fail unless="result.dir" message="No result.dir parameter given" />
+ <property name="conf" value="*(public)" />
<ivy:resolve />
- <ivy:publish resolver="build-temp" overwrite="true" forcedeliver="true">
+ <ivy:publish conf="${conf}" resolver="build-temp" overwrite="true" forcedeliver="true">
<!-- <artifacts pattern="${result.dir}/[artifact]-[revision].[ext]" />-->
<artifacts pattern="${result.dir}/lib/[artifact]-[revision](-[classifier]).[ext]" />
resolver="build-temp" />
<module organisation="com.vaadin" name="vaadin-client-compiler"
resolver="build-temp" />
+ <module organisation="com.vaadin" name="vaadin-client-compiled"
+ resolver="build-temp" />
<module organisation="com.vaadin" name="vaadin-theme-compiler"
resolver="build-temp" />
+ <module organisation="com.vaadin" name="vaadin-themes-compiled"
+ resolver="build-temp" />
</modules>
<union id="jar.includes">
<union refid="server.gwt.includes" />
- <fileset dir="${vaadin.basedir}">
- <include name="WebContent/VAADIN/vaadinBootstrap.js" />
+ <fileset dir="${vaadin.basedir}/WebContent">
+ <include name="VAADIN/vaadinBootstrap.js" />
</fileset>
</union>
<target name="jar">
<antcall target="common.jar">
+ <param name="conf" value="build" />
<reference torefid="extra.jar.includes" refid="jar.includes" />
</antcall>
</target>
</target>
<target name="tests">
- <antcall target="common.tests.run"/>
+ <antcall target="common.tests.run" />
</target>
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
- <conf name="tests" />
+ <conf name="ide" visibility="private"/>
+ <conf name="tests" visibility="private"/>
</configurations>
<publications>
<artifact></artifact>
<!-- Project modules -->
<dependency org="com.vaadin" name="vaadin-shared"
rev="${vaadin.version}" conf="build,tests" />
- <dependency org="com.vaadin" name="vaadin-buildhelpers"
- rev="${vaadin.version}" conf="build,tests" />
<!-- Jsoup for BootstrapHandler -->
<dependency org="org.jsoup" name="jsoup" rev="1.6.3"
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private"/>
<conf name="tests" />
</configurations>
<publications>
<artifact></artifact>
</publications>
<dependencies>
- <dependency org="com.vaadin" name="vaadin-buildhelpers"
- rev="${vaadin.version}" conf="build"></dependency>
-
</dependencies>
</ivy-module>
<path id="classpath.compile.custom" />
<path id="classpath.tests.custom" />
- <property name="classes.exclude" value="com/vaadin/buildhelpers/**" />
+ <!--<property name="classes.exclude" value="com/vaadin/buildhelpers/**" />-->
<target name="jar">
<antcall target="common.jar">
<configurations>
<conf name="build" />
<conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private"/>
<conf name="tests" />
</configurations>
<publications>
<artifact type="javadoc" ext="jar" />
</publications>
<dependencies defaultconf="*->default">
+ <!-- LIBRARY DEPENDENCIES (compile time) -->
+ <!-- Project modules -->
+ <dependency org="com.vaadin" name="vaadin-shared"
+ rev="${vaadin.version}" conf="build,tests" />
+
+
<dependency org="org.w3c.css" name="sac" rev="1.3" />
<dependency org="milyn" name="flute" rev="1.3" conf="*->default" />
<dependency org="javax.servlet" name="servlet-api"
conf="tests -> default" />
<dependency org="net.sourceforge.cssparser" name="cssparser"
rev="0.9.5" conf="tests,ide->default" />
+ <dependency org="commons-cli" name="commons-cli" rev="1.2"
+ conf="build,ide -> default" />
</dependencies>
</ivy-module>
+++ /dev/null
-package com.vaadin.buildhelpers;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import com.vaadin.sass.ScssStylesheet;
-
-/**
- * Helper to combine css divided into separate per component dirs into one to
- * optimize http requests.
- */
-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";
- private static final String REINDEER = "reindeer";
- private static final String LIFERAY = "liferay";
- private static final String CHAMELEON = "chameleon";
-
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException {
- 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;
- }
- }
-
- for (String themeName : new String[] { BASE, RUNO, LIFERAY, CHAMELEON }) {
- try {
- processSassTheme(themeName, false, ver);
- System.out.println("Compiling theme " + themeName
- + " successful");
- } catch (Exception e) {
- System.err.println("Compiling theme " + themeName + " failed");
- e.printStackTrace();
- }
- }
-
- // Compile Reindeer last, since it requires the spriting operation
- // (makes testing the other themes a bit faster, since you don't need to
- // wait for the spriting operation to finish before the theme CSS is
- // compiled)
- for (String themeName : new String[] { REINDEER }) {
- try {
- processSassTheme(themeName, true, ver);
- System.out.println("Compiling theme " + themeName
- + " successful");
- } catch (Exception e) {
- System.err.println("Compiling theme " + themeName + " failed");
- e.printStackTrace();
- }
- }
- }
-
- private static void processSassTheme(String themeName,
- boolean useSmartSprites, String version) throws Exception {
-
- StringBuffer cssHeader = new StringBuffer();
-
- // Theme version
- if (version == null) {
- version = "9.9.9.INTERNAL-DEBUG-BUILD";
- }
- version = version.replaceAll("\\.", "_");
- cssHeader.append(".v-theme-version:after {content:\"" + version
- + "\";}\n");
- cssHeader.append(".v-theme-version-" + version + " {display: none;}\n");
-
- String stylesCssDir = THEME_DIR + themeName + "/";
- String stylesCssName = stylesCssDir + "styles.css";
-
- // Process as SASS file
- ScssStylesheet scss = ScssStylesheet.get(stylesCssDir + "styles.scss");
- scss.compile();
-
- BufferedWriter out = new BufferedWriter(new FileWriter(stylesCssName));
- out.write(cssHeader.toString());
- out.write(scss.toString());
- out.close();
-
- System.out.println("Compiled CSS to " + stylesCssName + " ("
- + scss.toString().length() + " bytes)");
-
- if (useSmartSprites) {
- createSprites(themeName);
- System.out.println("Used SmartSprites to create sprites");
- File oldCss = new File(stylesCssName);
- oldCss.delete();
-
- File newCss = new File(stylesCssDir + "styles-sprite.css");
- boolean ok = newCss.renameTo(oldCss);
- if (!ok) {
- System.out.println("Rename " + newCss + " -> " + oldCss
- + " failed");
- }
- }
- }
-
- private static void createSprites(String themeName)
- throws FileNotFoundException, IOException {
- String[] parameters = new String[] { "--sprite-png-depth", "AUTO",
- "--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8",
- "--root-dir-path", THEME_DIR + themeName, "--log-level", "WARN" };
-
- org.carrot2.labs.smartsprites.SmartSprites.main(parameters);
-
- }
-}
--- /dev/null
+package com.vaadin.buildhelpers;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+
+import com.vaadin.sass.ScssStylesheet;
+import com.vaadin.shared.Version;
+
+/**
+ * Helper to combine css divided into separate per component dirs into one to
+ * optimize http requests.
+ */
+public class CompileTheme {
+
+ /**
+ * @param args
+ * @throws IOException
+ * @throws ParseException
+ */
+ public static void main(String[] args) throws IOException, ParseException {
+ Options options = new Options();
+ options.addOption("t", "theme", true, "the theme to compile");
+ options.addOption("f", "theme-folder", true,
+ "the folder containing the theme");
+ options.addOption("s", "sprites", true, "use smartsprites");
+ CommandLineParser parser = new PosixParser();
+ CommandLine params = parser.parse(options, args);
+ if (!params.hasOption("theme") || !params.hasOption("theme-folder")) {
+ // automatically generate the help statement
+ HelpFormatter formatter = new HelpFormatter();
+ formatter.printHelp(CompileTheme.class.getName(), options);
+ return;
+ }
+ String themeName = params.getOptionValue("theme");
+ String themeFolder = params.getOptionValue("theme-folder");
+ boolean useSprites = params.hasOption("sprites");
+
+ String version = Version.getFullVersion();
+ try {
+ processSassTheme(themeFolder, themeName, useSprites, version);
+ System.out.println("Compiling theme " + themeName + " successful");
+ } catch (Exception e) {
+ System.err.println("Compiling theme " + themeName + " failed");
+ e.printStackTrace();
+ }
+ }
+
+ private static void processSassTheme(String themeFolder, String themeName,
+ boolean useSmartSprites, String version) throws Exception {
+
+ 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;
+ String stylesCssName = stylesCssDir + "styles.css";
+
+ // Process as SASS file
+ String sassFile = stylesCssDir + "styles.scss";
+ ScssStylesheet scss = ScssStylesheet.get(sassFile);
+ if (scss == null) {
+ throw new IllegalArgumentException("SASS file: " + sassFile
+ + " not found");
+ }
+ scss.compile();
+
+ BufferedWriter out = new BufferedWriter(new FileWriter(stylesCssName));
+ out.write(cssHeader.toString());
+ out.write(scss.toString());
+ out.close();
+
+ System.out.println("Compiled CSS to " + stylesCssName + " ("
+ + scss.toString().length() + " bytes)");
+
+ if (useSmartSprites) {
+ createSprites(themeFolder, themeName);
+ System.out.println("Used SmartSprites to create sprites");
+ File oldCss = new File(stylesCssName);
+ oldCss.delete();
+
+ File newCss = new File(stylesCssDir + "styles-sprite.css");
+ boolean ok = newCss.renameTo(oldCss);
+ if (!ok) {
+ System.out.println("Rename " + newCss + " -> " + oldCss
+ + " failed");
+ }
+ }
+ }
+
+ private static void createSprites(String themeFolder, String themeName)
+ throws FileNotFoundException, IOException {
+ String[] parameters = new String[] { "--sprite-png-depth", "AUTO",
+ "--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8",
+ "--root-dir-path", themeFolder + File.separator + themeName,
+ "--log-level", "WARN" };
+
+ org.carrot2.labs.smartsprites.SmartSprites.main(parameters);
+
+ }
+}
--- /dev/null
+<?xml version="1.0"?>
+
+<project name="vaadin-client-compiler" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant">
+ <description>
+ Themes compiled to CSS
+ </description>
+
+ <include file="../common.xml" as="common" />
+ <include file="../build.xml" as="vaadin" />
+ <include file="../gwt-files.xml" as="gwtfiles" />
+
+ <!-- global properties -->
+ <property name="module.name" value="vaadin-themes-compiled" />
+ <property name="result.dir" value="result" />
+ <property name="theme.result.dir" value="${result.dir}/VAADIN/themes" />
+
+ <target name="compile-themes">
+ <ivy:resolve resolveid="common" conf="build" />
+ <ivy:cachepath pathid="classpath.compile.theme" conf="build" />
+
+ <antcall target="compile-theme">
+ <param name="theme" value="base" />
+ </antcall>
+ <antcall target="compile-theme">
+ <param name="theme" value="runo" />
+ </antcall>
+ <antcall target="compile-theme">
+ <param name="theme" value="reindeer" />
+ </antcall>
+ <antcall target="compile-theme">
+ <param name="theme" value="chameleon" />
+ </antcall>
+ <antcall target="compile-theme">
+ <param name="theme" value="liferay" />
+ </antcall>
+ </target>
+
+ <target name="jar" depends="compile-themes">
+ <fail unless="module.name" message="No module.name parameter given" />
+
+ <property name="result.dir" location="result" />
+ <property name="result.jar" location="${result.dir}/lib/${module.name}-${vaadin.version}.jar" />
+ <property name="classes" location="{$result.dir}/classes" />
+
+ <jar jarfile="${result.jar}">
+ <fileset dir="${result.dir}">
+ <include name="VAADIN/themes/**" />
+ </fileset>
+ <fileset refid="common.files.for.all.jars" />
+ </jar>
+
+ </target>
+ <target name="copy-theme">
+ <fail unless="theme" message="You must give the theme name to copy n the 'theme' parameter" />
+ <property name="theme.source.dir" location="../WebContent/VAADIN/themes" />
+
+ <copy todir="${theme.result.dir}">
+ <fileset dir="${theme.source.dir}">
+ <include name="${theme}/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="compile-theme" depends="copy-theme">
+ <fail unless="theme" message="You must give the theme name to compile in the 'theme' parameter" />
+
+ <ivy:resolve resolveid="common" conf="compile-theme" />
+ <ivy:cachepath pathid="classpath.compile.theme" conf="compile-theme" />
+ <ivy:cachepath pathid="classpath.runtime.theme" conf="build" />
+
+ <echo>Compiling ${theme}</echo>
+ <mkdir dir="${theme.result.dir}" />
+
+ <!-- compile the theme -->
+ <java classname="com.vaadin.buildhelpers.CompileTheme" classpathref="classpath.compile.theme" failonerror="yes" fork="yes" maxmemory="512m">
+ <arg value="--theme" />
+ <arg value="${theme}" />
+ <arg value="--theme-folder" />
+ <arg value="${theme.result.dir}" />
+ <jvmarg value="-Xss8M" />
+ <jvmarg value="-XX:MaxPermSize=256M" />
+ <jvmarg value="-Djava.awt.headless=true" />
+ </java>
+
+ </target>
+
+
+ <target name="publish-local" depends="jar">
+ <antcall target="common.publish-local">
+
+ </antcall>
+ </target>
+
+ <target name="clean">
+ <antcall target="common.clean" />
+ </target>
+
+ <target name="tests">
+ <!--<antcall target="common.tests.run" />-->
+ <echo>WHAT? No tests for ${module.name}!</echo>
+ </target>
+
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
+
+ <info organisation="com.vaadin" module="vaadin-themes-compiled"
+ revision="${vaadin.version}" />
+
+ <configurations>
+ <conf name="build" />
+ <conf name="compile-theme" visibility="private" />
+ </configurations>
+ <publications>
+ <artifact type="jar"></artifact>
+ </publications>
+ <dependencies>
+ <dependency org="com.vaadin" name="vaadin-theme-compiler"
+ rev="${vaadin.version}" conf="compile-theme->build" />
+ </dependencies>
+
+</ivy-module>
<target name="dependencies">
<!-- This is copied from common.xml to be able to add server.tests.source to the source path -->
- <ivy:resolve resolveid="common" conf="build, build-provided" />
- <ivy:cachepath pathid="classpath.compile.dependencies" conf="build, build-provided" />
+ <ivy:resolve resolveid="common" conf="build" />
+ <ivy:cachepath pathid="classpath.compile.dependencies" conf="build" />
</target>
<target name="compile" description="Compiles the module" depends="dependencies">
<property name="WebContent.dir" location="${vaadin.basedir}/WebContent" />
<property name="deps.dir" location="${result.dir}/deps" />
+ <ivy:resolve resolveid="common" conf="build" />
+ <ivy:cachepath pathid="classpath.runtime.dependencies" conf="build" />
+ <delete dir="${deps.dir}" />
<mkdir dir="${deps.dir}" />
+
<copy todir="${deps.dir}" flatten="true">
- <path refid="classpath.compile.dependencies" />
+ <path refid="classpath.runtime.dependencies" />
</copy>
<war destfile="${result.war}" duplicate="fail" index="true">
<configurations>
<conf name="build" />
- <conf name="build-provided" />
- <conf name="ide" />
+ <conf name="ide" visibility="private" />
</configurations>
<publications>
<artifact type="war" />
<dependencies defaultconf="build" defaultconfmapping="build,ide->default">
<!-- API DEPENDENCIES -->
<dependency org="javax.portlet" name="portlet-api"
- rev="2.0" conf="build-provided,ide -> default" />
+ rev="2.0" conf="ide -> default" />
<dependency org="javax.validation" name="validation-api"
- rev="1.0.0.GA" conf="build-provided,ide -> default" />
+ rev="1.0.0.GA" conf="ide -> default" />
<!--Servlet API version 2.5 -->
<dependency org="javax.servlet" name="servlet-api"
- rev="2.5" conf="build-provided,ide -> default" />
+ rev="2.5" conf="ide -> default" />
<!-- Google App Engine -->
<dependency org="com.google.appengine" name="appengine-api-1.0-sdk"
- rev="1.2.1" conf="build-provided,ide -> default" />
+ rev="1.2.1" conf="ide -> default" />
<!-- LIBRARY DEPENDENCIES (compile time) -->
<!-- Project modules -->
<dependency org="com.vaadin" name="vaadin-server"
rev="${vaadin.version}" conf="build->build"></dependency>
- <dependency org="com.vaadin" name="vaadin-client"
+ <dependency org="com.vaadin" name="vaadin-client-compiled"
rev="${vaadin.version}" conf="build->build"></dependency>
-<!-- <dependency org="com.vaadin" name="vaadin-client-compiled"
+ <dependency org="com.vaadin" name="vaadin-themes-compiled"
rev="${vaadin.version}" conf="build->build"></dependency>
- <dependency org="com.vaadin" name="vaadin-theme-compiled"
- rev="${vaadin.version}" conf="build->build"></dependency>
--->
+
<dependency org="org.mortbay.jetty" name="jetty" rev="6.1.11"
conf="build,ide->default" />
<dependency org="org.mortbay.jetty" name="jetty-util"