root/build.xml @ 136:d5feb9d8ebc3

Revision 136:d5feb9d8ebc3, 7.5 KB (checked in by František Kučera <franta-hg@…>, 5 years ago)

fix license version: GNU GPLv3

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