build.xml
author František Kučera <franta-hg@frantovo.cz>
Tue, 13 Sep 2011 18:06:07 +0200
changeset 37 2e4e7891a2f7
parent 31 da6ae32853cb
child 51 df1f942f7b69
permissions -rw-r--r--
Wiki syntaxe #7 – základ, podpora Markdown syntaxe.
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@31
    16
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,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@31
    30
	<target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce">
franta-hg@31
    31
		<xslt in="${vstup}/web.conf" out="${výstup}/css/syntaxe.css" style="${šablona}/syntaxe.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
franta-hg@31
    32
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@31
    33
			<classpath location="${funkce}"/>
franta-hg@31
    34
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@31
    35
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@31
    36
			</factory>
franta-hg@31
    37
		</xslt>
franta-hg@31
    38
	</target>
franta-hg@31
    39
	
franta-hg@22
    40
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
franta-hg@9
    41
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@9
    42
	
franta-hg@7
    43
		<!-- Atom -->
franta-hg@20
    44
		<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
    45
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    46
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@6
    47
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    48
			<classpath location="${funkce}"/>
franta-hg@6
    49
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@6
    50
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@6
    51
			</factory>
franta-hg@7
    52
		</xslt>
franta-hg@7
    53
		
franta-hg@8
    54
		<!-- RSS --> 
franta-hg@20
    55
		<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
    56
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    57
			<classpath location="${funkce}"/>
franta-hg@8
    58
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@8
    59
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@8
    60
			</factory>
franta-hg@8
    61
		</xslt>
franta-hg@8
    62
		
franta-hg@15
    63
		<!-- Sitemap.xml -->
franta-hg@20
    64
		<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
    65
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    66
			<classpath location="${funkce}"/>
franta-hg@9
    67
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@9
    68
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@9
    69
			</factory>
franta-hg@9
    70
		</xslt>
franta-hg@8
    71
		
franta-hg@24
    72
		<!-- Seznam stránek --> 
franta-hg@24
    73
		<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
    74
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@24
    75
			<classpath location="${funkce}"/>
franta-hg@24
    76
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@24
    77
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@24
    78
			</factory>
franta-hg@24
    79
		</xslt>
franta-hg@24
    80
		
franta-hg@6
    81
	</target>
franta-hg@6
    82
	
franta-hg@11
    83
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">		
franta-hg@6
    84
		<mkdir dir="${funkce}"/>
franta-hg@6
    85
		<javac
franta-hg@6
    86
			srcdir="${šablona}/funkce/src"
franta-hg@6
    87
			destdir="${funkce}"			
franta-hg@6
    88
			includeAntRuntime="no">
franta-hg@6
    89
		</javac>
franta-hg@6
    90
	</target>
franta-hg@6
    91
	
franta-hg@11
    92
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
    93
		<copy todir="${výstup}">
franta-hg@20
    94
			<fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/>
franta-hg@11
    95
		</copy>
franta-hg@11
    96
	</target>
franta-hg@11
    97
	
franta-hg@11
    98
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
    99
		<delete includeemptydirs="true">
franta-hg@11
   100
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
   101
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@11
   102
		</delete>
franta-hg@11
   103
	</target>
franta-hg@11
   104
	
franta-hg@1
   105
</project>