123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project default="generate.all"
- basedir="."
- name="org.yakindu.sct.doc.user"
- xmlns:if="ant:if"
- xmlns:unless="ant:unless"
- xmlns:artifact="antlib:org.eclipse.aether.ant">
- <property file="build.properties" />
- <property file="local.properties" />
- <!-- The documentation source files are located here: -->
- <property name="src.basename" value="documentation" />
- <property name="src.dir.name" value="src" />
- <property name="css.dir.name" value="css" />
- <property name="img.dir.name" value="images" />
- <property name="src.dir" location="${basedir}/${src.dir.name}" />
- <property name="css.dir" location="${basedir}/${css.dir.name}" />
- <property name="img.dir" location="${src.dir}/${img.dir.name}" />
- <!-- Location of source file with XIncludes resolved: -->
- <property name="res.basename" value="${src.basename}.resolved" />
- <property name="res.dir.name" value="src-gen" />
- <!-- Target directory names and directories for various output formats: -->
- <property name="help.dir.name" value="help" />
- <property name="html.dir.name" value="html" />
- <property name="pdf.dir.name" value="pdf" />
- <property name="epub.dir.name" value="epub" />
- <property name="help.dir" location="${basedir}/${help.dir.name}" />
- <property name="html.dir" location="${basedir}/${html.dir.name}" />
- <property name="pdf.dir" location="${basedir}/${pdf.dir.name}" />
- <property name="epub.dir" location="${basedir}/${epub.dir.name}" />
- <!-- Libraries used by Ant tasks: -->
- <property name="lib.dir.name" value="lib" />
- <property name="lib.dir" location="${basedir}/${lib.dir.name}" />
- <!-- Aether Ant Tasks configuration -->
- <property name="aether.jar.version" value="1.0.0.v20140518" />
- <property name="aether.jar.checksum"
- value="9008c0c96390eacc0f7fdde542dacbd921f942dcd5c139465e21f8b583942edb995304025bb436cfeeea0b89698ef9dfccf8a027da68cd079669adea8cca381f" />
- <property name="aether.jar.src"
- value="http://search.maven.org/remotecontent?filepath=org/eclipse/aether/aether-ant-tasks/${aether.jar.version}/aether-ant-tasks-${aether.jar.version}-uber.jar" />
- <property name="aether.jar.file" value="${lib.dir}/aether-ant-tasks-uber.jar" />
- <!-- Wikitext download configuration -->
- <property name="wikitext.zip.version" value="1.0.0.v20140518" />
- <property name="wikitext.zip.checksum"
- value="a4c9c3c4c6ff21dea10368b2085021088294b5fd7fc19e445d9670cbdb00390e4095fcccca29d6e58fc42d067af49ef86d6f03f7811d47cf212fe8e2418775b9" />
- <!--
- <property name="wikitext.zip.src"
- value="http://www.eclipse.org/downloads/download.php?file=/mylyn/snapshots/nightly/docs/wikitext-standalone-latest.zip" />
- -->
- <property name="wikitext.zip.src" value="file:///${basedir}/externals/wikitext.zip" />
- <property name="wikitext.zip.file" value="${lib.dir}/wikitext.zip" />
- <property name="wikitext.basename" value="wikitext-standalone" />
- <property name="wikitext.version" value="2.8.0-SNAPSHOT" />
- <!-- Remove generated stuff: -->
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false">
- <fileset dir="${res.dir.name}" />
- <fileset dir="${basedir}" defaultexcludes="false">
- <include name="${help.dir.name}/**" />
- <include name="${html.dir.name}/**" />
- <include name="${pdf.dir.name}/**" />
- <include name="${epub.dir.name}/**" />
- </fileset>
- </delete>
- </target>
- <!-- Download and unpack the wikitext standalone distribution. Unfortunately it is currently available as a nightly build only. -->
- <target name="wikitext.download" description="Download and unpack the wikitext standalone distribution.">
- <condition property="wikitext.zip.file.exists">
- <available file="${wikitext.zip.file}" />
- </condition>
- <sequential unless:set="wikitext.zip.file.exists">
- <mkdir dir="${lib.dir}" />
- <get src="${wikitext.zip.src}"
- dest="${wikitext.zip.file}"
- skipexisting="true"
- usetimestamp="true"
- verbose="true" />
- <fail message="Checksum mismatch for ${wikitext.zip.file}. Please delete it and rerun ant to redownload.">
- <condition>
- <not>
- <checksum file="${wikitext.zip.file}"
- algorithm="SHA-512"
- property="${wikitext.zip.checksum}"
- verifyproperty="checksum.matches" />
- </not>
- </condition>
- </fail>
- <unzip dest="${lib.dir}" src="${wikitext.zip.file}" />
- </sequential>
- </target>
- <!-- Resolves the necessary dependencies: -->
- <target name="init.wikitext"
- description="Resolves the necessary wikitext dependencies."
- depends="wikitext.download">
- <property name="wikitext.dir" location="${lib.dir}/${wikitext.basename}-${wikitext.version}" />
- <path id="wikitext.classpath">
- <fileset dir="${wikitext.dir}">
- <include name="*.jar" />
- </fileset>
- </path>
- </target>
- <!-- Generates the documentation in all supported formats. -->
- <target name="generate.all"
- description="Generates the documentation in all supported formats."
- depends="generate.eclipsehelp" />
- <!-- Generates the documentation as Eclipse help. -->
- <target name="generate.eclipsehelp"
- description="Generates the documentation as Eclipse help from the textile (wikitext) sources."
- depends="init.wikitext">
- <wikitext.conversion src.dir="${src.dir.name}"
- src.file.name="${src.basename}.textile"
- dst.dir="${help.dir.name}"
- dst.file.name="---"
- style="---" />
- </target>
- <!-- Converts a Textile document into Eclipsehelp format. Produces an HTML document and a corresponding toc.xml -->
- <macrodef name="wikitext.conversion"
- description="Converts a textile document into a target format. Produces an HTML document and a corresponding toc.xml">
- <attribute name="src.dir" />
- <attribute name="src.file.name" />
- <attribute name="dst.dir" />
- <attribute name="dst.file.name" />
- <attribute name="style" />
- <sequential>
- <basename property="src.file.basename" file="@{src.file.name}" suffix=".textile" />
- <taskdef classpathref="wikitext.classpath"
- resource="org/eclipse/mylyn/wikitext/core/ant/tasks.properties" />
- <wikitext-to-eclipse-help markupLanguage="Textile"
- multipleOutputFiles="false"
- navigationImages="true"
- formatoutput="true"
- validate="true"
- failOnValidationError="true"
- failOnValidationWarning="false"
- title="YAKINDU Statechart Tools"
- helpPrefix="@{dst.dir}">
- <fileset dir="@{src.dir}">
- <include name="@{src.file.name}" />
- </fileset>
- <stylesheet url="css/style.css" />
- </wikitext-to-eclipse-help>
- <!-- Files have been generated in the source directory, which is bad practice. Move them to the destination
- directory: -->
- <move todir="@{dst.dir}">
- <fileset dir="${src.dir}">
- <include name="${src.file.basename}.html" />
- <include name="${src.file.basename}-toc.xml" />
- </fileset>
- </move>
- <!-- Copy the CSS files to the destination directory: -->
- <copy todir="@{dst.dir}/${css.dir.name}">
- <fileset dir="${css.dir}">
- <include name="*" />
- </fileset>
- </copy>
- <!-- Copy the image files to the destination directory: -->
- <copy todir="@{dst.dir}/${img.dir.name}">
- <fileset dir="${img.dir}">
- <include name="*" />
- </fileset>
- </copy>
- </sequential>
- </macrodef>
- </project>
|