root/build.xml @ 11:78a8dd1eeb2b

Revision 11:78a8dd1eeb2b, 3.0 KB (checked in by František Kučera <franta-hg@…>, 13 years ago)

statický obsah a úloha pro čištění

Line 
1<project name="xhtml-web" basedir="." default="generuj">
2
3        <!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště -->
4        <property name="vstup" value="vstup"/>
5        <property name="výstup" value="výstup"/>
6        <property name="šablona" value="šablona"/>
7        <property name="temp" value="temp"/>
8        <property name="funkce" value="${šablona}/funkce/build/classes"/>
9       
10        <target name="generuj" description="Vygeneruje kompletní web." depends="kompiluj-funkce,stránky,agregace">
11        </target>
12       
13        <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah">         
14                <xslt basedir="${vstup}" destdir="${výstup}" includes="*.xml" extension=".xhtml" style="${šablona}/stránka.xsl">
15                        <param name="konfigurák" expression="../${vstup}/"/>
16                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
17                        <classpath location="${funkce}"/>
18                        <factory name="net.sf.saxon.TransformerFactoryImpl">
19                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
20                        </factory>
21                </xslt>
22        </target>
23       
24        <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml.">
25                <!-- TODO: sloučit, zjednodušit, parametrizovat -->
26       
27                <!-- Atom -->
28                <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl">
29                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
30                        <classpath location="${funkce}"/>
31                        <factory name="net.sf.saxon.TransformerFactoryImpl">
32                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
33                        </factory>
34                </xslt>
35               
36                <!-- RSS --> 
37                <xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl">                       
38                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
39                        <classpath location="${funkce}"/>
40                        <factory name="net.sf.saxon.TransformerFactoryImpl">
41                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
42                        </factory>
43                </xslt>
44               
45                <!-- TODO: Sitemap.xml -->
46                <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl">                       
47                        <classpath location="/usr/share/java/saxonb-9.0.jar"/>
48                        <classpath location="${funkce}"/>
49                        <factory name="net.sf.saxon.TransformerFactoryImpl">
50                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                           
51                        </factory>
52                </xslt>
53               
54        </target>
55       
56        <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">           
57                <mkdir dir="${funkce}"/>
58                <javac
59                        srcdir="${šablona}/funkce/src"
60                        destdir="${funkce}"                     
61                        includeAntRuntime="no">
62                </javac>
63        </target>
64       
65        <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
66                <copy todir="${výstup}">
67                        <fileset dir="${vstup}" excludes="*.xml,*.inc,web.conf"/>
68                </copy>
69        </target>
70       
71        <target name="čisti" description="Smaže vygenerovaný obsah.">
72                <delete includeemptydirs="true">
73                        <fileset dir="${výstup}" includes="**/*"/>
74                        <fileset dir="${funkce}" includes="**/*"/>
75                </delete>
76        </target>
77       
78</project>
Note: See TracBrowser for help on using the browser.