build.xml
author František Kučera <franta-hg@frantovo.cz>
Sun Apr 03 20:12:33 2011 +0200 (2011-04-03)
changeset 10 4e70453a027f
parent 9 71275159d985
child 11 78a8dd1eeb2b
permissions -rw-r--r--
Ukázka uživatelského „makra“ a vkládání odkazů na CSS a JS soubory.
     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 XHTML webové stránky.">		
    14 		<xslt basedir="${vstup}" destdir="${výstup}" includes="*.xml" extension=".xhtml" style="${šablona}/stránka.xsl">
    15 			<param name="konfigurák" expression="../${vstup}/web.conf"/>
    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="">		
    57 		<mkdir dir="${funkce}"/>
    58 		<javac
    59 			srcdir="${šablona}/funkce/src"
    60 			destdir="${funkce}"			
    61 			includeAntRuntime="no">
    62 		</javac>
    63 	</target>
    64 	
    65 </project>