Harald Mackamul | e321728 | 2019-10-08 16:24:07 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | * ******************************************************************************* |
| 4 | * Copyright (c) 2013-2019 Robert Bosch GmbH and others. |
| 5 | * All rights reserved. This program and the accompanying materials |
| 6 | * are made available under the terms of the Eclipse Public License 2.0 |
| 7 | * which accompanies this distribution, and is available at |
| 8 | * https://www.eclipse.org/legal/epl-2.0/ |
| 9 | * |
| 10 | * Contributors: |
| 11 | * Robert Bosch GmbH - initial implementation |
| 12 | * ******************************************************************************* |
| 13 | --> |
| 14 | |
| 15 | <!-- ================================= |
| 16 | Documentation Project |
| 17 | Generates the documentation |
| 18 | ================================= --> |
| 19 | |
| 20 | <project name="docuproject" default="generate-help"> |
| 21 | |
| 22 | <description> |
| 23 | Generates the documentation |
| 24 | </description> |
| 25 | |
| 26 | <!-- path to wikitext standalone package --> |
| 27 | <property name="lib.folder" value="${basedir}/../../build_dependencies/docu-wikitext-lib"/> |
| 28 | <property name="styles.folder" value="${basedir}/../../build_dependencies/docu-styles"/> |
| 29 | <property name="docu.folder" value="${basedir}/docu"/> |
| 30 | <property name="build.folder" value="${basedir}/build"/> |
| 31 | <property name="target.folder.help" value="${basedir}/help"/> |
| 32 | <property name="target.folder.toc" value="${basedir}/toc"/> |
| 33 | <property name="index.file" value="${docu.folder}/_index.txt"/> |
| 34 | <property name="dest.build.file" value="${build.folder}/documentation.textile"/> |
| 35 | |
| 36 | <path id="wikitext.classpath"> |
| 37 | <fileset dir="${lib.folder}"> |
| 38 | <include name="*.jar"/> |
| 39 | </fileset> |
| 40 | </path> |
| 41 | |
| 42 | <!-- - - - - - - - - - - - - - - - - - |
| 43 | taskdefs |
| 44 | - - - - - - - - - - - - - - - - - --> |
| 45 | <taskdef classpathref="wikitext.classpath" resource="org/eclipse/mylyn/wikitext/core/ant/tasks.properties" /> |
| 46 | |
| 47 | <!-- - - - - - - - - - - - - - - - - - |
| 48 | target: init |
| 49 | - - - - - - - - - - - - - - - - - --> |
| 50 | <target name="init" depends="init-build"> |
| 51 | </target> |
| 52 | |
| 53 | <!-- - - - - - - - - - - - - - - - - - |
| 54 | clean targets |
| 55 | - - - - - - - - - - - - - - - - - --> |
| 56 | <target name="init-build"> |
| 57 | <delete dir="${build.folder}"/> |
| 58 | <mkdir dir="${build.folder}"/> |
| 59 | </target> |
| 60 | |
| 61 | <!-- - - - - - - - - - - - - - - - - - |
| 62 | assemble one file for processing |
| 63 | - - - - - - - - - - - - - - - - - --> |
| 64 | <target name="assemble"> |
| 65 | <loadfile srcfile="${index.file}" property="inputfiles"> |
| 66 | <filterchain> |
| 67 | <tokenfilter> |
| 68 | <replacestring from="\n" to=","/> |
| 69 | </tokenfilter> |
| 70 | </filterchain> |
| 71 | </loadfile> |
| 72 | <concat destfile="${dest.build.file}" append="false" fixlastline="yes"> |
| 73 | <filelist dir="${docu.folder}" files="${inputfiles}"/> |
| 74 | </concat> |
| 75 | </target> |
| 76 | |
| 77 | <!-- - - - - - - - - - - - - - - - - - |
| 78 | generate targets |
| 79 | - - - - - - - - - - - - - - - - - --> |
| 80 | <target name="generate-help" description="Generate Eclipse help from textile source" depends="init-build"> |
| 81 | <copy todir="${build.folder}"> |
| 82 | <fileset dir="${docu.folder}" includes="**/*.textile" excludes="pdf-*.textile"> |
| 83 | </fileset> |
| 84 | </copy> |
| 85 | <wikitext-to-eclipse-help |
| 86 | markupLanguage="Textile" |
| 87 | multipleOutputFiles="true" |
| 88 | navigationImages="true" |
| 89 | helpPrefix="help" |
| 90 | formatoutput="true"> |
| 91 | <fileset dir="${build.folder}"> |
| 92 | <include name="**/*.textile"/> |
| 93 | </fileset> |
| 94 | <stylesheet url="help.css" /> |
| 95 | </wikitext-to-eclipse-help> |
| 96 | |
| 97 | <copy todir="${target.folder.help}"> |
| 98 | <fileset dir="${build.folder}"> |
| 99 | <include name="**/*.html"/> |
| 100 | </fileset> |
| 101 | </copy> |
| 102 | <copy todir="${target.folder.help}"> |
| 103 | <fileset dir="${styles.folder}"/> |
| 104 | </copy> |
| 105 | |
| 106 | <copy todir="${target.folder.toc}"> |
| 107 | <fileset dir="${build.folder}"> |
| 108 | <include name="**/*-toc.xml"/> |
| 109 | </fileset> |
| 110 | </copy> |
| 111 | |
| 112 | <delete dir="${build.folder}"/> |
| 113 | </target> |
| 114 | |
| 115 | </project> |