root/build.xml @ 131:d47607999a8c

Revision 131:d47607999a8c, 7.5 KB (checked in by František Kučera <franta-hg@…>, 11 years ago)

podpora zaostalých prohlížečů – konfigurovatelná v .properties místo v .xml

Line 
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-->
19<project name="xhtml-web" basedir="." default="generuj">
20
21        <loadproperties srcfile="build.uživatelské.properties"/>
22        <loadproperties srcfile="build.properties"/>
23
24        <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště -->
25        <property name="vstup" value="vstup"/>
26        <property name="výstup" value="výstup"/>
27        <property name="šablona" value="šablona"/>
28        <property name="seznamMaker" value="${šablona}/.makra-seznam.xsl"/>
29        <property name="temp" value="temp"/>
30        <property name="funkce" value="${šablona}/funkce/build/classes"/>
31        <property name="čára" value="----------------------------------------------------------------"/>
32
33        <property name="vstupníPřípona" value=".xml"/>
34        <property name="výstupníPřípona" value=".xhtml"/>
35
36        <target name="generuj" description="Vygeneruje kompletní web." depends="licence,_připrav,agregace,stránky"/>
37
38        <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra">
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">
40                        <param name="podporaZaostalýchProhlížečů" expression="${xml.zaostaleProhlizece}"/>
41                        <param name="vstupníPřípona" expression="${vstupníPřípona}"/>
42                        <param name="výstupníPřípona" expression="${výstupníPřípona}"/>
43                        <classpath location="${xslt.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
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">
53                        <classpath location="${xslt.jar}"/>
54                        <classpath location="${funkce}"/>
55                        <factory name="net.sf.saxon.TransformerFactoryImpl">
56                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
57                        </factory>
58                </xslt>
59        </target>
60
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">
63                        <classpath location="${xslt.jar}"/>
64                        <classpath location="${funkce}"/>
65                        <factory name="net.sf.saxon.TransformerFactoryImpl">
66                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
67                        </factory>
68                </xslt>
69        </target>
70
71        <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
72                <!-- TODO: sloučit, zjednodušit, parametrizovat -->
73
74                <!-- Atom -->
75                <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
76                        <param name="vstupníPřípona" expression="${vstupníPřípona}"/>
77                        <param name="výstupníPřípona" expression="${výstupníPřípona}"/>
78                        <classpath location="${xslt.jar}"/>
79                        <classpath location="${funkce}"/>
80                        <factory name="net.sf.saxon.TransformerFactoryImpl">
81                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
82                        </factory>
83                </xslt>
84
85                <!-- RSS -->
86                <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
87                        <classpath location="${xslt.jar}"/>
88                        <classpath location="${funkce}"/>
89                        <factory name="net.sf.saxon.TransformerFactoryImpl">
90                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
91                        </factory>
92                </xslt>
93
94                <!-- Sitemap.xml -->
95                <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
96                        <classpath location="${xslt.jar}"/>
97                        <classpath location="${funkce}"/>
98                        <factory name="net.sf.saxon.TransformerFactoryImpl">
99                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
100                        </factory>
101                </xslt>
102
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">
105                        <classpath location="${xslt.jar}"/>
106                        <classpath location="${funkce}"/>
107                        <factory name="net.sf.saxon.TransformerFactoryImpl">
108                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
109                        </factory>
110                </xslt>
111
112        </target>
113
114        <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">
115                <mkdir dir="${funkce}"/>
116                <javac
117                        srcdir="${šablona}/funkce/src"
118                        destdir="${funkce}"
119                        includeAntRuntime="no">
120                </javac>
121        </target>
122
123        <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
124                <copy todir="${výstup}">
125                        <fileset dir="${vstup}" excludes="*.xml,makra/**,*.inc,web.conf"/>
126                </copy>
127        </target>
128
129        <target name="čisti" description="Smaže vygenerovaný obsah.">
130                <delete includeemptydirs="true">
131                        <fileset dir="${výstup}" includes="**/*"/>
132                        <fileset dir="${funkce}" includes="**/*"/>
133                        <fileset file="${seznamMaker}"/>
134                </delete>
135        </target>
136
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>
142
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>
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>
150
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>
156
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>
165
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"/>
169                <echo>${čára}</echo>
170                <echo>${licence.txt}</echo>
171                <echo>${čára}</echo>
172                <echo>${gpl-3.0.txt}</echo>
173                <echo>${čára}</echo>
174        </target>
175
176</project>
177
Note: See TracBrowser for help on using the browser.