[60] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
| 2 | <!-- |
---|
| 3 | XML Web generátor – program na generování webových stránek |
---|
| 4 | Copyright © 2012 František Kučera (frantovo.cz) |
---|
| 5 | |
---|
| 6 | This program is free software: you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation, either version 3 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | --> |
---|
[1] | 19 | <project name="xhtml-web" basedir="." default="generuj"> |
---|
| 20 | |
---|
[2] | 21 | <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště --> |
---|
[1] | 22 | <property name="vstup" value="vstup"/> |
---|
| 23 | <property name="výstup" value="výstup"/> |
---|
| 24 | <property name="šablona" value="šablona"/> |
---|
[51] | 25 | <property name="seznamMaker" value="${šablona}/.makra-seznam.xsl"/> |
---|
[1] | 26 | <property name="temp" value="temp"/> |
---|
[2] | 27 | <property name="funkce" value="${šablona}/funkce/build/classes"/> |
---|
[60] | 28 | <property name="čára" value="----------------------------------------------------------------"/> |
---|
[87] | 29 | |
---|
[15] | 30 | <property name="vstupníPřípona" value=".xml"/> |
---|
| 31 | <property name="výstupníPřípona" value=".xhtml"/> |
---|
[87] | 32 | |
---|
| 33 | <target name="generuj" description="Vygeneruje kompletní web." depends="licence,agregace,stránky"/> |
---|
| 34 | |
---|
| 35 | <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra"> |
---|
[20] | 36 | <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] | 37 | <param name="podporaZaostalýchProhlížečů" expression="false"/> |
---|
| 38 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
---|
| 39 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
---|
[2] | 40 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[6] | 41 | <classpath location="${funkce}"/> |
---|
| 42 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[121] | 43 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[2] | 44 | </factory> |
---|
| 45 | </xslt> |
---|
[1] | 46 | </target> |
---|
[87] | 47 | |
---|
[31] | 48 | <target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce"> |
---|
| 49 | <xslt in="${vstup}/web.conf" out="${výstup}/css/syntaxe.css" style="${šablona}/syntaxe.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
| 50 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
| 51 | <classpath location="${funkce}"/> |
---|
| 52 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[87] | 53 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[31] | 54 | </factory> |
---|
| 55 | </xslt> |
---|
| 56 | </target> |
---|
[87] | 57 | |
---|
[51] | 58 | <target name="makra" description="Vygeneruje seznam maker podle souborů v příslušných složkách" depends="kompiluj-funkce"> |
---|
| 59 | <xslt in="${vstup}/web.conf" out="${seznamMaker}" style="${šablona}/makra.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
| 60 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
| 61 | <classpath location="${funkce}"/> |
---|
| 62 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[121] | 63 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[51] | 64 | </factory> |
---|
| 65 | </xslt> |
---|
| 66 | </target> |
---|
[87] | 67 | |
---|
[22] | 68 | <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce"> |
---|
[9] | 69 | <!-- TODO: sloučit, zjednodušit, parametrizovat --> |
---|
[87] | 70 | |
---|
[7] | 71 | <!-- Atom --> |
---|
[20] | 72 | <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[15] | 73 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
---|
| 74 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
---|
[6] | 75 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 76 | <classpath location="${funkce}"/> |
---|
[6] | 77 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[121] | 78 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[6] | 79 | </factory> |
---|
[7] | 80 | </xslt> |
---|
[87] | 81 | |
---|
[121] | 82 | <!-- RSS --> |
---|
[87] | 83 | <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[8] | 84 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
[9] | 85 | <classpath location="${funkce}"/> |
---|
[8] | 86 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[87] | 87 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[8] | 88 | </factory> |
---|
| 89 | </xslt> |
---|
[87] | 90 | |
---|
[15] | 91 | <!-- Sitemap.xml --> |
---|
[121] | 92 | <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[9] | 93 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
| 94 | <classpath location="${funkce}"/> |
---|
| 95 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[87] | 96 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[9] | 97 | </factory> |
---|
| 98 | </xslt> |
---|
[87] | 99 | |
---|
[121] | 100 | <!-- Seznam stránek --> |
---|
| 101 | <xslt in="${výstup}/atom.xml" out="${vstup}/.seznam.xml" style="${šablona}/seznam.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> |
---|
[24] | 102 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
---|
| 103 | <classpath location="${funkce}"/> |
---|
| 104 | <factory name="net.sf.saxon.TransformerFactoryImpl"> |
---|
[87] | 105 | <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> |
---|
[24] | 106 | </factory> |
---|
| 107 | </xslt> |
---|
[87] | 108 | |
---|
[6] | 109 | </target> |
---|
[87] | 110 | |
---|
| 111 | <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě."> |
---|
[6] | 112 | <mkdir dir="${funkce}"/> |
---|
| 113 | <javac |
---|
| 114 | srcdir="${šablona}/funkce/src" |
---|
[87] | 115 | destdir="${funkce}" |
---|
[6] | 116 | includeAntRuntime="no"> |
---|
| 117 | </javac> |
---|
| 118 | </target> |
---|
[87] | 119 | |
---|
[11] | 120 | <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd."> |
---|
| 121 | <copy todir="${výstup}"> |
---|
[78] | 122 | <fileset dir="${vstup}" excludes="*.xml,makra/**,*.inc,web.conf"/> |
---|
[11] | 123 | </copy> |
---|
| 124 | </target> |
---|
[87] | 125 | |
---|
[11] | 126 | <target name="čisti" description="Smaže vygenerovaný obsah."> |
---|
| 127 | <delete includeemptydirs="true"> |
---|
| 128 | <fileset dir="${výstup}" includes="**/*"/> |
---|
| 129 | <fileset dir="${funkce}" includes="**/*"/> |
---|
[51] | 130 | <fileset file="${seznamMaker}"/> |
---|
[11] | 131 | </delete> |
---|
| 132 | </target> |
---|
[87] | 133 | |
---|
[64] | 134 | <target name="prohlédni" description="Otevře vygenerované stránky ve www prohlížeči."> |
---|
| 135 | <exec executable="x-www-browser" os="Linux"> |
---|
| 136 | <arg value="${výstup}/index${výstupníPřípona}"/> |
---|
| 137 | </exec> |
---|
| 138 | </target> |
---|
[82] | 139 | |
---|
| 140 | <target name="dokumentace" description="Sestaví dokumentaci"> |
---|
| 141 | <javadoc destdir="dokumentace/javadoc" linksource="true" windowtitle="XML Web generátor – javadoc"> |
---|
| 142 | <fileset dir="šablona/funkce/src"/> |
---|
| 143 | </javadoc> |
---|
| 144 | </target> |
---|
[87] | 145 | |
---|
[60] | 146 | <target name="licence"> |
---|
| 147 | <echo>${čára} |
---|
| 148 | XML Web generátor Copyright © 2012 František Kučera (frantovo.cz) |
---|
| 149 | This program comes with ABSOLUTELY NO WARRANTY; |
---|
| 150 | This is free software, and you are welcome to redistribute it |
---|
| 151 | under certain conditions; type ‚ant licence-gpl‘ for details. |
---|
| 152 | ${čára}</echo> |
---|
| 153 | </target> |
---|
[87] | 154 | |
---|
[60] | 155 | <target name="licence-gpl"> |
---|
| 156 | <loadfile property="licence.txt" srcFile="licence/licence.txt"/> |
---|
| 157 | <loadfile property="gpl-3.0.txt" srcFile="licence/gpl-3.0.txt"/> |
---|
[121] | 158 | <echo>${čára}</echo> |
---|
| 159 | <echo>${licence.txt}</echo> |
---|
| 160 | <echo>${čára}</echo> |
---|
| 161 | <echo>${gpl-3.0.txt}</echo> |
---|
| 162 | <echo>${čára}</echo> |
---|
[60] | 163 | </target> |
---|
[87] | 164 | |
---|
[1] | 165 | </project> |
---|
[87] | 166 | |
---|