]> source.dussan.org Git - vaadin-framework.git/commitdiff
Filter webcontent files for @version@ and more (#9299)
authorArtur Signell <artur@vaadin.com>
Thu, 6 Sep 2012 16:09:29 +0000 (19:09 +0300)
committerArtur Signell <artur@vaadin.com>
Sun, 9 Sep 2012 08:23:48 +0000 (11:23 +0300)
common.xml

index d2c6d7142a2fa7ee2717ef07c5ffa43fc3ccdad5..db56cee10d119d6719a7e7740ab5e050a0f46c44 100644 (file)
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="common" basedir="." default="" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib">
 
+       <tstamp>
+               <format property="build.date" pattern="yyyy-MM-dd" />
+       </tstamp>
+
        <dirname property="vaadin.basedir" file="${ant.file.common}" />
        <property file="${vaadin.basedir}/build.properties" />
 
 
        <union id="empty.reference" />
 
-       <!-- TODO Preprocess @version@ and more -->
-       <fileset dir="${vaadin.basedir}/WebContent" id="common.files.for.all.jars">
+       <property name="filtered.webcontent.dir" location="${vaadin.basedir}/result/filteredWebContent" />
+
+       <target name="filter.webcontent" unless="webcontent.filtered">
+               <property name="webcontent.filtered" value="true" />
+
+               <delete dir="${filtered.webcontent.dir}" />
+               <copy todir="${filtered.webcontent.dir}">
+                       <fileset dir="${vaadin.basedir}/WebContent">
+                               <include name="img/**" />
+                       </fileset>
+               </copy>
+               <copy todir="${filtered.webcontent.dir}">
+                       <fileset dir="${vaadin.basedir}/WebContent">
+                               <patternset>
+                                       <include name="release-notes.html" />
+                                       <include name="license.html" />
+                                       <include name="css/**" />
+                               </patternset>
+                       </fileset>
+                       <filterchain>
+                               <expandproperties />
+                               <replacetokens begintoken="@" endtoken="@">
+                                       <token key="version" value="${vaadin.version}" />
+                               </replacetokens>
+                               <replacetokens begintoken="@" endtoken="@">
+                                       <token key="version-minor" value="${vaadin.version.major}.${vaadin.version.minor}" />
+                               </replacetokens>
+                               <replacetokens begintoken="@" endtoken="@">
+                                       <token key="builddate" value="${build.date}" />
+                               </replacetokens>
+                       </filterchain>
+               </copy>
+
+
+       </target>
+       <fileset dir="${filtered.webcontent.dir}" id="common.files.for.all.jars">
                <patternset>
                        <include name="release-notes.html" />
                        <include name="license.html" />
                </copy>
        </target>
 
-       <target name="dependencies" description="Resolves dependencies needed by this module">
+       <target name="dependencies" description="Resolves dependencies needed by this module" depends="filter.webcontent">
                <ivy:resolve resolveid="common" conf="build, build-provided" />
                <ivy:cachepath pathid="classpath.compile.dependencies" conf="build, build-provided" />
        </target>