[1] | 1 | <project name="xhtml-web" basedir="." default="generuj"> |
---|
| 2 | |
---|
[2] | 3 | <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště --> |
---|
[1] | 4 | <property name="vstup" value="vstup"/> |
---|
| 5 | <property name="výstup" value="výstup"/> |
---|
| 6 | <property name="šablona" value="šablona"/> |
---|
| 7 | <property name="temp" value="temp"/> |
---|
[2] | 8 | <property name="funkce" value="${šablona}/funkce/build/classes"/> |
---|
[1] | 9 | |
---|
[6] | 10 | <target name="generuj" description="Vygeneruje kompletní web." depends="kompiluj-funkce,stránky,agregace"> |
---|
| 11 | </target> |
---|
| 12 | |
---|
[11] | 13 | <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah"> |
---|
[2] | 14 | <xslt basedir="${vstup}" destdir="${výstup}" includes="*.xml" extension=".xhtml" style="${šablona}/stránka.xsl"> |
---|
[11] | 15 | <param name="konfigurák" expression="../${vstup}/"/> |
---|
[2] | 16 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[6] | 17 | <classpath location="${funkce}"/> |
---|
| 18 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[4] | 19 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[2] | 20 | </factory> |
---|
| 21 | </xslt> |
---|
[1] | 22 | </target> |
---|
| 23 | |
---|
[11] | 24 | <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml."> |
---|
[9] | 25 | <!-- TODO: sloučit, zjednodušit, parametrizovat --> |
---|
| 26 | |
---|
[7] | 27 | <!-- Atom --> |
---|
[6] | 28 | <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl"> |
---|
| 29 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 30 | <classpath location="${funkce}"/> |
---|
[6] | 31 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
| 32 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
| 33 | </factory> |
---|
[7] | 34 | </xslt> |
---|
| 35 | |
---|
[8] | 36 | <!-- RSS --> |
---|
| 37 | <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl"> |
---|
| 38 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 39 | <classpath location="${funkce}"/> |
---|
[8] | 40 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
| 41 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
| 42 | </factory> |
---|
| 43 | </xslt> |
---|
| 44 | |
---|
| 45 | <!-- TODO: Sitemap.xml --> |
---|
[9] | 46 | <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"> |
---|
| 47 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
| 48 | <classpath location="${funkce}"/> |
---|
| 49 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
| 50 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
| 51 | </factory> |
---|
| 52 | </xslt> |
---|
[8] | 53 | |
---|
[6] | 54 | </target> |
---|
| 55 | |
---|
[11] | 56 | <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě."> |
---|
[6] | 57 | <mkdir dir="${funkce}"/> |
---|
| 58 | <javac |
---|
| 59 | srcdir="${šablona}/funkce/src" |
---|
| 60 | destdir="${funkce}" |
---|
| 61 | includeAntRuntime="no"> |
---|
| 62 | </javac> |
---|
| 63 | </target> |
---|
| 64 | |
---|
[11] | 65 | <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd."> |
---|
| 66 | <copy todir="${výstup}"> |
---|
| 67 | <fileset dir="${vstup}" excludes="*.xml,*.inc,web.conf"/> |
---|
| 68 | </copy> |
---|
| 69 | </target> |
---|
| 70 | |
---|
| 71 | <target name="čisti" description="Smaže vygenerovaný obsah."> |
---|
| 72 | <delete includeemptydirs="true"> |
---|
| 73 | <fileset dir="${výstup}" includes="**/*"/> |
---|
| 74 | <fileset dir="${funkce}" includes="**/*"/> |
---|
| 75 | </delete> |
---|
| 76 | </target> |
---|
| 77 | |
---|
[1] | 78 | </project> |
---|