<?xml version="1.0" encoding="UTF-8"?>
<!--
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011-2015 ForgeRock AS.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
-->
<!-- Parent Project -->
<project name="openam-server-war-preparation" default="openam_server-prepare-war">
<description>OpenAM Server Prepare WAR ANT Script</description>
<target name="openam-server-prepare-war">
<tstamp>
</tstamp>
<mkdir dir="${openam.temp.target}"/>
<mkdir dir="${project.build.directory}/classes"/>
<mkdir dir="${project.build.directory}/openam"/>
<mkdir dir="${openam.temp.target}/WEB-INF/template/opendj"/>
<!-- OpenDJ 3.0: Note - Repackage Sequence depends on Maven to locate the appropriate dependency -->
<!-- OpenDJ 3.0: Clean unpack folder -->
<mkdir dir="${opendj.repackage.dir}"/>
<!-- OpenDJ 3.0: Unpack the zip in preparation for running the script -->
<unzip dest="${opendj.repackage.dir}">
<fileset dir="${project.build.directory}">
<include name="opendj-server-legacy*.zip"/>
</fileset>
</unzip>
<!-- OpenDJ 3.0: Copy in scripts and associated resources -->
<copy todir="${opendj.repackage.dir}/opendj/template/ldif">
<fileset dir="/openam-distribution/src/main/opendj">
<include name="openam_suffix.ldif.template"/>
</fileset>
</copy>
<!-- OpenDJ 3.0: Perform OpenDJ mangling! -->
<!-- Remove the block starting with 'dn: cn=SNMP' and terminated by a blank line -->
<replaceregexp file="${opendj.repackage.dir}/opendj/template/config/config.ldif"
match="^dn: cn=SNMP.*?^$" replace="" byline="false" flags="m" />
<!-- Add a config.ldif.${VERSION_NO} file to the upgrade directory for easy upgrading from
Pre-OPENDJ2.4.5 versions -->
<path id="config.version.path">
<fileset dir="${opendj.repackage.dir}/opendj/template/config/upgrade">
<include name="*"/>
</fileset>
</path>
<ac:propertyregex property="config.version" input="${config.version.file}" regexp=".*\.([^\.]+)$" select="\1"
xmlns:ac="antlib:net.sf.antcontrib"/>
<echo message="Config version: ${config.version}"/>
<copy todir="${opendj.repackage.dir}/opendj/template/config/upgrade/">
<fileset dir="${opendj.repackage.dir}/opendj/template/config">
<include name="config.ldif"/>
</fileset>
</copy>
<!-- Exclusion List will extract out of the OpenDJ distribution files which do not make sense to include -->
<zip destfile="${opendj.repackage.dir}/opendj.zip"
basedir="${opendj.repackage.dir}/opendj"
excludesfile="/openam-distribution/src/main/opendj/opendj_exclusion_list"/>
<!-- OpenDJ 3.0: Deliver re-packaged zip to expected location -->
<fileset dir="${project.build.directory}/repackage-opendj">
<include name="opendj.zip"/>
</fileset>
</copy>
<mkdir dir="${openam.temp.target}/config/federation/default_en"/>
<fileset dir="${project.basedir}/src/main/webapp/config/federation/default">
<include name="**/**" />
</fileset>
</copy>
<!-- Align in fedlet -->
filtering="false">
<fileset
dir="${project.basedir}/openam-federation/openam-federation-library/target/classes/com/sun/identity/fedlet/ag">
<include name="UserData.class"/>
<include name="AssertionGen.class"/>
<include name="MetaDataParser.class"/>
</fileset>
</copy>
<include name="FederationConfig.properties"/>
</fileset>
</copy>
<!-- Align in auth -->
<mkdir dir="${openam.temp.target}/config/auth"/>
</copy>
</copy>
</copy>
</copy>
</copy>
</copy>
</copy>
</copy>
</copy>
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<!-- Align the Service Definitions for WAR Inclusion. -->
<fileset dir="${server.resources}/services">
<include name="*.*"/>
<exclude name="amAuth.xml"/>
</fileset>
</copy>
<!-- Align the Config Definitions for WAR Inclusion. -->
<fileset dir="${server.resources}/config">
<include name="*.htm"/>
<include name="*.properties"/>
<include name="license.txt"/>
<exclude name="serviceNames.properties"/>
</fileset>
</copy>
<include name="*.*"/>
</fileset>
</copy>
<!-- Remaining Bits -->
<fileset dir="${server.resources}/config">
<include name="*.htm"/>
</fileset>
</copy>
<mkdir dir="${openam.temp.target}/js"/>
<fileset dir="src/main/webapp/com_sun_web_ui/js">
<include name="browserVersion.js"/>
</fileset>
</copy>
</target>
</project>