root/build.xml @ 134:85c516f944a1

Revision 134:85c516f944a1, 7.6 KB (checked in by František Kučera <franta-hg@…>, 10 years ago)

vstupní a výstupní příponu lze nastavit v build.uživatelské.properties

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