diff options
author | Leif Johansson <leifj@sunet.se> | 2011-11-03 10:53:40 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-11-03 10:53:40 +0100 |
commit | b5c41b83249677bf1dec46de4a7ce97fee55729e (patch) | |
tree | 5e894d0a4b132f41a38a7004e8f65d40dcf037be /src/installer/resources/build.xml | |
parent | 0a90384a9c7d840e88d9636271e8393a514647a0 (diff) |
import 1.1.31.1.3
Diffstat (limited to 'src/installer/resources/build.xml')
-rwxr-xr-x[-rw-r--r--] | src/installer/resources/build.xml | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/src/installer/resources/build.xml b/src/installer/resources/build.xml index ae85dfa..32bfbd7 100644..100755 --- a/src/installer/resources/build.xml +++ b/src/installer/resources/build.xml @@ -1,46 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> <project name="Shibboleth Discovery Service" basedir="../../.." default="install"> - <property name="installer.dir" value="${basedir}/src/installer" /> - <property name="resources.dir" value="${installer.dir}/resources" /> - <property name="webapp.dir" value="${basedir}/src/main/webapp" /> - <property name="war.name" value="discovery" /> + <property name="installer.dir" value="${basedir}/src/installer"/> + <property name="resources.dir" value="${installer.dir}/resources"/> + <property name="webapp.dir" value="${basedir}/src/main/webapp"/> + <property name="war.name" value="discovery"/> <!-- Installation specific property file --> - <property file="${resources.dir}/install.properties" /> + <property file="${resources.dir}/install.properties"/> <!-- Load ant-contrib tasks --> - <taskdef resource="net/sf/antcontrib/antlib.xml" /> + <taskdef resource="net/sf/antcontrib/antlib.xml"/> + + <!-- Load Internet2 ant extensions --> + <taskdef resource="edu/internet2/middleware/ant/antlib.xml"/> <!-- install - for deployment --> <target name="install" description="Creates the discovery service home directory, install configuration files, and create the service's WAR."> - <input message="Is this a new installation? Answering 'yes' will overwrite your current configuration." - addproperty="new.install" - validargs="yes,no" - defaultvalue="no" /> - + <input message="Where should the Shibboleth Discovery Service software be installed?" addproperty="ds.home.input" defaultvalue="${ds.home}"/> + <var name="ds.home" value="${ds.home.input}"/> + + <pathToAbsolutePath path="${ds.home}" addproperty="ds.home.path"/> + <pathToUrl path="${ds.home}" addproperty="ds.home.url"/> + <if> - <equals arg1="${new.install}" arg2="yes" /> + <available file="${ds.home.path}" property="ds.home.exists"/> <then> - <input message="Where should the Shibboleth Discovert Service software be installed?" - addproperty="ds.home.input" - defaultvalue="${ds.home}" /> - <var name="ds.home" value="${ds.home.input}" /> + <input message="The directory '${ds.home.path}' already exists. Would you like to overwrite your existing configuration?" addproperty="install.config" validargs="yes,no" defaultvalue="no"/> + </then> + <else> + <var name="install.config" value="yes"/> + </else> + </if> + <if> + <equals arg1="${install.config}" arg2="yes"/> + <then> <propertyfile file="${resources.dir}/install.properties"> - <entry key="ds.home" value="${ds.home}" /> + <entry key="ds.home" value="${ds.home}"/> </propertyfile> - <mkdir dir="${ds.home}" /> - <mkdir dir="${ds.home}/conf" /> - <mkdir dir="${ds.home}/logs" /> - <mkdir dir="${ds.home}/metadata" /> - <mkdir dir="${ds.home}/war" /> + <mkdir dir="${ds.home}"/> + <mkdir dir="${ds.home}/conf"/> + <mkdir dir="${ds.home}/logs"/> + <mkdir dir="${ds.home}/metadata"/> + <mkdir dir="${ds.home}/war"/> <copy todir="${ds.home}/conf" preservelastmodified="true" overwrite="true"> - <fileset dir="${resources.dir}" includes="wayfconfig.xml,logging.xml" /> + <fileset dir="${resources.dir}" includes="wayfconfig.xml,logging.xml"/> <filterset begintoken="$" endtoken="$"> - <filter token="DS_HOME" value="${ds.home}" /> + <filter token="DS_HOME" value="${ds.home}"/> </filterset> </copy> </then> @@ -49,20 +59,20 @@ <!-- create - always - the web.xml --> <copy file="${webapp.dir}/WEB-INF/web.xml" todir="${installer.dir}" preservelastmodified="true" overwrite="true"> <filterset begintoken="$" endtoken="$"> - <filter token="DS_HOME" value="${ds.home}" /> + <filter token="DS_HOME" value="${ds.home}"/> </filterset> </copy> <!-- build the war file --> <war warfile="${ds.home}/war/${war.name}.war" webxml="${installer.dir}/web.xml"> - <lib dir="${basedir}/lib" /> - <webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml" /> - <fileset dir="${webapp.dir}" excludes="WEB-INF/**" /> + <lib dir="${basedir}/lib"/> + <webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml"/> + <fileset dir="${webapp.dir}" excludes="WEB-INF/**"/> </war> <!-- Remove generated web.xml --> - <delete file="${installer.dir}/web.xml" /> + <delete file="${installer.dir}/web.xml"/> </target> -</project>
\ No newline at end of file +</project> |