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