<?xml version="1.0" encoding="iso-8859-1"?>
<!--
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
glassfish/bootstrap/legal/CDDLv1.0.txt or
https://glassfish.dev.java.net/public/CDDLv1.0.html.
See the License for the specific language governing
permissions and limitations under the License.

When distributing Covered Code, include this CDDL
HEADER in each file and include the License file at
glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your
own identifying information: Portions Copyright [yyyy]
[name of copyright owner]
-->
<project name="glassfish v3, app client library fix-up" default="fixup.library" basedir=".">
    <target name="fixup.library">
        <unzip src="${output.dir}/${output.file}" dest="${stage.dir}">
            <patternset>
                <include name="META-INF/MANIFEST.MF"/>
            </patternset>
        </unzip>

        <!-- replace the colons used as path separators with blanks -->
        <replace file="${classpath.file}" token=":" value=" "/>

        <!-- define the classpath property -->
        <property file="${classpath.file}"/>

        <manifest mode="update" file="${stage.dir}/META-INF/MANIFEST.MF">
            <attribute name="Class-Path" value="${classpath} ${classpath.additions}"/>
        </manifest>

        <!-- Update the JAR file with the revised manifest -->
        <zip destfile="${output.dir}/${output.file}" basedir="${stage.dir}" update="true" includes="META-INF/MANIFEST.MF"/>
        <echo>Manifest Class-Path updated</echo>
   </target>
</project>

