[java-identity-provider] 04/07: IDP-1499 Installer: Rewrite build.xml to call the new installer

Rod Widdowson rdw at steadingsoftware.com
Sat Oct 19 08:04:13 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e9f8f38b5a2cb0018b76d8fdbe19d76d6470a750

commit e9f8f38b5a2cb0018b76d8fdbe19d76d6470a750
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Oct 18 14:10:46 2019 +0100

    IDP-1499 Installer: Rewrite build.xml to call the new installer
    
    https://issues.shibboleth.net/jira/browse/IDP-1499
---
 idp-distribution/src/main/resources/bin/build.xml | 751 +---------------------
 1 file changed, 8 insertions(+), 743 deletions(-)

diff --git a/idp-distribution/src/main/resources/bin/build.xml b/idp-distribution/src/main/resources/bin/build.xml
index b81a091..000c84a 100644
--- a/idp-distribution/src/main/resources/bin/build.xml
+++ b/idp-distribution/src/main/resources/bin/build.xml
@@ -1,7 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="Shibboleth Identity Provider V3" basedir=".." default="install"
-    xmlns:if="ant:if"
-    xmlns:unless="ant:unless">  
+<project name="Shibboleth Identity Provider V4" default="install">  
 
     <taskdef resource="net/shibboleth/idp/installer/ant.xml" />
 
@@ -16,749 +14,16 @@
         build-war:       Create the war file
         install:         Copies files from the distribution to the specified target and then
                          invokes install-nocopy
-
-        PROPERTIES:
-        The following properties are used.  If they are not specified on the command line then
-        they will be prompted for if needed.
-
-        idp.src.dir (update only):  Where to install from.  Default is basedir
-        idp.target.dir (all): where to install to.  Default is basedir for build-war, shibboleth-idp otherwise
-        idp.host.name: If we are creating certificates
-        idp.uri.subject.alt.name: If we are creating certificates.  Defaulted
-        idp.sealer.password:
-        idp.sealer.alias:
-        idp.keystore.password:
-        idp.keysize: to change from the the default of 3072
-        idp.scope: The scope to assert.  If present this should also be present in idp.merge.properties
-        idp.merge.properties: The name of a property file to merge with idp.properties.  This file only
-          used when doing the initial create of idp.properties, and is deleted after processing
-            - if idp.noprompt is set, then this file should contain a line setting idp.entityID.
-            - if idp.sealer.password is set, then this file should contain a line setting idp.sealer.storePassword and idp.sealer.keyPassword
-            - if idp.scope is present, then this file should contain a line setting idp.scope
-        services.merge.properties: The name of a property file to merge with services.properties
-            - if idp.is.V2 is set, then this file should contain a line setting
-                idp.service.relyingparty.resources=shibboleth.LegacyRelyingPartyResolverResources
-        nameid.merge.properties: The name of a property file to merge with saml-nameid.properties
-            - if idp.is.V2 is set, then this file should contain lines enabling legacy nameid generation
-        idp.property.file: The name of a property file to fill in some or all of the above. This file is deleted after processing.
-        idp.no.tidy: Do not delete the two above files (debug only)
-        idp.jetty.config: Copy jetty configuration from distribution (Unsupported)
-        ldap.merge.properties:  The name of a property file to merge with ldap.properties
-        idp.conf.filemode (default "600"): The permissions to mark the files in conf with (UNIX only).
-        idp.conf.credentials.filemode (default "600"): The permissions to mark the files in conf with (UNIX only).
-
-
-        The property idp.noprompt will cause a failure rather than a prompt.
-    -->
-
-    <macrodef name="TGT" description="log the invocation of an Ant target">
-        <text name="t" description="name of the target being invoked"/>
-        <sequential>
-            <echo append="true" file="idp_ant.log">target: @{t}${line.separator}</echo>
-        </sequential>
-    </macrodef>
-
-    <target name="init">
-        <tstamp />
-        <hostinfo />
-        <TGT>init</TGT>
-    </target>
-
-    <target name="install" depends="init, preload, getsource, gettarget, v2v3prepopulate, allinput, copy-distribution, copy-jetty-distribution, install-nocopy, tidy" />
-    <target name="install-nocopy" depends="init, preload, gettarget, v2v3prepopulate, allinput, genkeys, upgrade, metadata-gen, reprotect, build-war, tidy" />
-
-    <!-- USER INPUT -->
-    <target name="preload" if="idp.property.file">
-        <TGT>preload</TGT>
-        <property file="${idp.property.file}"/>
-    </target>
-    <target name="allinput" depends="gettarget, checkproperties, gethostname, getentityid, geturisubjectaltname, setscope, askscope, writescope, getkeystorepassword, getsealerpassword, getsealeralias" />
-
-    <target name="gethostname" if="idp.ask.hostname" depends="checkproperties">
-        <TGT>gethostname</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Hostname:" addproperty="idp.host.name" defaultvalue="${NAME}.${DOMAIN}" />
-    </target>
-
-    <target name="geturisubjectaltname" if="idp.generate.altname" depends="checkproperties, gethostname">
-        <TGT>geturisubjectname</TGT>
-        <property name="idp.uri.subject.alt.name" value="https://${idp.host.name}/idp/shibboleth" />
-    </target>
-
-    <target name="getkeystorepassword" if="idp.ask.keystore.password" depends="checkproperties">
-        <TGT>getkeystorepassword</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Backchannel PKCS12 Password: " addproperty="idp.keystore.password">
-            <handler classname="net.shibboleth.idp.installer.ant.impl.PasswordHandler"/>
-        </input>
-    </target>
-
-    <target name="getsealerpassword" if="idp.ask.sealer.password" depends="checkproperties">
-        <TGT>getsealerpassword</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Cookie Encryption Key Password: " addproperty="idp.sealer.password">
-            <handler classname="net.shibboleth.idp.installer.ant.impl.PasswordHandler"/>
-        </input>
-        <echo file="${idp.merge.properties}" append="yes">
-            idp.sealer.storePassword=${idp.sealer.password}
-        </echo>
-        <echo file="${idp.merge.properties}" append="yes">
-            idp.sealer.keyPassword=${idp.sealer.password}
-        </echo>
-    </target>
-
-    <target name="getsealeralias" if="idp.ask.sealer.alias" depends="checkproperties">
-        <TGT>getsealeralias</TGT>
-        <!--
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Sealer Alias" addproperty="idp.sealer.alias" defaultvalue="secret"/>
-        -->
-        <property name="idp.sealer.alias" value="secret"/>
-    </target>
-
-    <target name="getsource" unless="idp.src.dir">
-        <TGT>getsource</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Source (Distribution) Directory (press <enter> to accept default):" addproperty="idp.src.dir" defaultvalue="${basedir}" />
-    </target>
-
-    <target name="gettarget" depends="target-properties, setmerge, setservicemerge, target-src-default, target-nosrc-default, prompttarget, settarget, setfilemode, setcredentialsfilemode" />
-
-    <target name="setmerge" unless="idp.merge.properties.present">
-        <property name="idp.merge.properties" value="replace.properties" />
-    </target>
-
-    <target name="setservicemerge" unless="services.merge.properties.present">
-        <property name="services.merge.properties" value="replace.services.properties" />
-    </target>
-
-    <target name="setfilemode" unless="idp.conf.filemode.present">
-        <property name="idp.conf.filemode" value="600" />
-    </target>
-
-    <target name="setcredentialsfilemode" unless="idp.conf.credentials.filemode.present">
-        <property name="idp.conf.credentials.filemode" value="600" />
-    </target>
-
-    <target name="setnameidmerge" unless="nameid.merge.properties.present">
-        <property name="nameid.merge.properties" value="replace.nameid.properties" />
-    </target>
-
-    <target name="target-src-default" unless="idp.src.dir.present">
-        <TGT>target-src-default</TGT>
-        <!-- if the source isn't set up then the default is basedir -->
-        <property name="idp.target.default" value="${basedir}" />
-    </target>
-
-    <target name="target-nosrc-default" if="idp.src.dir.present">
-        <TGT>target-nosrc-default</TGT>
-        <!-- if the source is set up then the default must not be basedir -->
-        <property name="idp.target.default" value="/opt/shibboleth-idp" />
-    </target>
-
-    <target name="prompttarget" if="idp.ask.target">
-        <TGT>prompttarget</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="Installation Directory:" addproperty="idp.target.dir" defaultvalue="${idp.target.default}" />
-    </target>
-
-    <target name="settarget" if="idp.set.target">
-        <TGT>settarget</TGT>
-        <property name="idp.target.dir" value="${basedir}" />
-    </target>
-
-    <target name="askentityId" if="idp.ask.entityid" depends="checkproperties">
-        <TGT>askentityId</TGT>
-        <fail if="idp.noprompt">Input needed, silence demanded</fail>
-        <input message="SAML EntityID:" addproperty="idp.entityID" defaultvalue="https://${idp.host.name}/idp/shibboleth" />
-        <property name="idp.uri.subject.alt.name" value="${idp.entityID}" />
-    </target>
-
-    <target name="writeentityId" if="idp.write.entityid" depends="askentityId, checkproperties">
-        <echo file="${idp.merge.properties}" append="yes">
-            idp.entityID=${idp.entityID}
-        </echo>
-    </target>
-
-    <target name="getentityid" depends="checkproperties, askentityId, writeentityId"/>
-
-    <target name="setscope" if="idp.set.scope" depends="checkproperties">
-        <TGT>setscope</TGT>
-        <property name="idp.scope" value="${DOMAIN}"/>
-    </target>
-
-    <target name="setkeysize" if="idp.set.keysize" depends="checkproperties">
-        <TGT>setkeysize</TGT>
-        <property name="idp.keysize" value="3072"/>
-    </target>
-
-    <target name="askscope" if="idp.ask.scope" depends="checkproperties">
-        <TGT>askscope</TGT>
-        <input message="Attribute Scope:" addproperty="idp.scope" defaultvalue="${DOMAIN}" />
-    </target>
-
-    <target name="writescope" if="idp.write.scope" depends="setscope, askscope">
-        <TGT>writescope</TGT>
-        <echo file="${idp.merge.properties}" append="yes">
-           idp.scope=${idp.scope}
-        </echo>
-    </target>
-    
-    <!--
-     KEY MANAGEMENT
-    -->
-
-    <target name="genkeys" depends="init, preload, checkproperties, setkeysize, signing-key, encryption-key, backchannel-key, sealer" />
-
-    <target name="checkproperties" depends="gettarget, v2detect, target-properties">
-        <TGT>checkproperties</TGT>
-        <condition property="idp.metadata.present">
-            <or>
-                <istrue value="${idp.is.V2}" />
-                <available file="${idp.target.dir}/metadata/idp-metadata.xml" />
-            </or>
-        </condition>
-        <available property="idp.sealer.present" file="${idp.target.dir}/credentials/sealer.kver" />
-        <available property="idp.properties.present" file="${idp.target.dir}/conf/idp.properties" />
-        <available property="nameid.properties.present" file="${idp.target.dir}/conf/saml-nameid.properties" />
-        <available property="ldap.properties.present" file="${idp.target.dir}/conf/ldap.properties" />
-        <available property="services.properties.present" file="${idp.target.dir}/conf/services.properties" />
-        <condition property="idp.will.call.certgen">
-          <!-- We will call CertGen if there is no relying party.  Otherwise the certificates are deemed to be there -->
-          <not>
-            <istrue value="${idp.relying.party.present}" />
-          </not>
-        </condition>
-
-        <condition property="idp.ask.entityid">
-            <!-- Ask for EntityID if
-                         - The merge properties file (which has to contain
-                                            it if it is present) wasn't provided   AND
-                         - This is not an upgrade                                  AND
-                         - It wasn'r provided on the command line -->
-            <and>
-                <not>
-                    <istrue value="${idp.merge.properties.present}" />
-                </not>
-                <not>
-                    <istrue value="${idp.properties.present}" />
-                </not>
-                <not>
-                    <istrue value="${idp.entityID.present}" />
-                </not>
-            </and>
-        </condition>
-
-        <condition property="idp.write.entityid">
-            <!-- Do we write it to merge properties?  If
-                         - The merge properties file (which has to contain
-                                            it if it is present) wasn't provided   AND
-                         - This is not an upgrade                                  AND
-                         - It was provided on the command line
-                 This is the same as saying "all the cases where we ould ask, plus if its present" -->
-            <or>
-                <istrue value="${idp.ask.entityid}" />
-                <istrue value="${idp.entityID.present}" />
-            </or>
-        </condition>
-
-        <condition property="idp.ask.hostname">
-            <!-- We ask for host name if there is no host name and we will call certgen or ask for entityID -->
-            <and>
-                <not>
-                    <isset property="idp.host.name" />
-                </not>
-                <or>
-                    <istrue value="${idp.will.call.certgen}" />
-                    <istrue value="${idp.ask.entityid}" />
-                </or>
-            </and>
-        </condition>
-
-        <condition property="idp.ask.scope">
-            <!-- We ask for scope if there is no scope and we allow user input and there is no idp.properties file -->
-            <and>
-                <not>
-                    <isset property="idp.scope" />
-                </not>
-                <not>
-                    <isset property="idp.noprompt" />
-                </not>
-                <isfalse value="${idp.properties.present}" />
-            </and>
-        </condition>
-
-        <condition property="idp.set.scope">
-            <!-- We set scope if there is no scope and we do not allow user input and there is no idp.properties file -->
-            <and>
-                <not>
-                    <isset property="idp.scope" />
-                </not>
-                <isset property="idp.noprompt" />
-                <isfalse value="${idp.properties.present}" />
-            </and>
-        </condition>
-
-        <condition property="idp.set.keysize">
-            <not>
-                <isset property="idp.keysize"/>
-            </not>
-		</condition>
-
-        <condition property="idp.write.scope">
-            <!-- We write the scope if we set it, ask for it, or if it's supplied -->
-            <or>
-                <isset property="idp.scope" />
-                <isset property="idp.ask.scope" />
-                <isset property="idp.write.scope" />
-            </or>
-        </condition>
-
-        <condition property="idp.generate.altname">
-            <!-- We ask for alt name if there is no alt name and we will call certgen -->
-            <and>
-                <not>
-                    <isset property="idp.uri.subject.alt.name" />
-                </not>
-                <istrue value="${idp.will.call.certgen}" />
-            </and>
-        </condition>
-
-        <condition property="idp.ask.keystore.password">
-            <!-- We ask for keystore password if there is no keystore password and
-                 the relying party (and hence keys) are not there -->
-            <and>
-                <not>
-                    <isset property="idp.keystore.password" />
-                </not>
-                <not>
-                    <istrue value="${idp.relying.party.present}" />
-                </not>
-            </and>
-        </condition>
-
-        <condition property="idp.ask.sealer.password">
-            <!-- We ask for sealer password if there is no sealer password and no sealer -->
-            <and>
-                <not>
-                    <isset property="idp.sealer.password" />
-                </not>
-                <not>
-                    <istrue value="${idp.sealer.present}" />
-                </not>
-            </and>
-        </condition>
-
-        <condition property="idp.ask.sealer.alias">
-            <!-- We ask for sealer alias if there is no sealer alias and no sealer -->
-            <and>
-                <not>
-                    <isset property="idp.sealer.alias" />
-                </not>
-                <not>
-                    <istrue value="${idp.sealer.present}" />
-                </not>
-            </and>
-        </condition>
-
-        <condition property="idp.merge.ldap.properties">
-            <!-- We merge ldap.properties if ldap.merge.properties is set  AND ldap.properties does NOT exist-->
-            <and>
-                <isset property="ldap.merge.properties" />
-                <not>
-                    <istrue value="${ldap.properties.present}" />
-                </not>
-            </and>
-        </condition>
-    </target>
-
-    <target name="target-properties">
-        <TGT>target-properties</TGT>
-        <condition property="idp.ask.target">
-            <and>
-                <not>
-                    <isset property="idp.target.dir" />
-                </not>
-                <not>
-                    <isset property="idp.noprompt" />
-                </not>
-            </and>
-        </condition>
-
-        <condition property="idp.set.target">
-            <and>
-                <not>
-                    <isset property="idp.target.dir" />
-                </not>
-                <isset property="idp.noprompt" />
-            </and>
-        </condition>
-
-        <condition property="idp.src.dir.present">
-            <isset property="idp.src.dir" />
-        </condition>
-
-        <condition property="idp.entityID.present">
-            <!-- capture now before it is overwritten -->
-            <isset property="idp.entityID" />
-        </condition>
-
-        <condition property="idp.merge.properties.present">
-            <isset property="idp.merge.properties" />
-        </condition>
-
-        <condition property="nameid.merge.properties.present">
-            <isset property="nameid.merge.properties" />
-        </condition>
-
-        <condition property="services.merge.properties.present">
-            <isset property="services.merge.properties" />
-        </condition>
-
-        <condition property="idp.conf.filemode.present">
-            <isset property="idp.conf.filemode"/>
-        </condition>
-
-        <condition property="idp.conf.credentials.filemode.present">
-            <isset property="idp.conf.credentials.filemode"/>
-        </condition>
-    </target>
-
-    <target name="signing-key" unless="idp.relying.party.present" depends="gethostname, geturisubjectaltname">
-        <TGT>signing-key</TGT>
-        <echo>Generating Signing Key, CN = ${idp.host.name} URI = ${idp.uri.subject.alt.name} ...</echo>
-        <mkdir dir="${idp.target.dir}/credentials"/>
-        <selfsignedcert hostname="${idp.host.name}" privateKeyFile="${idp.target.dir}/credentials/idp-signing.key" certificateFile="${idp.target.dir}/credentials/idp-signing.crt" uriSubjectAltNames="${idp.uri.subject.alt.name}"  keysize="${idp.keysize}"/>
-        <echo>...done</echo>
-    </target>
-
-    <target name="encryption-key" unless="idp.relying.party.present" depends="gethostname, geturisubjectaltname">
-        <TGT>encryption-key</TGT>
-        <echo>Creating Encryption Key, CN = ${idp.host.name} URI = ${idp.uri.subject.alt.name} ...</echo>
-        <mkdir dir="${idp.target.dir}/credentials"/>
-        <selfsignedcert hostname="${idp.host.name}" privateKeyFile="${idp.target.dir}/credentials/idp-encryption.key" certificateFile="${idp.target.dir}/credentials/idp-encryption.crt" uriSubjectAltNames="${idp.uri.subject.alt.name}"  keysize="${idp.keysize}"/>
-        <echo>...done</echo>
-    </target>
-
-    <target name="backchannel-key" unless="idp.relying.party.present" depends="getkeystorepassword, gethostname, geturisubjectaltname">
-        <TGT>backchannel-key</TGT>
-        <echo>Creating Backchannel keystore, CN = ${idp.host.name} URI = ${idp.uri.subject.alt.name} ...</echo>
-        <mkdir dir="${idp.target.dir}/credentials"/>
-        <selfsignedcert hostname="${idp.host.name}" keystoreFile="${idp.target.dir}/credentials/idp-backchannel.p12" certificateFile="${idp.target.dir}/credentials/idp-backchannel.crt" keystorePassword="${idp.keystore.password}" uriSubjectAltNames="${idp.uri.subject.alt.name}" keysize="${idp.keysize}" />
-        <echo>...done</echo>
-    </target>
-
-    <target name="sealer" unless="idp.sealer.present" depends="getsealerpassword, getsealeralias">
-        <TGT>sealer</TGT>
-        <echo>Creating cookie encryption key files...</echo>
-        <mkdir dir="${idp.target.dir}/credentials"/>
-        <keystorestrategy keystoreFile="${idp.target.dir}/credentials/sealer.jks" versionFile="${idp.target.dir}/credentials/sealer.kver" keyAlias="${idp.sealer.alias}" keystorePassword="${idp.sealer.password}" />
-        <echo>...done</echo>
-    </target>
-
-    <!--
-     GENERAL V3 TO V3 UPGRADE
-    -->
-
-    <target name="upgrade" depends="editproperties, editservicesproperties, editnameidproperties, editldapproperties, handleeditwebapp">
-        <TGT>upgrade</TGT>
-
-        <!-- conf: copy from dist if not already present -->
-        <mkdir dir="${idp.target.dir}/conf" />
-        <copy todir="${idp.target.dir}/conf">
-            <fileset dir="${idp.target.dir}/dist/conf" includes="**/*">
-                <present present="srconly" targetdir="${idp.target.dir}/conf" />
-            </fileset>
-        </copy>
-
-        <!-- flows: copy from dist if not already present -->
-        <mkdir dir="${idp.target.dir}/flows" />
-        <copy todir="${idp.target.dir}/flows">
-            <fileset dir="${idp.target.dir}/dist/flows" includes="**/*">
-                <present present="srconly" targetdir="${idp.target.dir}/flows" />
-            </fileset>
-        </copy>
-
-        <!-- messages: copy from dist if not already present -->
-        <mkdir dir="${idp.target.dir}/messages" />
-        <copy todir="${idp.target.dir}/messages">
-            <fileset dir="${idp.target.dir}/dist/messages" includes="**/*">
-                <present present="srconly" targetdir="${idp.target.dir}/messages" />
-            </fileset>
-        </copy>
-
-        <!-- views: copy from dist if not already present -->
-        <mkdir dir="${idp.target.dir}/views" />
-        <copy todir="${idp.target.dir}/views">
-            <fileset dir="${idp.target.dir}/dist/views" includes="**/*">
-                <present present="srconly" targetdir="${idp.target.dir}/views" />
-            </fileset>
-        </copy>
-
-        <!-- Other dirs -->
-        <mkdir dir="${idp.target.dir}/logs" />
-    </target>
-
-    <target name="editproperties" depends="gettarget, getentityid" unless="idp.properties.present">
-        <TGT>editproperties</TGT>
-        <mkdir dir="${idp.target.dir}/conf" />
-        <mergeproperties inFile="${idp.target.dir}/dist/conf/idp.properties" outFile="${idp.target.dir}/conf/idp.properties" mergeFile="${idp.merge.properties}" />
-    </target>
-
-    <target name="editservicesproperties" depends="gettarget" if="idp.is.V2" unless="services.properties.present">
-        <TGT>editservicesproperties</TGT>
-        <mkdir dir="${idp.target.dir}/conf" />
-        <mergeproperties inFile="${idp.target.dir}/dist/conf/services.properties" outFile="${idp.target.dir}/conf/services.properties" mergeFile="${services.merge.properties}" />
-    </target>
-
-    <target name="editnameidproperties" depends="gettarget" if="idp.is.V2" unless="nameid.properties.present">
-        <TGT>editnameidproperties</TGT>
-        <mkdir dir="${idp.target.dir}/conf" />
-        <mergeproperties inFile="${idp.target.dir}/dist/conf/saml-nameid.properties" outFile="${idp.target.dir}/conf/saml-nameid.properties" mergeFile="${nameid.merge.properties}" />
-    </target>
-
-    <target name="editldapproperties" depends="gettarget" if="idp.merge.ldap.properties" unless="ldap.properties.present">
-        <TGT>editldapproperties</TGT>
-        <mkdir dir="${idp.target.dir}/conf" />
-        <mergeproperties inFile="${idp.target.dir}/dist/conf/ldap.properties" outFile="${idp.target.dir}/conf/ldap.properties" mergeFile="${ldap.merge.properties}" />
-    </target>
-
-    <target name="metadata-gen" depends="gettarget, getentityid, gethostname, genkeys, upgrade"  unless="idp.metadata.present">
-        <TGT>metadata-gen</TGT>
-        <mkdir dir="${idp.target.dir}/metadata"/>
-        <metadatagenerate dnsName="${idp.host.name}" idpHome="${idp.target.dir}" backChannelCert="${idp.target.dir}/credentials/idp-backchannel.crt" output="${idp.target.dir}/metadata/idp-metadata.xml"/>
-    </target>
-
-    <target name="handleeditwebapp" depends="makeeditwebapp, populateeditwebapp"/>
-
-    <target name="makeeditwebapp">
-        <TGT>makeeditwebapp</TGT>
-        <!-- Create edit-webapp tree -->
-        <mkdir dir="${idp.target.dir}/edit-webapp" />
-        <mkdir dir="${idp.target.dir}/edit-webapp/css" />
-        <mkdir dir="${idp.target.dir}/edit-webapp/images" />
-        <mkdir dir="${idp.target.dir}/edit-webapp/WEB-INF" />
-        <mkdir dir="${idp.target.dir}/edit-webapp/WEB-INF/lib" />
-        <mkdir dir="${idp.target.dir}/edit-webapp/WEB-INF/classes" />
-    </target>
-
-    <target name="populateeditwebapp" unless="idp.properties.present">
-        <TGT>populateeditwebapp</TGT>
-        <copy todir="${idp.target.dir}/edit-webapp/css" failonerror="false">
-            <fileset dir="${idp.target.dir}/dist/webapp/css" />
-        </copy>
-        <copy todir="${idp.target.dir}/edit-webapp/images" failonerror="false">
-            <fileset dir="${idp.target.dir}/dist/webapp/images" />
-        </copy>
-    </target>
-
-    <!--
-     CREATE WAR FILE
     -->
-    <target name="build-war" depends="gettarget">
-        <!-- no logging -->
-        <delete dir="${idp.target.dir}/webapp" failonerror="false" />
-        <delete dir="${idp.target.dir}/webapp.tmp" failonerror="false" />
-        <echo>Rebuilding ${idp.target.dir}/war/idp.war ...</echo>
-        <mkdir dir="${idp.target.dir}/webapp.tmp" />
-        <copy todir="${idp.target.dir}/webapp.tmp" preservelastmodified="true" failonerror="true">
-            <fileset dir="${idp.target.dir}/dist/webapp" />
-        </copy>
-        <copy todir="${idp.target.dir}/webapp.tmp" overwrite="true" preservelastmodified="true" failonerror="true">
-            <fileset dir="${idp.target.dir}/edit-webapp" />
-        </copy>
-        <!-- build a jar, not war, since it is already fully populated -->
-        <delete file="${idp.target.dir}/war/idp.war" failonerror="true" />
-        <jar destfile="${idp.target.dir}/war/idp.war" basedir="${idp.target.dir}/webapp.tmp" />
-        <delete dir="${idp.target.dir}/webapp.tmp" failonerror="true" />
-        <echo>...done</echo>
+	
+    <target name="install">
+        <v4install task="install"/>
     </target>
-
-    <!-- specify getsource before get target to force target default-->
-    <target name="copy-distribution" depends="init, getsource, gettarget">
-        <TGT>copy-distribution</TGT>
-        <local name="target" />
-        <property name="target" value="${idp.target.dir}/old-${DSTAMP}-${TSTAMP}" />
-
-        <!-- Save old configuration:
-         NOT conf, credentials, flows, logs, messages, metadata, views-->
-        <mkdir dir="${target}" />
-
-        <!-- NOTE - move task appears to be very flaky - at least on windows.  This is why we
-         copy with a force overwrite and then explicitly delete -->
-        <copy todir="${target}/bin" failonerror="false">
-            <fileset dir="${idp.target.dir}/bin" />
-        </copy>
-        <copy todir="${target}/edit-webapp" failonerror="false">
-            <fileset dir="${idp.target.dir}/edit-webapp" />
-        </copy>
-        <copy todir="${target}/dist" failonerror="false">
-            <fileset dir="${idp.target.dir}/dist" />
-        </copy>
-        <copy todir="${target}/doc" failonerror="false">
-            <fileset dir="${idp.target.dir}/doc" />
-        </copy>
-        <copy todir="${target}/system" failonerror="false">
-            <fileset dir="${idp.target.dir}/system" />
-        </copy>
-
-        <!-- Do not delete bin, this preserves user scripts.
-        Delete bin/lib so as to clear up old jar files. -->
-        <delete dir="${idp.target.dir}/bin/lib" failonerror="false" />
-        <delete dir="${idp.target.dir}/dist" failonerror="false" />
-        <delete dir="${idp.target.dir}/doc" failonerror="false" />
-        <mkdir dir="${idp.target.dir}/system"/> <!-- create because it won't exist first time -->
-        <attrib readonly="false">
-            <fileset dir="${idp.target.dir}/system" includes="**/*"/>
-        </attrib>
-        <delete dir="${idp.target.dir}/system" failonerror="false" />
-
-        <!-- Now copy or create empty as required.
-        Creating an existing file is benign, bin gets updated -->
-
-        <copy todir="${idp.target.dir}/bin" overwrite="true">
-            <fileset dir="${idp.src.dir}/bin"  excludes="**/ant-jetty.xml **/install.*"/>
-        </copy>
-
-        <!-- Create dist folder and copy in the unmodified user configuration. -->
-        <mkdir dir="${idp.target.dir}/dist" />
-        <copy todir="${idp.target.dir}/dist/conf">
-            <fileset dir="${idp.src.dir}/conf" />
-        </copy>
-        <copy todir="${idp.target.dir}/dist/flows">
-            <fileset dir="${idp.src.dir}/flows" />
-        </copy>
-        <copy todir="${idp.target.dir}/dist/messages">
-            <fileset dir="${idp.src.dir}/messages" />
-        </copy>
-        <copy todir="${idp.target.dir}/dist/views">
-            <fileset dir="${idp.src.dir}/views" />
-        </copy>
-        <copy todir="${idp.target.dir}/dist/webapp">
-            <fileset dir="${idp.src.dir}/webapp" />
-        </copy>
-
-        <!-- Create doc/system folders and copy in from distribution. -->
-        <copy todir="${idp.target.dir}/doc">
-            <fileset dir="${idp.src.dir}/doc" />
-        </copy>
-        <copy todir="${idp.target.dir}/system">
-            <fileset dir="${idp.src.dir}/system" />
-        </copy>
-
-        <!-- Create user-modifiable folders. -->
-        <mkdir dir="${idp.target.dir}/conf" />
-        <mkdir dir="${idp.target.dir}/credentials" />
-        <mkdir dir="${idp.target.dir}/flows" />
-        <mkdir dir="${idp.target.dir}/logs" />
-        <mkdir dir="${idp.target.dir}/messages" />
-        <mkdir dir="${idp.target.dir}/metadata" />
-        <mkdir dir="${idp.target.dir}/views" />
-        <mkdir dir="${idp.target.dir}/war" />
+    <target name="install-nocopy">
+    	<v4install task="install-nocopy"/>
     </target>
-
-    <target name="copy-jetty-distribution" depends="copy-distribution" if="idp.jetty.config">
-        <TGT>copy-jetty-distribution</TGT>
-
-        <!-- save old -->
-        <local name="target" />
-        <property name="target" value="${idp.target.dir}/old-${DSTAMP}-${TSTAMP}" />
-
-        <!--- IDP-626 we do not need to preserve tmp -->
-        <delete failonerror="false"  dir="${idp.target.dir}/jetty-base/tmp"/>
-        <copy todir="${target}/jetty-base" failonerror="false">
-            <fileset dir="${idp.target.dir}/jetty-base" />
-        </copy>
-        <delete failonerror="false" dir="${idp.target.dir}/jetty-base"/>
-
-        <!-- Copy new -->
-        <copy todir="${idp.target.dir}/jetty-base">
-            <fileset dir="${idp.src.dir}/embedded/jetty-base" />
-        </copy>
-        <!-- rename Start.d -->
-        <move file="${idp.target.dir}/jetty-base/start.d" tofile="${idp.target.dir}/jetty-base/start.d.dist"/>
-        <!-- And restore the old one if present -->
-        <copy todir="${idp.target.dir}/jetty-base/start.d" failonerror="false">
-            <fileset dir="${target}/jetty-base/start.d" />
-        </copy>
-        <!-- finally copy the ant file -->
-        <copy file="${idp.src.dir}/bin/ant-jetty.xml" tofile="${idp.target.dir}/bin/ant-jetty.xml" overwrite="true"/>
-    </target>
-
-    <!-- V2 to V3 PrePopulate -->
-
-    <target name="v2v3prepopulate" depends="gettarget, v2detect" if="idp.is.V2">
-        <TGT>v2v3prepopulate</TGT>
-        <echo>
-A V2 Installation has been detected. Configuration will be preserved into
-.v2 folders and appropriate files copied forward.
-        </echo>
-        <!-- rename war to war.v2 -->
-        <copy todir="${idp.target.dir}/war.v2" failonerror="true">
-            <fileset dir="${idp.target.dir}/war" />
-        </copy>
-        <delete dir="${idp.target.dir}/war" failonerror="false" />
-
-        <!-- rename conf to conf.v2 -->
-        <copy todir="${idp.target.dir}/conf.v2" failonerror="true">
-            <fileset dir="${idp.target.dir}/conf" />
-        </copy>
-        <delete dir="${idp.target.dir}/conf" failonerror="false" />
-
-        <!-- delete old lib folder, just avoids confusion -->
-        <delete dir="${idp.target.dir}/lib" failonerror="false" />
-
-        <!-- copy selected files from conf.v2 -->
-        <mkdir dir="${idp.target.dir}/conf" />
-        <copy file="${idp.target.dir}/conf.v2/attribute-filter.xml" tofile="${idp.target.dir}/conf/attribute-filter.xml" failonerror="false" />
-        <copy file="${idp.target.dir}/conf.v2/attribute-resolver.xml" tofile="${idp.target.dir}/conf/attribute-resolver.xml" failonerror="false" />
-        <copy file="${idp.target.dir}/conf.v2/relying-party.xml" tofile="${idp.target.dir}/conf/metadata-providers.xml" failonerror="false" />
-        <copy file="${idp.target.dir}/conf.v2/relying-party.xml" tofile="${idp.target.dir}/conf/relying-party.xml" failonerror="false" />
-
-        <!-- Signal we're a legacy RP config -->
-        <echo file="${services.merge.properties}" append="yes">
-            idp.service.relyingparty.resources = shibboleth.LegacyRelyingPartyResolverResources
-        </echo>
-        <echo file="${nameid.merge.properties}" append="yes">
-            idp.nameid.saml2.legacyGenerator = shibboleth.LegacySAML2NameIDGenerator
-            idp.nameid.saml1.legacyGenerator = shibboleth.LegacySAML1NameIdentifierGenerator
-        </echo>
-    </target>
-
-    <target name="v2detect" depends="gettarget">
-        <TGT>v2detect</TGT>
-        <available property="idp.properties.present" file="${idp.target.dir}/conf/idp.properties" />
-        <available property="idp.relying.party.present" file="${idp.target.dir}/conf/relying-party.xml" />
-        <condition property="idp.is.V2">
-            <!-- This is V2 as there is relying-party.xml and not idp.properties -->
-            <and>
-                <isfalse value="${idp.properties.present}" />
-                <istrue value="${idp.relying.party.present}" />
-            </and>
-        </condition>
-    </target>
-
-    <target name="reprotect" depends="gettarget">
-        <!-- See IDP-487 -->
-        <chmod perm="755" dir="${idp.target.dir}/bin" includes="**/*.sh"/>
-        <chmod perm="${idp.conf.credentials.filemode}" dir="${idp.target.dir}/credentials" includes="**/*.key"/>
-        <chmod perm="${idp.conf.filemode}" dir="${idp.target.dir}/conf" includes="**/*"/>
-        <chmod perm="444" dir="${idp.target.dir}/system" includes="**/*"/>
-        <attrib readonly="true">
-            <fileset dir="${idp.target.dir}/dist" includes="**/*"/>
-        </attrib>
-        <attrib readonly="true">
-            <fileset dir="${idp.target.dir}/system" includes="**/*"/>
-        </attrib>
-    </target>
-
-    <target name="tidy" unless="idp.no.tidy">
-        <TGT>tidy</TGT>
-        <delete file="${idp.merge.properties}" failonerror="false" />
-        <delete file="${services.merge.properties}" failonerror="false" />
-        <delete file="${nameid.merge.properties}" failonerror="false" />
-        <delete file="${ldap.merge.properties}" failonerror="false" />
-        <delete file="${idp.property.file}" failonerror="false" />
+    <target name="build-war">
+        <v4install task="build-war"/>
     </target>
 
 </project>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list