build.xml
author František Kučera <franta-hg@frantovo.cz>
Wed, 06 Jul 2011 23:42:32 +0200
changeset 26 32e192fb934a
parent 24 63e404f454e8
child 31 da6ae32853cb
permissions -rw-r--r--
Oprava časové zóny. TODO: pozor na změnu letního času
(když byl soubor změněný v zimě a generujeme v létě…)
franta-hg@1
     1
<project name="xhtml-web" basedir="." default="generuj">
franta-hg@1
     2
franta-hg@2
     3
	<!-- Používané adresáře – např. zde můžete vstup a výstup nasměrovat do jiného verzovaného úložiště -->
franta-hg@1
     4
	<property name="vstup" value="vstup"/>
franta-hg@1
     5
	<property name="výstup" value="výstup"/>
franta-hg@1
     6
	<property name="šablona" value="šablona"/>
franta-hg@1
     7
	<property name="temp" value="temp"/>
franta-hg@2
     8
	<property name="funkce" value="${šablona}/funkce/build/classes"/>
franta-hg@1
     9
	
franta-hg@15
    10
	<property name="vstupníPřípona" value=".xml"/>
franta-hg@15
    11
	<property name="výstupníPřípona" value=".xhtml"/>
franta-hg@15
    12
	
franta-hg@24
    13
	<target	name="generuj" description="Vygeneruje kompletní web." depends="agregace,stránky">
franta-hg@6
    14
	</target>
franta-hg@6
    15
	
franta-hg@22
    16
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,kompiluj-funkce">		
franta-hg@20
    17
		<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">
franta-hg@15
    18
			<param name="konfigurák" expression="../${vstup}/"/>		
franta-hg@15
    19
			<param name="podporaZaostalýchProhlížečů" expression="false"/>
franta-hg@15
    20
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    21
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@2
    22
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@6
    23
			<classpath location="${funkce}"/>
franta-hg@6
    24
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@4
    25
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@2
    26
			</factory>
franta-hg@2
    27
		</xslt>
franta-hg@1
    28
	</target>
franta-hg@1
    29
	
franta-hg@22
    30
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
franta-hg@9
    31
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@9
    32
	
franta-hg@7
    33
		<!-- Atom -->
franta-hg@20
    34
		<xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
franta-hg@15
    35
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    36
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@6
    37
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    38
			<classpath location="${funkce}"/>
franta-hg@6
    39
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@6
    40
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@6
    41
			</factory>
franta-hg@7
    42
		</xslt>
franta-hg@7
    43
		
franta-hg@8
    44
		<!-- RSS --> 
franta-hg@20
    45
		<xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">			
franta-hg@8
    46
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    47
			<classpath location="${funkce}"/>
franta-hg@8
    48
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@8
    49
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@8
    50
			</factory>
franta-hg@8
    51
		</xslt>
franta-hg@8
    52
		
franta-hg@15
    53
		<!-- Sitemap.xml -->
franta-hg@20
    54
		<xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">			
franta-hg@9
    55
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    56
			<classpath location="${funkce}"/>
franta-hg@9
    57
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@9
    58
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@9
    59
			</factory>
franta-hg@9
    60
		</xslt>
franta-hg@8
    61
		
franta-hg@24
    62
		<!-- Seznam stránek --> 
franta-hg@24
    63
		<xslt in="${výstup}/atom.xml" out="${vstup}/.seznam.xml" style="${šablona}/seznam.xsl"  processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">			
franta-hg@24
    64
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@24
    65
			<classpath location="${funkce}"/>
franta-hg@24
    66
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@24
    67
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@24
    68
			</factory>
franta-hg@24
    69
		</xslt>
franta-hg@24
    70
		
franta-hg@6
    71
	</target>
franta-hg@6
    72
	
franta-hg@11
    73
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">		
franta-hg@6
    74
		<mkdir dir="${funkce}"/>
franta-hg@6
    75
		<javac
franta-hg@6
    76
			srcdir="${šablona}/funkce/src"
franta-hg@6
    77
			destdir="${funkce}"			
franta-hg@6
    78
			includeAntRuntime="no">
franta-hg@6
    79
		</javac>
franta-hg@6
    80
	</target>
franta-hg@6
    81
	
franta-hg@11
    82
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
    83
		<copy todir="${výstup}">
franta-hg@20
    84
			<fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/>
franta-hg@11
    85
		</copy>
franta-hg@11
    86
	</target>
franta-hg@11
    87
	
franta-hg@11
    88
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
    89
		<delete includeemptydirs="true">
franta-hg@11
    90
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
    91
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@11
    92
		</delete>
franta-hg@11
    93
	</target>
franta-hg@11
    94
	
franta-hg@1
    95
</project>