Skip to main content

Source code file content

Revision: 57041

Fix copyright
» Project Revision History

» Checkout URL

svn / trunk / v2 / jdbcra / build.xml

Size: 11633 bytes, 1 line
<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
 Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
 The contents of this file are subject to the terms of either the GNU
 General Public License Version 2 only ("GPL") or the Common Development
 and Distribution License("CDDL") (collectively, the "License").  You
 may not use this file except in compliance with the License. You can obtain
 a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
 or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
 language governing permissions and limitations under the License.
 
 When distributing the software, include this License Header Notice in each
 file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
 Sun designates this particular file as subject to the "Classpath" exception
 as provided by Sun in the GPL Version 2 section of the License file that
 accompanied this code.  If applicable, add the following below the License
 Header, with the fields enclosed by brackets [] replaced by your own
 identifying information: "Portions Copyrighted [year]
 [name of copyright owner]"
 
 Contributor(s):
 
 If you wish your version of this file to be governed by only the CDDL or
 only the GPL Version 2, indicate your decision by adding "[Contributor]
 elects to include this software in this distribution under the [CDDL or GPL
 Version 2] license."  If you don't indicate a single choice of license, a
 recipient has the option to distribute your version of this file under
 either the CDDL, the GPL Version 2 or to extend the choice of license to
 its licensees as provided above.  However, if you add GPL Version 2 code
 and therefore, elected the GPL Version 2 license, then the option applies
 only if the new code is made subject to such option by the copyright
 holder.
-->

<!--
/*
* @(#)build.xml	1.0 02/07/22
*/
-->

<project name="JDBCConnector top level" default="build">
    <property name="pkg.dir" value="com/sun/gjc/spi"/>


    <property file="../bootstrap/project.properties"/>
    <property file="./build.properties"/>

    <target name="all" depends="build"/>
    <target name="all-jdbc-4.0" depends="build-jdbc-4.0"/>

    <target name="build" depends="compile,assemble"/>
    <target name="build-jdbc-4.0" depends="compile-jdbc-4.0,assemble-jdbc-4.0"
            description="builds only jdbc 4.0 classes"/>

    <target name="clean" description="Clean the build">
        <delete includeEmptyDirs="true" failonerror="false">
            <fileset dir="${component.classes.dir}"/>
            <fileset dir="${component.lib.home}"/>
        </delete>
    </target>


    <!-- init. Initialization involves creating publishing directories and
         OS specific targets. -->
    <target name="init" description="${component.name} initialization">
        <tstamp>
            <format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
        </tstamp>
        <echo message="Building component ${component.name}"/>
        <mkdir dir="${component.classes.dir}"/>
        <mkdir dir="${component.lib.home}"/>

        <condition property="jdbc-4.0">
            <available classname="java.sql.Wrapper"/>
        </condition>

        <condition property="jdbc-3.0">
            <not>
                <available classname="java.sql.Wrapper"/>
            </not>
        </condition>
    </target>


    <!-- compile -->
    <target name="compile" depends="init"
            description="Compile com/sun/* com/iplanet/* sources">
        <javac srcdir="${src.dir}"
               destdir="${component.classes.dir}"
               debug="${javac.debug}"
               optimize="${javac.optimize}"
               source="${javac.source}"
               deprecation="${javac.deprecation}"
               failonerror="true"
               target="1.5">

            <classpath>
                <pathelement location="${javaee.jar}"/>
                <pathelement location="${appserv-rt.jar}"/>
            </classpath>

            <include name="com/sun/gjc/**"/>
            <include name="com/sun/appserv/**"/>
            <exclude name="com/sun/gjc/spi/ConnectionHolder.java"/>
	    <exclude name="com/sun/gjc/spi/DataSource.java"/> 
            <exclude name="com/sun/gjc/spi/jdbc30/**"/>
            <exclude name="com/sun/gjc/spi/jdbc40/**"/>
        </javac>

        <antcall target="compile-jdbc-30"/>
        <antcall target="compile-jdbc-40"/>
    </target>

    <!-- If JDK is 1.5, compile JDBC 30 source -->
    <target name="compile-jdbc-30" if="jdbc-3.0" depends="init">
        <javac srcdir="${src.dir}"
               destdir="${component.classes.dir}"
               debug="${javac.debug}"
               optimize="${javac.optimize}"
               source="${javac.source}"
               deprecation="${javac.deprecation}"
               failonerror="true">

            <classpath>
                <pathelement location="${javaee.jar}"/>
                <pathelement location="${appserv-rt.jar}"/>
            </classpath>
            <include name="com/sun/gjc/spi/jdbc30/**"/>
            <exclude name="com/sun/gjc/common/**"/>
            <exclude name="com/sun/appserv/**"/>
            <exclude name="com/sun/gjc/spi/base/**"/>
            <exclude name="com/sun/gjc/spi/jdbc40/**"/>
        </javac>
    </target>

    <!-- If JDK is 1.6, compile JDBC 40 source -->
    <target name="compile-jdbc-40" if="jdbc-4.0" depends="init">
        <javac srcdir="${src.dir}"
               destdir="${component.classes.dir}"
               debug="${javac.debug}"
               optimize="${javac.optimize}"
               source="${javac.source}"
               deprecation="${javac.deprecation}"
               failonerror="true"
               target="1.5">

            <classpath>
                <pathelement location="${javaee.jar}"/>
                <pathelement location="${appserv-rt.jar}"/>
            </classpath>
            <include name="com/sun/gjc/spi/jdbc40/**"/>
            <exclude name="com/sun/gjc/common/**"/>
            <exclude name="com/sun/appserv/**"/>
            <exclude name="com/sun/gjc/spi/base/**"/>
            <exclude name="com/sun/gjc/spi/jdbc30/**"/>
        </javac>
    </target>

    <target name="generate-jdbc-3.0-binary" description="generate jdbc-30 (com/sun/gjc/spi/jdbc30) binary">
        <antcall target="compile-jdbc-30"/>
        <jar jarfile="${30binary.jar}" update="yes"
             basedir="${component.classes.dir}"
             includes="com/sun/gjc/spi/jdbc30/*"/>
    </target>

    <target name="generate-jdbc-4.0-binary" description="generate jdbc-40 (com/sun/gjc/spi/jdbc40) binary">
        <antcall target="compile-jdbc-40"/>
        <jar jarfile="${40binary.jar}" update="yes"
             basedir="${component.classes.dir}"
             includes="com/sun/gjc/spi/jdbc40/*"/>
    </target>

    <target name="compile-jdbc-4.0" depends="init"
            description="Compiles com/sun/gjc/spi/jdbc40 sources">
        <javac srcdir="${src.dir}"
               destdir="${component.classes.dir}"
               debug="${javac.debug}"
               optimize="${javac.optimize}"
               source="${javac.source}"
               deprecation="${javac.deprecation}"
               failonerror="true"
               target="1.5">
            <classpath>
                <pathelement location="${javaee.jar}"/>
                <pathelement location="${appserv-rt.jar}"/>
            </classpath>
            <include name="com/sun/gjc/spi/jdbc40/**"/>
        </javac>
    </target>


    <target name="assemble-jdbc-4.0" description="updates appserv-rt.jar with jdbc-4.0 classes">
        <jar jarfile="${appserv-rt.jar}" update="yes"
             basedir="${component.classes.dir}"
             includes="com/sun/gjc/spi/jdbc40/*"/>
    </target>

    <target name="assemble">

        <copy todir="${component.classes.dir}">
            <fileset dir="${src.dir}">
                <include name="**/*.properties"/>
            </fileset>
        </copy>


        <jar jarfile="${appserv-rt.jar}" update="yes"
             basedir="${component.classes.dir}"
             includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*, **/*.properties"/>

        <jar jarfile="${appserv-ext.jar}" update="yes"
             basedir="${component.classes.dir}"
             includes="com/sun/appserv/jdbc/*"/>

        <copy file="${src.dir}/com/sun/gjc/spi/xml/ra-xa.xml"
              tofile="${component.lib.home}/ra.xml" overwrite="yes">
        </copy>
        <jar jarfile="${component.lib.home}/__xa.rar"
             basedir="${component.lib.home}" excludes="**/*">
            <manifest>
                <attribute name="Specification-Title" value="JDBC Specification"/>
                <attribute name="Specification-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Specification-Version" value="3.0, 4.0"/>
                <attribute name="Implementation-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Implementation-Version" value="9.1"/>
                <attribute name="Implementation-Title" value="Sun Java System Application Server"/>
            </manifest>
            <metainf dir="${component.lib.home}">
                <include name="ra.xml"/>
            </metainf>
        </jar>

        <copy file="${src.dir}/com/sun/gjc/spi/xml/ra-ds.xml"
              tofile="${component.lib.home}/ra.xml" overwrite="yes">
        </copy>
        <jar jarfile="${component.lib.home}/__ds.rar"
             basedir="${component.lib.home}" excludes="**/*">
            <manifest>
                <attribute name="Specification-Title" value="JDBC Specification"/>
                <attribute name="Specification-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Specification-Version" value="3.0, 4.0"/>
                <attribute name="Implementation-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Implementation-Version" value="9.1"/>
                <attribute name="Implementation-Title" value="Sun Java System Application Server"/>
            </manifest>
            <metainf dir="${component.lib.home}">
                <include name="ra.xml"/>
            </metainf>
        </jar>

        <copy file="${src.dir}/com/sun/gjc/spi/xml/ra-cp.xml"
              tofile="${component.lib.home}/ra.xml" overwrite="yes">
        </copy>
        <jar jarfile="${component.lib.home}/__cp.rar"
             basedir="${component.lib.home}" excludes="**/*">
            <manifest>
                <attribute name="Specification-Title" value="JDBC Specification"/>
                <attribute name="Specification-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Specification-Version" value="3.0, 4.0"/>
                <attribute name="Implementation-Vendor" value="Sun Microsystems, Inc.,"/>
                <attribute name="Implementation-Version" value="9.1"/>
                <attribute name="Implementation-Title" value="Sun Java System Application Server"/>
            </manifest>
            <metainf dir="${component.lib.home}">
                <include name="ra.xml"/>
            </metainf>
        </jar>

        <unjar src="${component.lib.home}/__xa.rar" dest="${glassfish.applications.home}/__xa"/>
        <unjar src="${component.lib.home}/__ds.rar" dest="${glassfish.applications.home}/__ds"/>
        <unjar src="${component.lib.home}/__cp.rar" dest="${glassfish.applications.home}/__cp"/>

        <delete dir="${component.lib.home}"/>
    </target>

</project>

 
 
Close
loading
Please Confirm
Close