build.xml
author František Kučera <franta-hg@frantovo.cz>
Sat Jan 07 17:34:07 2012 +0100 (2012-01-07)
changeset 64 c069af21c4be
parent 60 6e574058ef56
child 78 7e478bfa5694
permissions -rw-r--r--
Antovská úloha pro zobrazení výstupu ve www prohlížeči.
franta-hg@60
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@60
     2
<!--
franta-hg@60
     3
XML Web generátor – program na generování webových stránek
franta-hg@60
     4
Copyright © 2012 František Kučera (frantovo.cz)
franta-hg@60
     5
franta-hg@60
     6
This program is free software: you can redistribute it and/or modify
franta-hg@60
     7
it under the terms of the GNU General Public License as published by
franta-hg@60
     8
the Free Software Foundation, either version 3 of the License, or
franta-hg@60
     9
(at your option) any later version.
franta-hg@60
    10
franta-hg@60
    11
This program is distributed in the hope that it will be useful,
franta-hg@60
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@60
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
franta-hg@60
    14
GNU General Public License for more details.
franta-hg@60
    15
franta-hg@60
    16
You should have received a copy of the GNU General Public License
franta-hg@60
    17
along with this program.  If not, see <http://www.gnu.org/licenses/>.
franta-hg@60
    18
-->
franta-hg@1
    19
<project name="xhtml-web" basedir="." default="generuj">
franta-hg@1
    20
franta-hg@2
    21
	<!-- 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
    22
	<property name="vstup" value="vstup"/>
franta-hg@1
    23
	<property name="výstup" value="výstup"/>
franta-hg@1
    24
	<property name="šablona" value="šablona"/>
franta-hg@51
    25
	<property name="seznamMaker" value="${šablona}/.makra-seznam.xsl"/>
franta-hg@1
    26
	<property name="temp" value="temp"/>
franta-hg@2
    27
	<property name="funkce" value="${šablona}/funkce/build/classes"/>
franta-hg@60
    28
	<property name="čára" value="----------------------------------------------------------------"/>
franta-hg@1
    29
	
franta-hg@15
    30
	<property name="vstupníPřípona" value=".xml"/>
franta-hg@15
    31
	<property name="výstupníPřípona" value=".xhtml"/>
franta-hg@15
    32
	
franta-hg@60
    33
	<target	name="generuj" description="Vygeneruje kompletní web." depends="licence,agregace,stránky">
franta-hg@6
    34
	</target>
franta-hg@6
    35
	
franta-hg@51
    36
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra">		
franta-hg@20
    37
		<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
    38
			<param name="konfigurák" expression="../${vstup}/"/>		
franta-hg@15
    39
			<param name="podporaZaostalýchProhlížečů" expression="false"/>
franta-hg@15
    40
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    41
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@2
    42
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@6
    43
			<classpath location="${funkce}"/>
franta-hg@6
    44
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@4
    45
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@2
    46
			</factory>
franta-hg@2
    47
		</xslt>
franta-hg@1
    48
	</target>
franta-hg@1
    49
	
franta-hg@31
    50
	<target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce">
franta-hg@31
    51
		<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
    52
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@31
    53
			<classpath location="${funkce}"/>
franta-hg@31
    54
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@31
    55
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@31
    56
			</factory>
franta-hg@31
    57
		</xslt>
franta-hg@31
    58
	</target>
franta-hg@31
    59
	
franta-hg@51
    60
	<target name="makra" description="Vygeneruje seznam maker podle souborů v příslušných složkách" depends="kompiluj-funkce">
franta-hg@51
    61
		<xslt in="${vstup}/web.conf" out="${seznamMaker}" style="${šablona}/makra.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
franta-hg@51
    62
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@51
    63
			<classpath location="${funkce}"/>
franta-hg@51
    64
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@51
    65
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@51
    66
			</factory>
franta-hg@51
    67
		</xslt>
franta-hg@51
    68
	</target>
franta-hg@51
    69
	
franta-hg@22
    70
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
franta-hg@9
    71
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@9
    72
	
franta-hg@7
    73
		<!-- Atom -->
franta-hg@20
    74
		<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
    75
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    76
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@6
    77
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    78
			<classpath location="${funkce}"/>
franta-hg@6
    79
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@6
    80
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@6
    81
			</factory>
franta-hg@7
    82
		</xslt>
franta-hg@7
    83
		
franta-hg@8
    84
		<!-- RSS --> 
franta-hg@20
    85
		<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
    86
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    87
			<classpath location="${funkce}"/>
franta-hg@8
    88
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@8
    89
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@8
    90
			</factory>
franta-hg@8
    91
		</xslt>
franta-hg@8
    92
		
franta-hg@15
    93
		<!-- Sitemap.xml -->
franta-hg@20
    94
		<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
    95
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    96
			<classpath location="${funkce}"/>
franta-hg@9
    97
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@9
    98
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@9
    99
			</factory>
franta-hg@9
   100
		</xslt>
franta-hg@8
   101
		
franta-hg@24
   102
		<!-- Seznam stránek --> 
franta-hg@24
   103
		<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
   104
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@24
   105
			<classpath location="${funkce}"/>
franta-hg@24
   106
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@24
   107
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>				
franta-hg@24
   108
			</factory>
franta-hg@24
   109
		</xslt>
franta-hg@24
   110
		
franta-hg@6
   111
	</target>
franta-hg@6
   112
	
franta-hg@11
   113
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">		
franta-hg@6
   114
		<mkdir dir="${funkce}"/>
franta-hg@6
   115
		<javac
franta-hg@6
   116
			srcdir="${šablona}/funkce/src"
franta-hg@6
   117
			destdir="${funkce}"			
franta-hg@6
   118
			includeAntRuntime="no">
franta-hg@6
   119
		</javac>
franta-hg@6
   120
	</target>
franta-hg@6
   121
	
franta-hg@11
   122
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
   123
		<copy todir="${výstup}">
franta-hg@20
   124
			<fileset dir="${vstup}" excludes="*.xml,makra.xsl,*.inc,web.conf"/>
franta-hg@11
   125
		</copy>
franta-hg@11
   126
	</target>
franta-hg@11
   127
	
franta-hg@11
   128
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
   129
		<delete includeemptydirs="true">
franta-hg@11
   130
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
   131
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@51
   132
			<fileset file="${seznamMaker}"/>
franta-hg@11
   133
		</delete>
franta-hg@11
   134
	</target>
franta-hg@11
   135
	
franta-hg@64
   136
	<target name="prohlédni" description="Otevře vygenerované stránky ve www prohlížeči.">
franta-hg@64
   137
		<exec executable="x-www-browser" os="Linux">
franta-hg@64
   138
			<arg value="${výstup}/index${výstupníPřípona}"/>
franta-hg@64
   139
		</exec>
franta-hg@64
   140
	</target>
franta-hg@64
   141
	
franta-hg@60
   142
	<target name="licence">
franta-hg@60
   143
		<echo>${čára}
franta-hg@60
   144
XML Web generátor Copyright © 2012 František Kučera (frantovo.cz)
franta-hg@60
   145
This program comes with ABSOLUTELY NO WARRANTY;
franta-hg@60
   146
This is free software, and you are welcome to redistribute it
franta-hg@60
   147
under certain conditions; type ‚ant licence-gpl‘ for details.
franta-hg@60
   148
${čára}</echo>
franta-hg@60
   149
	</target>
franta-hg@60
   150
	
franta-hg@60
   151
	<target name="licence-gpl">
franta-hg@60
   152
		<loadfile property="licence.txt" srcFile="licence/licence.txt"/>
franta-hg@60
   153
		<loadfile property="gpl-3.0.txt" srcFile="licence/gpl-3.0.txt"/>
franta-hg@60
   154
		<echo>${čára}</echo> 
franta-hg@60
   155
		<echo>${licence.txt}</echo> 
franta-hg@60
   156
		<echo>${čára}</echo> 
franta-hg@60
   157
		<echo>${gpl-3.0.txt}</echo> 
franta-hg@60
   158
		<echo>${čára}</echo> 
franta-hg@60
   159
	</target>
franta-hg@60
   160
	
franta-hg@1
   161
</project>