root/build.xml @ 87:25dec6931f18

Revision 87:25dec6931f18, 7.2 KB (checked in by František Kučera <franta-hg@…>, 12 years ago)

Lepší odsazení, tabulátory.

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        <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště -->
22        <property name="vstup" value="vstup"/>
23        <property name="výstup" value="výstup"/>
24        <property name="šablona" value="šablona"/>
25        <property name="seznamMaker" value="${šablona}/.makra-seznam.xsl"/>
26        <property name="temp" value="temp"/>
27        <property name="funkce" value="${šablona}/funkce/build/classes"/>
28        <property name="čára" value="----------------------------------------------------------------"/>
29
30        <property name="vstupníPřípona" value=".xml"/>
31        <property name="výstupníPřípona" value=".xhtml"/>
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">
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">
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}"/>
40                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
41                        <classpath location="${funkce}"/>
42                        <factory name="net.sf.saxon.TransformerFactoryImpl">
43                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>   
44                        </factory>
45                </xslt>
46        </target>
47
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">
53                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
54                        </factory>
55                </xslt>
56        </target>
57
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">
63                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>   
64                        </factory>
65                </xslt>
66        </target>
67
68        <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
69                <!-- TODO: sloučit, zjednodušit, parametrizovat -->
70
71                <!-- Atom -->
72                <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
73                        <param name="vstupníPřípona" expression="${vstupníPřípona}"/>
74                        <param name="výstupníPřípona" expression="${výstupníPřípona}"/>
75                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
76                        <classpath location="${funkce}"/>
77                        <factory name="net.sf.saxon.TransformerFactoryImpl">
78                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>   
79                        </factory>
80                </xslt>
81
82                <!-- RSS --> 
83                <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
84                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
85                        <classpath location="${funkce}"/>
86                        <factory name="net.sf.saxon.TransformerFactoryImpl">
87                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
88                        </factory>
89                </xslt>
90
91                <!-- Sitemap.xml -->
92                <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">                       
93                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
94                        <classpath location="${funkce}"/>
95                        <factory name="net.sf.saxon.TransformerFactoryImpl">
96                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
97                        </factory>
98                </xslt>
99
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">                 
102                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
103                        <classpath location="${funkce}"/>
104                        <factory name="net.sf.saxon.TransformerFactoryImpl">
105                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
106                        </factory>
107                </xslt>
108
109        </target>
110
111        <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">
112                <mkdir dir="${funkce}"/>
113                <javac
114                        srcdir="${šablona}/funkce/src"
115                        destdir="${funkce}"
116                        includeAntRuntime="no">
117                </javac>
118        </target>
119
120        <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
121                <copy todir="${výstup}">
122                        <fileset dir="${vstup}" excludes="*.xml,makra/**,*.inc,web.conf"/>
123                </copy>
124        </target>
125
126        <target name="čisti" description="Smaže vygenerovaný obsah.">
127                <delete includeemptydirs="true">
128                        <fileset dir="${výstup}" includes="**/*"/>
129                        <fileset dir="${funkce}" includes="**/*"/>
130                        <fileset file="${seznamMaker}"/>
131                </delete>
132        </target>
133
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>
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>
145
146        <target name="licence">
147                <echo>${čára}
148XML Web generátor Copyright © 2012 František Kučera (frantovo.cz)
149This program comes with ABSOLUTELY NO WARRANTY;
150This is free software, and you are welcome to redistribute it
151under certain conditions; type ‚ant licence-gpl‘ for details.
152${čára}</echo>
153        </target>
154
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"/>
158                <echo>${čára}</echo> 
159                <echo>${licence.txt}</echo> 
160                <echo>${čára}</echo> 
161                <echo>${gpl-3.0.txt}</echo> 
162                <echo>${čára}</echo> 
163        </target>
164
165</project>
166
Note: See TracBrowser for help on using the browser.