| <?xml version="1.0" encoding="iso-8859-1"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <project name="FreeMarker Site" default="site" basedir="." |
| xmlns:ivy="antlib:org.apache.ivy.ant" |
| xmlns:docgen="http://freemarker.org/docgen" |
| xmlns:rat="antlib:org.apache.rat.anttasks" |
| > |
| |
| <!-- Ivy project coordinates: --> |
| <property name="moduleOrg" value="org.freemarker" /> |
| <property name="moduleName" value="site" /> |
| <property name="moduleBranch" value="1.0" /> |
| |
| <!-- Will be overidden on the server: --> |
| <property name="server.ivy.repo.root" value="${basedir}/build/dummy-server-ivy-repo" /> |
| |
| <target name="init"> |
| <condition property="deps.available"> |
| <available file=".ivy" /> |
| </condition> |
| <antcall target="_autoget-deps" /> |
| |
| <tstamp> |
| <format property="timeStamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="GMT" /> |
| </tstamp> |
| </target> |
| |
| <target name="site" depends="init"> |
| <!-- Ensure that we have an empty build/site directory: --> |
| <mkdir dir="build/site"/> |
| <delete includeEmptyDirs="true"> |
| <fileset dir="build/site"> |
| <include name="*/**"/> |
| </fileset> |
| </delete> |
| |
| <!-- Generate the new content: --> |
| <ivy:cachepath pathid="ivy.dep" /> |
| <taskdef resource="org/freemarker/docgen/antlib.properties" |
| uri="http://freemarker.org/docgen" |
| classpathref="ivy.dep" |
| /> |
| |
| <docgen:transform |
| srcdir="src/main/docgen" destdir="build/site" |
| offline="@{offline}" |
| /> |
| |
| <!-- Copy project meta-data file: --> |
| <copy file="doap.rdf" todir="build/site" /> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="build"/> |
| </target> |
| |
| <!-- ================================================================== --> |
| <!-- Dependency management (keep it exactly identical for all projects) --> |
| <!-- ================================================================== --> |
| |
| <target name="_autoget-deps" unless="deps.available"> |
| <antcall target="update-deps" /> |
| </target> |
| |
| <target name="update-deps" |
| description="Gets the latest version of the dependencies from the Web" |
| > |
| <echo>Getting dependencies...</echo> |
| <echo>-------------------------------------------------------</echo> |
| <ivy:settings id="remote" url="https://freemarker.apache.org/repos/ivy/ivysettings-remote.xml" /> |
| <!-- Build an own repository that will serve us even offline: --> |
| <ivy:retrieve settingsRef="remote" sync="true" |
| ivypattern=".ivy.part/repo/[organisation]/[module]/ivy-[revision].xml" |
| pattern=".ivy.part/repo/[organisation]/[module]/[artifact]-[revision].[ext]" |
| /> |
| <echo>-------------------------------------------------------</echo> |
| <echo>*** Successfully acquired dependencies from the Web ***</echo> |
| <echo>Eclipse users: Now right-click on ivy.xml and Resolve! </echo> |
| <echo>-------------------------------------------------------</echo> |
| <!-- Only now that we got all the dependencies will we delete anything. --> |
| <!-- Thus a net or repo outage doesn't left us without the dependencies. --> |
| |
| <!-- Save the resolution cache from the soon coming <delete>: --> |
| <move todir=".ivy.part/update-deps-reso-cache"> |
| <fileset dir=".ivy/update-deps-reso-cache" /> |
| </move> |
| <!-- Drop all the old stuff: --> |
| <delete dir=".ivy" /> |
| <!-- And use the new stuff instead: --> |
| <move todir=".ivy"> |
| <fileset dir=".ivy.part" /> |
| </move> |
| </target> |
| |
| <!-- Do NOT call this from 'clean'; offline guys would stuck after that. --> |
| <target name="clean-deps" |
| description="Deletes all dependencies" |
| > |
| <delete dir=".ivy" /> |
| </target> |
| |
| <target name="report-deps" |
| description="Creates a HTML document that summarizes the dependencies." |
| > |
| <mkdir dir="build/deps-report" /> |
| <ivy:resolve /> |
| <ivy:report todir="build/deps-report" /> |
| </target> |
| |
| <target name="rat" description="Generates Apache RAT report"> |
| <ivy:cachepath pathid="ivy.dep" /> |
| <taskdef |
| uri="antlib:org.apache.rat.anttasks" |
| resource="org/apache/rat/anttasks/antlib.xml" |
| classpathref="ivy.dep" |
| /> |
| |
| <rat:report reportFile="build/rat-report.txt"> |
| <fileset dir="" excludesfile="rat-excludes" /> |
| </rat:report> |
| <echo level="info"><!-- |
| -->Rat reports were written into build/rat-report.txt<!-- |
| --></echo> |
| </target> |
| |
| </project> |