| <?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="pack" basedir="." |
| xmlns:ivy="antlib:org.apache.ivy.ant" |
| xmlns:docgen="http://freemarker.org/docgen" |
| > |
| |
| <!-- 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"> |
| <!-- Ensure that we have an empty build/site directory: --> |
| <mkdir dir="build/docgen"/> |
| <delete includeEmptyDirs="true"> |
| <fileset dir="build/docgen"> |
| <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/docgen" |
| offline="@{offline}" |
| /> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="build"/> |
| </target> |
| |
| <target name="all" depends="clean, site"/> |
| |
| <target name="pack" depends="site"> |
| <tar tarfile="build/site.tar" basedir="build/docgen"/> |
| <mkdir dir="build/artifacts" /> |
| <gzip zipfile="build/artifacts/site.tar.gz" src="build/site.tar"/> |
| <delete file="build/site.tar"/> |
| </target> |
| |
| <target name="artifacts" depends="pack" |
| description="Creates the artifacts for Ivy." |
| /> |
| |
| |
| <!-- ================================================================== --> |
| <!-- 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="http://freemarker.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="publish-override" depends="artifacts" |
| description="Ivy-publishes THIS project locally as an override" |
| > |
| <ivy:resolve /> |
| <ivy:publish |
| pubrevision="${moduleBranch}-branch-head" |
| overwrite="true" forcedeliver="true" |
| resolver="freemarker-devel-local-override" |
| > |
| <artifacts pattern="build/artifacts/[artifact].[ext]" /> |
| </ivy:publish> |
| <echo>-------------------------------------------------------</echo> |
| <echo>*** Don't forget to `ant unpublish-override` later! ***</echo> |
| </target> |
| |
| <target name="unpublish-override" |
| description="Undoes publish-override (made in THIS project)" |
| > |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override/${moduleOrg}/${moduleName}" /> |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache/${moduleOrg}/${moduleName}" /> |
| </target> |
| |
| <target name="unpublish-override-all" |
| description="Undoes publish-override-s made in ALL projects" |
| > |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache" /> |
| </target> |
| |
| <target name="uninstall" |
| description="Deletes external files created by FreeMarker developement" |
| > |
| <delete dir="${user.home}/.ivy2/freemarker-devel-cache" /> |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> |
| <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache " /> |
| </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> |
| |
| <!-- |
| This meant to be called on the Continuous Integration server, so the |
| integration builds appear in the freemarker.org public Ivy repository. |
| The artifacts must be already built. |
| --> |
| <target name="server-publish-last-build" |
| description="(For the Continuous Integration server only)" |
| > |
| <delete dir="build/dummy-server-ivy-repo" /> |
| <ivy:resolve /> |
| <ivy:publish |
| pubrevision="${moduleBranch}-branch-head" |
| overwrite="true" forcedeliver="true" |
| resolver="server-publishing-target" |
| > |
| <artifacts pattern="build/artifacts/[artifact].[ext]" /> |
| </ivy:publish> |
| </target> |
| |
| </project> |