blob: f7efd3d4db8adbaae0f487c8c2d36b4ddcda428c [file] [log] [blame]
Copyright (c) 2019 Kiel University and others.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
SPDX-License-Identifier: EPL-2.0
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
* docs - Builds the documentation website and includes a zipped version
of it.
* purge - A utility task not normally called. Simply removes the target
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
<project name="Webtools Libra" 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="libra-${version}.zip" />
<property name="docsSiteZipFileName" value="libra-${version}" />
<!-- ================================================================= -->
<!-- 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}" />
<!-- Copy to target directory -->
<copy todir="${targetDir}">
<fileset dir="${sourceDir}" />
<!-- ================================================================= -->
<!-- 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}"
<!-- ================================================================= -->
<!-- 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}"
<!-- Produce a zip archive of the documentation site -->
<zip destfile="${sourceDir}/${docsSiteZipFileName}"
<!-- ================================================================= -->
<!-- P U R G E -->
<!-- ================================================================= -->
<target name="purge"
description="Purges the target directory by removing it.">
<delete dir="${targetDir}" />