build.xml
author František Kučera <franta-hg@frantovo.cz>
Sat, 07 Jan 2012 12:42:27 +0100
changeset 59 bb242c10a27c
parent 51 df1f942f7b69
child 60 6e574058ef56
permissions -rw-r--r--
přidání odkazů a zdrojáků do nabídky
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@51
     7
	<property name="seznamMaker" value="${šablona}/.makra-seznam.xsl"/>
franta-hg@1
     8
	<property name="temp" value="temp"/>
franta-hg@2
     9
	<property name="funkce" value="${šablona}/funkce/build/classes"/>
franta-hg@1
    10
	
franta-hg@15
    11
	<property name="vstupníPřípona" value=".xml"/>
franta-hg@15
    12
	<property name="výstupníPřípona" value=".xhtml"/>
franta-hg@15
    13
	
franta-hg@24
    14
	<target	name="generuj" description="Vygeneruje kompletní web." depends="agregace,stránky">
franta-hg@6
    15
	</target>
franta-hg@6
    16
	
franta-hg@51
    17
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra">		
franta-hg@20
    18
		<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
    19
			<param name="konfigurák" expression="../${vstup}/"/>		
franta-hg@15
    20
			<param name="podporaZaostalýchProhlížečů" expression="false"/>
franta-hg@15
    21
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    22
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@2
    23
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@6
    24
			<classpath location="${funkce}"/>
franta-hg@6
    25
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@4
    26
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@2
    27
			</factory>
franta-hg@2
    28
		</xslt>
franta-hg@1
    29
	</target>
franta-hg@1
    30
	
franta-hg@31
    31
	<target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce">
franta-hg@31
    32
		<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
    33
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@31
    34
			<classpath location="${funkce}"/>
franta-hg@31
    35
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@31
    36
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@31
    37
			</factory>
franta-hg@31
    38
		</xslt>
franta-hg@31
    39
	</target>
franta-hg@31
    40
	
franta-hg@51
    41
	<target name="makra" description="Vygeneruje seznam maker podle souborů v příslušných složkách" depends="kompiluj-funkce">
franta-hg@51
    42
		<xslt in="${vstup}/web.conf" out="${seznamMaker}" style="${šablona}/makra.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
franta-hg@51
    43
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@51
    44
			<classpath location="${funkce}"/>
franta-hg@51
    45
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@51
    46
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@51
    47
			</factory>
franta-hg@51
    48
		</xslt>
franta-hg@51
    49
	</target>
franta-hg@51
    50
	
franta-hg@22
    51
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
franta-hg@9
    52
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@9
    53
	
franta-hg@7
    54
		<!-- Atom -->
franta-hg@20
    55
		<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
    56
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    57
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@6
    58
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    59
			<classpath location="${funkce}"/>
franta-hg@6
    60
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@6
    61
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@6
    62
			</factory>
franta-hg@7
    63
		</xslt>
franta-hg@7
    64
		
franta-hg@8
    65
		<!-- RSS --> 
franta-hg@20
    66
		<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
    67
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    68
			<classpath location="${funkce}"/>
franta-hg@8
    69
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@8
    70
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@8
    71
			</factory>
franta-hg@8
    72
		</xslt>
franta-hg@8
    73
		
franta-hg@15
    74
		<!-- Sitemap.xml -->
franta-hg@20
    75
		<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
    76
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    77
			<classpath location="${funkce}"/>
franta-hg@9
    78
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@9
    79
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@9
    80
			</factory>
franta-hg@9
    81
		</xslt>
franta-hg@8
    82
		
franta-hg@24
    83
		<!-- Seznam stránek --> 
franta-hg@24
    84
		<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
    85
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@24
    86
			<classpath location="${funkce}"/>
franta-hg@24
    87
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@24
    88
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@24
    89
			</factory>
franta-hg@24
    90
		</xslt>
franta-hg@24
    91
		
franta-hg@6
    92
	</target>
franta-hg@6
    93
	
franta-hg@11
    94
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">		
franta-hg@6
    95
		<mkdir dir="${funkce}"/>
franta-hg@6
    96
		<javac
franta-hg@6
    97
			srcdir="${šablona}/funkce/src"
franta-hg@6
    98
			destdir="${funkce}"			
franta-hg@6
    99
			includeAntRuntime="no">
franta-hg@6
   100
		</javac>
franta-hg@6
   101
	</target>
franta-hg@6
   102
	
franta-hg@11
   103
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
   104
		<copy todir="${výstup}">
franta-hg@20
   105
			<fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/>
franta-hg@11
   106
		</copy>
franta-hg@11
   107
	</target>
franta-hg@11
   108
	
franta-hg@11
   109
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
   110
		<delete includeemptydirs="true">
franta-hg@11
   111
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
   112
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@51
   113
			<fileset file="${seznamMaker}"/>
franta-hg@11
   114
		</delete>
franta-hg@11
   115
	</target>
franta-hg@11
   116
	
franta-hg@1
   117
</project>