root/build.xml @ 78:7e478bfa5694

Revision 78:7e478bfa5694, 7.1 KB (checked in by František Kučera <franta-hg@…>, 12 years ago)

Definice uživatelských maker nebudeme kopírovat do výstupu, drobnosti.

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        </target>
35       
36        <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra">           
37                <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">
38                        <param name="podporaZaostalýchProhlížečů" expression="false"/>
39                        <param name="vstupníPřípona" expression="${vstupníPřípona}"/>
40                        <param name="výstupníPřípona" expression="${výstupníPřípona}"/>
41                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
42                        <classpath location="${funkce}"/>
43                        <factory name="net.sf.saxon.TransformerFactoryImpl">
44                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
45                        </factory>
46                </xslt>
47        </target>
48       
49        <target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce">
50                <xslt in="${vstup}/web.conf" out="${výstup}/css/syntaxe.css" style="${šablona}/syntaxe.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
51                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
52                        <classpath location="${funkce}"/>
53                        <factory name="net.sf.saxon.TransformerFactoryImpl">
54                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
55                        </factory>
56                </xslt>
57        </target>
58       
59        <target name="makra" description="Vygeneruje seznam maker podle souborů v příslušných složkách" depends="kompiluj-funkce">
60                <xslt in="${vstup}/web.conf" out="${seznamMaker}" style="${šablona}/makra.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
61                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
62                        <classpath location="${funkce}"/>
63                        <factory name="net.sf.saxon.TransformerFactoryImpl">
64                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
65                        </factory>
66                </xslt>
67        </target>
68       
69        <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
70                <!-- TODO: sloučit, zjednodušit, parametrizovat -->
71       
72                <!-- Atom -->
73                <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
74                        <param name="vstupníPřípona" expression="${vstupníPřípona}"/>
75                        <param name="výstupníPřípona" expression="${výstupníPřípona}"/>
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>
82               
83                <!-- RSS --> 
84                <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.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               
92                <!-- Sitemap.xml -->
93                <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">                       
94                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
95                        <classpath location="${funkce}"/>
96                        <factory name="net.sf.saxon.TransformerFactoryImpl">
97                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
98                        </factory>
99                </xslt>
100               
101                <!-- Seznam stránek --> 
102                <xslt in="${výstup}/atom.xml" out="${vstup}/.seznam.xml" style="${šablona}/seznam.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">                 
103                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
104                        <classpath location="${funkce}"/>
105                        <factory name="net.sf.saxon.TransformerFactoryImpl">
106                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
107                        </factory>
108                </xslt>
109               
110        </target>
111       
112        <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">           
113                <mkdir dir="${funkce}"/>
114                <javac
115                        srcdir="${šablona}/funkce/src"
116                        destdir="${funkce}"                     
117                        includeAntRuntime="no">
118                </javac>
119        </target>
120       
121        <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
122                <copy todir="${výstup}">
123                        <fileset dir="${vstup}" excludes="*.xml,makra/**,*.inc,web.conf"/>
124                </copy>
125        </target>
126       
127        <target name="čisti" description="Smaže vygenerovaný obsah.">
128                <delete includeemptydirs="true">
129                        <fileset dir="${výstup}" includes="**/*"/>
130                        <fileset dir="${funkce}" includes="**/*"/>
131                        <fileset file="${seznamMaker}"/>
132                </delete>
133        </target>
134       
135        <target name="prohlédni" description="Otevře vygenerované stránky ve www prohlížeči.">
136                <exec executable="x-www-browser" os="Linux">
137                        <arg value="${výstup}/index${výstupníPřípona}"/>
138                </exec>
139        </target>
140       
141        <target name="licence">
142                <echo>${čára}
143XML Web generátor Copyright © 2012 František Kučera (frantovo.cz)
144This program comes with ABSOLUTELY NO WARRANTY;
145This is free software, and you are welcome to redistribute it
146under certain conditions; type ‚ant licence-gpl‘ for details.
147${čára}</echo>
148        </target>
149       
150        <target name="licence-gpl">
151                <loadfile property="licence.txt" srcFile="licence/licence.txt"/>
152                <loadfile property="gpl-3.0.txt" srcFile="licence/gpl-3.0.txt"/>
153                <echo>${čára}</echo> 
154                <echo>${licence.txt}</echo> 
155                <echo>${čára}</echo> 
156                <echo>${gpl-3.0.txt}</echo> 
157                <echo>${čára}</echo> 
158        </target>
159       
160</project>
Note: See TracBrowser for help on using the browser.