| <!-- |
| Assembles the distribution of the whole thing and publishes (fancy word for |
| "copies") it at a target directory. By using only the tasks publish and purge, |
| this script can also be used simply to delete directories or copy one directory |
| over to a target directory. Here's the available tasks: |
| |
| * publish - The most important task. If only this task is called, the update |
| site (whose location is specified by ${sourceDir}) is published |
| at ${targetDir}. |
| * zipIt - Includes a zipped version of the update site in the published |
| version. |
| * docs - Builds the documentation website and includes a zipped version |
| of it. |
| |
| * purge - A utility task not normally called. Simply removes the target |
| directory. |
| |
| Mandatory properties: |
| |
| * targetDir - The directory to publish everything at. This thing is emptied |
| before things get published, so be careful to lose everything. |
| This property MUST be set. |
| |
| Important properties: |
| |
| * version - The ELK version. This is used to assemble ZIP file names. |
| Defaults to "nightly". |
| |
| Optional properties: |
| |
| * sourceDir - The source directory where the update site was built. Defaults |
| to where Maven builds the thing and does not usually have to |
| be set. |
| * hugoPath - Path to the Hugo executable. If Hugo is on the path, this does |
| not need to be set at all. If it is not, the full path needs |
| to be supplied to this script. Only used to execute the docs |
| task. |
| --> |
| <project name="Eclipse Layout Kernel" basedir="."> |
| |
| <!-- ================================================================= --> |
| <!-- P R O P E R T I E S --> |
| <!-- ================================================================= --> |
| |
| <!-- Important --> |
| <property name="version" value="nightly" /> |
| |
| <!-- Optional --> |
| <property name="sourceDir" value="target/repository/" /> |
| <property name="hugo" value="hugo" /> |
| |
| <!-- Internal --> |
| <property name="updateSiteZipFileName" value="elk-${version}.zip" /> |
| <property name="docsSiteZipFileName" value="elk-${version}-docs.zip" /> |
| |
| |
| <!-- ================================================================= --> |
| <!-- P U B L I S H --> |
| <!-- ================================================================= --> |
| <target name="publish" |
| description="Publishes the content of a source directory in a target directory."> |
| |
| <!-- Empty the target directory --> |
| <delete dir="${targetDir}" /> |
| |
| <!-- Recreate the target directory. It can happen that this task |
| fails seemingly at random. To be sure, we wrap it in a retry |
| task that repeats the mkdir call up to 10 times, with a pause |
| between each pair of attempts (the retrydelay is measured in |
| milliseconds). --> |
| <retry retrycount="10" retrydelay="1000"> |
| <mkdir dir="${targetDir}" /> |
| </retry> |
| |
| <!-- Copy to target directory --> |
| <copy todir="${targetDir}"> |
| <fileset dir="${sourceDir}" /> |
| </copy> |
| </target> |
| |
| |
| <!-- ================================================================= --> |
| <!-- Z I P I T --> |
| <!-- ================================================================= --> |
| <target name="zipIt" |
| description="Produces a zip file from the update site directory."> |
| |
| <!-- Produce a zip archive of the update site --> |
| <zip destfile="${sourceDir}/${updateSiteZipFileName}" |
| basedir="${sourceDir}" |
| excludes="${docsSiteZipFileName}" |
| /> |
| </target> |
| |
| |
| <!-- ================================================================= --> |
| <!-- D O C S --> |
| <!-- ================================================================= --> |
| <target name="docs" |
| description="Compiles and zips the documentation website."> |
| |
| <!-- Empty the compilation directory --> |
| <delete dir="../../docs/public/" /> |
| |
| <!-- Invoke hugo to compile our documentation website --> |
| <exec executable="${hugo}" |
| dir="../../docs/" |
| /> |
| |
| <!-- Produce a zip archive of the documentation site --> |
| <zip destfile="${sourceDir}/${docsSiteZipFileName}" |
| basedir="../../docs/public/" |
| /> |
| </target> |
| |
| |
| <!-- ================================================================= --> |
| <!-- P U R G E --> |
| <!-- ================================================================= --> |
| <target name="purge" |
| description="Purges the target directory by removing it."> |
| |
| <delete dir="${targetDir}" /> |
| </target> |
| |
| </project> |