[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 | |
---|
[15] | 10 | <property name="vstupníPřípona" value=".xml"/> |
---|
| 11 | <property name="výstupníPřípona" value=".xhtml"/> |
---|
| 12 | |
---|
[24] | 13 | <target name="generuj" description="Vygeneruje kompletní web." depends="agregace,stránky"> |
---|
[6] | 14 | </target> |
---|
| 15 | |
---|
[31] | 16 | <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce"> |
---|
[20] | 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"> |
---|
[15] | 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}"/> |
---|
[2] | 22 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[6] | 23 | <classpath location="${funkce}"/> |
---|
| 24 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[4] | 25 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[2] | 26 | </factory> |
---|
| 27 | </xslt> |
---|
[1] | 28 | </target> |
---|
| 29 | |
---|
[31] | 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 | |
---|
[22] | 40 | <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce"> |
---|
[9] | 41 | <!-- TODO: sloučit, zjednodušit, parametrizovat --> |
---|
| 42 | |
---|
[7] | 43 | <!-- Atom --> |
---|
[20] | 44 | <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[15] | 45 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
---|
| 46 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
---|
[6] | 47 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 48 | <classpath location="${funkce}"/> |
---|
[6] | 49 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
| 50 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
| 51 | </factory> |
---|
[7] | 52 | </xslt> |
---|
| 53 | |
---|
[8] | 54 | <!-- RSS --> |
---|
[20] | 55 | <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[8] | 56 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 57 | <classpath location="${funkce}"/> |
---|
[8] | 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 | |
---|
[15] | 63 | <!-- Sitemap.xml --> |
---|
[20] | 64 | <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[9] | 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> |
---|
[8] | 71 | |
---|
[24] | 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 | |
---|
[6] | 81 | </target> |
---|
| 82 | |
---|
[11] | 83 | <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě."> |
---|
[6] | 84 | <mkdir dir="${funkce}"/> |
---|
| 85 | <javac |
---|
| 86 | srcdir="${šablona}/funkce/src" |
---|
| 87 | destdir="${funkce}" |
---|
| 88 | includeAntRuntime="no"> |
---|
| 89 | </javac> |
---|
| 90 | </target> |
---|
| 91 | |
---|
[11] | 92 | <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd."> |
---|
| 93 | <copy todir="${výstup}"> |
---|
[20] | 94 | <fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/> |
---|
[11] | 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 | |
---|
[1] | 105 | </project> |
---|