build.xml
author František Kučera <franta-hg@frantovo.cz>
Sat, 30 Apr 2011 19:34:55 +0200
changeset 18 45e41566f8a6
parent 15 cfb2fc0ca242
child 20 29361e026fa3
permissions -rw-r--r--
Nové jmenné prostory: „s“ a „k“ místo „g“.
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@6
    13
	<target	name="generuj" description="Vygeneruje kompletní web." depends="kompiluj-funkce,stránky,agregace">
franta-hg@6
    14
	</target>
franta-hg@6
    15
	
franta-hg@11
    16
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah">		
franta-hg@15
    17
		<xslt basedir="${vstup}" destdir="${výstup}" includes="*${vstupníPřípona}" extension="${výstupníPřípona}" style="${šablona}/stránka.xsl">
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@11
    30
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml.">
franta-hg@9
    31
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@9
    32
	
franta-hg@7
    33
		<!-- Atom -->
franta-hg@6
    34
		<xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl">
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@8
    45
		<xslt in="${výstup}/atom.xml" out="${výstup}/rss.xml" style="${šablona}/rss.xsl">			
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@9
    54
		<xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl">			
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@6
    62
	</target>
franta-hg@6
    63
	
franta-hg@11
    64
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">		
franta-hg@6
    65
		<mkdir dir="${funkce}"/>
franta-hg@6
    66
		<javac
franta-hg@6
    67
			srcdir="${šablona}/funkce/src"
franta-hg@6
    68
			destdir="${funkce}"			
franta-hg@6
    69
			includeAntRuntime="no">
franta-hg@6
    70
		</javac>
franta-hg@6
    71
	</target>
franta-hg@6
    72
	
franta-hg@11
    73
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
    74
		<copy todir="${výstup}">
franta-hg@11
    75
			<fileset dir="${vstup}" excludes="*.xml,*.inc,web.conf"/>
franta-hg@11
    76
		</copy>
franta-hg@11
    77
	</target>
franta-hg@11
    78
	
franta-hg@11
    79
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
    80
		<delete includeemptydirs="true">
franta-hg@11
    81
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
    82
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@11
    83
		</delete>
franta-hg@11
    84
	</target>
franta-hg@11
    85
	
franta-hg@1
    86
</project>