summaryrefslogtreecommitdiffstats
path: root/themes/build.xml
blob: 0bb167855feb6f6a536d112c8b6d79b4bce15b0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0"?>

<project name="vaadin-themes" 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" />
    <property name="module.symbolic" value="com.vaadin.themes" />
    <property name="result.dir" value="result" />
    <property name="theme.result.dir" value="${result.dir}/VAADIN/themes/" />

    <union id="jar.includes">
        <fileset dir="${result.dir}">
            <include name="VAADIN/themes/**" />
            <exclude name="VAADIN/themes/*-tests*/**" />
            <exclude name="VAADIN/themes/tests-*/**" />
        </fileset>
    </union>

    <target name="compile-themes">
        <ivy:resolve log="download-only" 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>
        <antcall target="compile-theme">
            <param name="theme" value="valo" />
        </antcall>
    </target>

    <target name="jar" depends="compile-themes">
        <antcall target="common.jar">
            <param name="osgi.extra.package.prefixes" value="VAADIN/themes" />
            <reference torefid="extra.jar.includes" refid="jar.includes" />
        </antcall>
    </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/${theme}/" />

        <copy todir="${theme.result.dir}/${theme}">
            <fileset dir="${theme.source.dir}">
                <include name="**/*.scss" />
            </fileset>
            <filterset refid="filter-vaadin.version" />
        </copy>
        <copy todir="${theme.result.dir}/${theme}">
            <fileset dir="${theme.source.dir}">
                <exclude name="**/*.scss" />
            </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 log="download-only" 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}" />
            <arg value="--version" />
            <arg value="${vaadin.version}" />
            <jvmarg value="-Xss8M" />
            <jvmarg value="-XX:MaxPermSize=256M" />
            <jvmarg value="-Djava.awt.headless=true" />
        </java>

        <!-- Compress theme to serve using gzip -->
        <gzip src="${theme.result.dir}/${theme}/styles.css"
            destfile="${theme.result.dir}/${theme}/styles.css.gz" />
    </target>


    <target name="publish-local" depends="jar">
        <antcall target="common.publish-local">

        </antcall>
    </target>

    <target name="clean">
        <antcall target="common.clean" />
    </target>

    <target name="checkstyle">
        <echo>No java files in module</echo>
    </target>
    <target name="test" depends="checkstyle">
        <!--<antcall target="common.test.run" /> -->
        <echo>WHAT? No tests for ${module.name}!</echo>
    </target>

</project>