build.xml
author František Kučera <franta-hg@frantovo.cz>
Sat Jun 23 20:39:15 2012 +0200 (2012-06-23)
changeset 97 6181a00e0ffd
parent 82 90a58fca78e5
child 121 1a32988c4fef
permissions -rw-r--r--
#20 Skriptování: přidáno do hlavní nabídky
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@87
    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@87
    32
franta-hg@87
    33
	<target name="generuj" description="Vygeneruje kompletní web." depends="licence,agregace,stránky"/>
franta-hg@87
    34
franta-hg@87
    35
	<target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah,syntaxe,kompiluj-funkce,makra">
franta-hg@20
    36
		<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
    37
			<param name="podporaZaostalýchProhlížečů" expression="false"/>
franta-hg@15
    38
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    39
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@2
    40
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@6
    41
			<classpath location="${funkce}"/>
franta-hg@6
    42
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    43
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>	
franta-hg@2
    44
			</factory>
franta-hg@2
    45
		</xslt>
franta-hg@1
    46
	</target>
franta-hg@87
    47
franta-hg@31
    48
	<target name="syntaxe" description="Vygeneruje CSS styl pro zvýrazňování syntaxe" depends="kompiluj-funkce">
franta-hg@31
    49
		<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
    50
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@31
    51
			<classpath location="${funkce}"/>
franta-hg@31
    52
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    53
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
franta-hg@31
    54
			</factory>
franta-hg@31
    55
		</xslt>
franta-hg@31
    56
	</target>
franta-hg@87
    57
franta-hg@51
    58
	<target name="makra" description="Vygeneruje seznam maker podle souborů v příslušných složkách" depends="kompiluj-funkce">
franta-hg@51
    59
		<xslt in="${vstup}/web.conf" out="${seznamMaker}" style="${šablona}/makra.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
franta-hg@51
    60
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@51
    61
			<classpath location="${funkce}"/>
franta-hg@51
    62
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    63
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>	
franta-hg@51
    64
			</factory>
franta-hg@51
    65
		</xslt>
franta-hg@51
    66
	</target>
franta-hg@87
    67
franta-hg@22
    68
	<target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml." depends="kompiluj-funkce">
franta-hg@9
    69
		<!-- TODO: sloučit, zjednodušit, parametrizovat -->
franta-hg@87
    70
franta-hg@7
    71
		<!-- Atom -->
franta-hg@20
    72
		<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
    73
			<param name="vstupníPřípona" expression="${vstupníPřípona}"/>
franta-hg@15
    74
			<param name="výstupníPřípona" expression="${výstupníPřípona}"/>
franta-hg@6
    75
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    76
			<classpath location="${funkce}"/>
franta-hg@6
    77
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    78
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>	
franta-hg@6
    79
			</factory>
franta-hg@7
    80
		</xslt>
franta-hg@87
    81
franta-hg@8
    82
		<!-- RSS --> 
franta-hg@87
    83
		<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
    84
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    85
			<classpath location="${funkce}"/>
franta-hg@8
    86
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    87
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
franta-hg@8
    88
			</factory>
franta-hg@8
    89
		</xslt>
franta-hg@87
    90
franta-hg@15
    91
		<!-- Sitemap.xml -->
franta-hg@20
    92
		<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
    93
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@9
    94
			<classpath location="${funkce}"/>
franta-hg@9
    95
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
    96
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
franta-hg@9
    97
			</factory>
franta-hg@9
    98
		</xslt>
franta-hg@87
    99
franta-hg@24
   100
		<!-- Seznam stránek --> 
franta-hg@24
   101
		<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
   102
			<classpath location="/usr/share/java/saxonb-9.0.jar"/>
franta-hg@24
   103
			<classpath location="${funkce}"/>
franta-hg@24
   104
			<factory name="net.sf.saxon.TransformerFactoryImpl">
franta-hg@87
   105
				<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
franta-hg@24
   106
			</factory>
franta-hg@24
   107
		</xslt>
franta-hg@87
   108
franta-hg@6
   109
	</target>
franta-hg@87
   110
franta-hg@87
   111
	<target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">
franta-hg@6
   112
		<mkdir dir="${funkce}"/>
franta-hg@6
   113
		<javac
franta-hg@6
   114
			srcdir="${šablona}/funkce/src"
franta-hg@87
   115
			destdir="${funkce}"
franta-hg@6
   116
			includeAntRuntime="no">
franta-hg@6
   117
		</javac>
franta-hg@6
   118
	</target>
franta-hg@87
   119
franta-hg@11
   120
	<target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd.">
franta-hg@11
   121
		<copy todir="${výstup}">
franta-hg@78
   122
			<fileset dir="${vstup}" excludes="*.xml,makra/**,*.inc,web.conf"/>
franta-hg@11
   123
		</copy>
franta-hg@11
   124
	</target>
franta-hg@87
   125
franta-hg@11
   126
	<target name="čisti" description="Smaže vygenerovaný obsah.">
franta-hg@11
   127
		<delete includeemptydirs="true">
franta-hg@11
   128
			<fileset dir="${výstup}" includes="**/*"/>
franta-hg@11
   129
			<fileset dir="${funkce}" includes="**/*"/>
franta-hg@51
   130
			<fileset file="${seznamMaker}"/>
franta-hg@11
   131
		</delete>
franta-hg@11
   132
	</target>
franta-hg@87
   133
franta-hg@64
   134
	<target name="prohlédni" description="Otevře vygenerované stránky ve www prohlížeči.">
franta-hg@64
   135
		<exec executable="x-www-browser" os="Linux">
franta-hg@64
   136
			<arg value="${výstup}/index${výstupníPřípona}"/>
franta-hg@64
   137
		</exec>
franta-hg@64
   138
	</target>
franta-hg@82
   139
franta-hg@82
   140
	<target name="dokumentace" description="Sestaví dokumentaci">
franta-hg@82
   141
		<javadoc destdir="dokumentace/javadoc" linksource="true" windowtitle="XML Web generátor – javadoc">
franta-hg@82
   142
			<fileset dir="šablona/funkce/src"/>
franta-hg@82
   143
		</javadoc>
franta-hg@82
   144
	</target>
franta-hg@87
   145
franta-hg@60
   146
	<target name="licence">
franta-hg@60
   147
		<echo>${čára}
franta-hg@60
   148
XML Web generátor Copyright © 2012 František Kučera (frantovo.cz)
franta-hg@60
   149
This program comes with ABSOLUTELY NO WARRANTY;
franta-hg@60
   150
This is free software, and you are welcome to redistribute it
franta-hg@60
   151
under certain conditions; type ‚ant licence-gpl‘ for details.
franta-hg@60
   152
${čára}</echo>
franta-hg@60
   153
	</target>
franta-hg@87
   154
franta-hg@60
   155
	<target name="licence-gpl">
franta-hg@60
   156
		<loadfile property="licence.txt" srcFile="licence/licence.txt"/>
franta-hg@60
   157
		<loadfile property="gpl-3.0.txt" srcFile="licence/gpl-3.0.txt"/>
franta-hg@60
   158
		<echo>${čára}</echo> 
franta-hg@60
   159
		<echo>${licence.txt}</echo> 
franta-hg@60
   160
		<echo>${čára}</echo> 
franta-hg@60
   161
		<echo>${gpl-3.0.txt}</echo> 
franta-hg@60
   162
		<echo>${čára}</echo> 
franta-hg@60
   163
	</target>
franta-hg@87
   164
franta-hg@1
   165
</project>
franta-hg@87
   166