| 1 | <project name="xhtml-web" basedir="." default="generuj"> |
|---|
| 2 | |
|---|
| 3 | <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště --> |
|---|
| 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"/> |
|---|
| 8 | <property name="funkce" value="${šablona}/funkce/build/classes"/> |
|---|
| 9 | |
|---|
| 10 | <property name="vstupníPřípona" value=".xml"/> |
|---|
| 11 | <property name="výstupníPřípona" value=".xhtml"/> |
|---|
| 12 | |
|---|
| 13 | <target name="generuj" description="Vygeneruje kompletní web." depends="agregace,stránky"> |
|---|
| 14 | </target> |
|---|
| 15 | |
|---|
| 16 | <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce"> |
|---|
| 17 | <xslt basedir="${vstup}" destdir="${výstup}" includes="*${vstupníPřípona}" extension="${výstupníPřípona}" style="${šablona}/stránka.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 18 | <param name="konfigurák" expression="../${vstup}/"/> |
|---|
| 19 | <param name="podporaZaostalýchProhlížečů" expression="false"/> |
|---|
| 20 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
|---|
| 21 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
|---|
| 22 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
|---|
| 23 | <classpath location="${funkce}"/> |
|---|
| 24 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
|---|
| 25 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
|---|
| 26 | </factory> |
|---|
| 27 | </xslt> |
|---|
| 28 | </target> |
|---|
| 29 | |
|---|
| 30 | <target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce"> |
|---|
| 31 | <xslt in="${vstup}/web.conf" out="${výstup}/css/syntaxe.css" style="${šablona}/syntaxe.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 32 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
|---|
| 33 | <classpath location="${funkce}"/> |
|---|
| 34 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
|---|
| 35 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
|---|
| 36 | </factory> |
|---|
| 37 | </xslt> |
|---|
| 38 | </target> |
|---|
| 39 | |
|---|
| 40 | <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce"> |
|---|
| 41 | <!-- TODO: sloučit, zjednodušit, parametrizovat --> |
|---|
| 42 | |
|---|
| 43 | <!-- Atom --> |
|---|
| 44 | <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 45 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
|---|
| 46 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
|---|
| 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> |
|---|
| 53 | |
|---|
| 54 | <!-- RSS --> |
|---|
| 55 | <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 56 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
|---|
| 57 | <classpath location="${funkce}"/> |
|---|
| 58 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
|---|
| 59 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
|---|
| 60 | </factory> |
|---|
| 61 | </xslt> |
|---|
| 62 | |
|---|
| 63 | <!-- Sitemap.xml --> |
|---|
| 64 | <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 65 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
|---|
| 66 | <classpath location="${funkce}"/> |
|---|
| 67 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
|---|
| 68 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
|---|
| 69 | </factory> |
|---|
| 70 | </xslt> |
|---|
| 71 | |
|---|
| 72 | <!-- Seznam stránek --> |
|---|
| 73 | <xslt in="${výstup}/atom.xml" out="${vstup}/.seznam.xml" style="${šablona}/seznam.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
|---|
| 74 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
|---|
| 75 | <classpath location="${funkce}"/> |
|---|
| 76 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
|---|
| 77 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
|---|
| 78 | </factory> |
|---|
| 79 | </xslt> |
|---|
| 80 | |
|---|
| 81 | </target> |
|---|
| 82 | |
|---|
| 83 | <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě."> |
|---|
| 84 | <mkdir dir="${funkce}"/> |
|---|
| 85 | <javac |
|---|
| 86 | srcdir="${šablona}/funkce/src" |
|---|
| 87 | destdir="${funkce}" |
|---|
| 88 | includeAntRuntime="no"> |
|---|
| 89 | </javac> |
|---|
| 90 | </target> |
|---|
| 91 | |
|---|
| 92 | <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd."> |
|---|
| 93 | <copy todir="${výstup}"> |
|---|
| 94 | <fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/> |
|---|
| 95 | </copy> |
|---|
| 96 | </target> |
|---|
| 97 | |
|---|
| 98 | <target name="čisti" description="Smaže vygenerovaný obsah."> |
|---|
| 99 | <delete includeemptydirs="true"> |
|---|
| 100 | <fileset dir="${výstup}" includes="**/*"/> |
|---|
| 101 | <fileset dir="${funkce}" includes="**/*"/> |
|---|
| 102 | </delete> |
|---|
| 103 | </target> |
|---|
| 104 | |
|---|
| 105 | </project> |
|---|