Skip to main content

Source code file content

Revision: 58303

Set svn property svn:eol-style to files
» Project Revision History

» Checkout URL

svn / branches / v2_3.1.1 / appserv-core / compile.xml

Size: 18271 bytes, 1 line
<?xml version="1.0" encoding="iso-8859-1"?>

<!--
 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.
-->

<property environment="env"/>

<path id="compile.classpath">
    <pathelement location="${javaee.jar}"/>
    <pathelement location="${jmac-api.jar}"/>
    <pathelement location="${java.home}/../lib/tools.jar"/>
    <pathelement location="${glassfish.home}/lib/ant/lib/ant.jar"/>
    <pathelement location="${appserv-admin.jar}"/>
    <pathelement location="${appserv-deployment-client.jar}"/>
    <pathelement location="${appserv-rt.jar}"/>
    <pathelement location="${commons-launcher.jar}"/>
    <pathelement location="${glassfish.home}/imq/lib/imqadmin.jar"/>
    <pathelement location="${glassfish.home}/lib/webservices-rt.jar"/>
    <pathelement location="${glassfish.home}/lib/webservices-tools.jar"/>
</path>

<target name="compile" depends="compile-init, compile-server, compile-admin, compile-appclient, run-rmic"
        description="Compile the server core sources...">
</target>

<!-- init. Initialization involves creating publishing directories and
     OS specific targets. -->
<target name="compile-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}"/>
</target>


<target name="compile-admin" depends="compile-init, create-version, setup.init">
    <echo message="Compiling com/sun/enterprise/admin"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/admin/**"/>
	  <exclude name="com/sun/enterprise/tools/verifier/**"/>
	  <exclude name="com/sun/enterprise/admin/server/core/mbean/test/**"/>
	  <include name="com/sun/enterprise/tools/verifier/TestInformation.java"/>
    </javac>

    <echo message="Rmic com/sun/enterprise/admin/server/core/channel/AdminChannelServer.class"/>
    <exec executable="${local.java.home}/bin/rmic" dir="${component.classes.dir}">
        <arg value="-verbose" />
        <env key="CLASSPATH" path="${component.classes.dir}:${javaee.jar}:${appserv-admin.jar}:${appserv-rt.jar}"/>
        <arg value="com.sun.enterprise.admin.server.core.channel.AdminChannelServer"/>
     </exec>

    <!-- rmic base="${component.classes.dir}" debug="${javac.debug}">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/admin/server/core/channel/AdminChannelServer.class"/>
    </rmic -->
</target>

<target name="compile-appclient" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/appclient/**"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/appclient/**"/>
    </javac>
</target>

<target name="compile-connectors" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/connectors/**"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/connectors/**"/>
        <exclude name="com/sun/enterprise/web/jsp/**"/>
        <exclude name="com/sun/enterprise/webservice/**"/>
    </javac>
</target>

<target name="compile-config" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/loader"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/tools/common/**"/>
    </javac>
</target>

<target name="compile-deployment" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/deployment"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/deployment/**"/>
    </javac>
</target>

<target name="compile-loader" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/loader"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/loader/**"/>
    </javac>
</target>

<target name="compile-tomcat" depends="compile-init">
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="org/apache/**"/>
    </javac>
</target>

<!-- compile-server --> 
<target name="compile-server" depends="compile-init, create-version, compile-config, compile-connectors, compile-web, compile-loader"
        description="Compile com/sun/* sources">  

    <echo message="Compiling com/sun/ejb, com/sun/ejb"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/ejb/**"/>
        <include name="com/sun/ejb/*.java"/>
        <include name="com/sun/ejb/codegen/**"/>
        <include name="com/sun/ejb/containers/IASServerSessionImpl.java"/>
        <include name="com/sun/ejb/containers/IASServerSessionPoolImpl.java"/>
        <include name="com/sun/ejb/containers/IASServerSessionFactory.java"/>
        <include name="com/sun/ejb/containers/ReadOnlyBeanNotifierImpl.java"/>
        <include name="com/sun/enterprise/transaction/**"/>
        <include name="com/sun/appserv/naming/**"/>
        <include name="com/sun/appserv/management/alert/**"/>
        <include name="com/sun/appserv/management/event/**"/>
        <exclude name="com/sun/enterprise/web/jsp/**"/>
    </javac>

    <echo message="Compiling com/sun/web, com/sun/jndi, com/sun/enterprise"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/**"/>
        <exclude name="com/sun/enterprise/admin/**"/>
        <exclude name="com/sun/enterprise/iiop/IORAddrAnyInitializer.java"/>
        <exclude name="com/sun/enterprise/iiop/IORAddrAnyInterceptor.java"/>
        <!-- exclude name="com/sun/enterprise/tools/verifier/**"/ -->
        <exclude name="com/sun/enterprise/security/**"/>
        <include name="com/sun/web/**"/>
        <exclude name="com/sun/enterprise/web/jsp/**"/>
        <exclude name="com/sun/enterprise/web/session/SessionCookieConfig.java"/>
        <include name="com/sun/jndi/**"/>
    </javac>

    <echo message="Compiling com/sun/enterprise/admin/event, com/sun/enterprise/server, com/sun/appserv/server, com/sun/appserv/ejb, com/sun/appserv/connectors, com/sun/appserv/security, com/iplanet/ias/security/auth, com/sun/enterprise/jms, com/sun/enterprise/resource, com/sun/enterprise/security, com/sun/enterprise/web"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/admin/event/**"/>
        <include name="com/sun/enterprise/server/**"/>
        <include name="com/sun/enterprise/server/stats/**"/>
        <include name="com/sun/appserv/server/**"/>
        <include name="com/sun/appserv/ejb/**"/>
        <include name="com/sun/appserv/security/**"/>
        <include name="com/sun/appserv/connectors/**"/>
        <include name="com/sun/enterprise/jms/**"/>
        <include name="com/sun/enterprise/resource/**"/>
        <include name="com/sun/enterprise/security/**"/>
        <include name="com/sun/enterprise/web/*.java"/>
        <include name="com/iplanet/ias/security/auth/**"/>
        <include name="com/sun/enterprise/web/jsp/ResourceInjectorImpl.java"/>
    </javac>

    <antcall target="do.javah.solarisauth"/>
    <antcall target="do.javahforsyslog"/>
    <antcall target="do.javahforjvminfo"/>

</target>

    <target name="do.javah.solarisauth" 
            depends="tools.init.platform">
        <echo message="Generating JNI headers for the CLI Password and Environment interface"/>
        <exec executable="${JAVAH}">
            <arg line="-classpath ${component.classes.dir}"/>
            <arg line="-d ${component.classes.dir}"/>
            <arg line="-force"/>
            <arg line="com.sun.enterprise.security.auth.realm.solaris.SolarisRealm"/>
        </exec>
    </target>
 
    <target name="do.javahforsyslog"
            depends="tools.init.platform">
        <echo message="Generating JNI headers for the SysLogHandler"/>
        <exec executable="${JAVAH}">
            <arg line="-classpath ${component.classes.dir}"/>
            <arg line="-d ${component.classes.dir}"/>
            <arg line="-force"/>
            <arg line="com.sun.enterprise.server.logging.SystemLogHandler"/>
        </exec>
    </target>

    <target name="do.javahforjvminfo"
            depends="tools.init.platform">
        <echo message="Generating JNI headers for the JvmInfoUtil"/>
        <exec executable="${JAVAH}">
            <arg line="-classpath ${component.classes.dir}"/>
            <arg line="-d ${component.classes.dir}"/>
            <arg line="-force"/>
            <arg line="com.sun.enterprise.util.JvmInfoUtil"/>
        </exec>
    </target>



<!-- No longer compile TOMCAT 404
<target name="compile-web" depends="compile-init, compile-tomcat">
-->
<target name="compile-web" depends="compile-init">
    <echo message="Compiling com/sun/enterprise/web/**"/>
    <javac srcdir="${src.dir}" 
           destdir="${component.classes.dir}"
           debug="${javac.debug}" 
           optimize="${javac.optimize}"
           source="${javac.source}" 
           deprecation="${javac.deprecation}"
           failonerror="true">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/web/**"/>
        <include name="com/sun/appserv/web/cache/**"/>
        <include name="com/sun/appserv/web/taglibs/**"/>
        <include name="com/sun/appserv/util/**"/>
        <exclude name="com/sun/enterprise/web/*.java"/>
        <exclude name="com/sun/enterprise/web/jsp/**"/>
        <exclude name="com/sun/enterprise/web/session/SessionCookieConfig.java"/>
    </javac>

</target>



<!-- RUN RMIC -->
<target name="run-rmic" depends="setup.init" description="Runs RMIC tasks">
    <echo message="Rmic 5 classes"/>
    <exec executable="${local.java.home}/bin/rmic" dir="${component.classes.dir}">
        <arg value="-verbose" />
        <env key="CLASSPATH" path="${component.classes.dir}:${javaee.jar}:${appserv-admin.jar}:${appserv-rt.jar}"/>
        <arg value="com.sun.ejb.containers.EJBHomeImpl"/>
        <arg value="com.sun.enterprise.security.RealmManager"/>
        <arg value="com.sun.enterprise.repository.ConfigurationImpl"/>
        <arg value="com.sun.ejb.containers.ReadOnlyBeanNotifierImpl"/>
        <arg value="com.sun.ejb.containers.ReadOnlyEJBHomeImpl"/>
    </exec>

    <!-- rmic base="${component.classes.dir}" iiop="yes" debug="${javac.debug}">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/ejb/containers/EJBHomeImpl.class"/>
        <include name="com/sun/enterprise/tools/deployment/backend/DeployCallBack.class"/>
        <include name="com/sun/enterprise/tools/deployment/backend/DeploymentSessionImpl.class"/>
        <include name="com/sun/enterprise/security/RealmManager.class"/>
        <include name="com/sun/enterprise/repository/ConfigurationImpl.class"/>
        <include name="com/sun/ejb/containers/ReadOnlyBeanNotifierImpl.class"/>
        <include name="com/sun/ejb/containers/ReadOnlyEJBHomeImpl.class"/>
    </rmic -->

    <echo message="Rmic com.sun.enterprise.naming.SerialContextProviderImpl.class"/>
    <exec executable="${local.java.home}/bin/rmic" dir="${component.classes.dir}">
        <arg value="-verbose" />
        <env key="CLASSPATH" path="${component.classes.dir}:${javaee.jar}:${appserv-admin.jar}:${appserv-rt.jar}"/>
        <arg value="-iiop" />
        <arg value="-poa" />
        <arg value="com.sun.enterprise.naming.SerialContextProviderImpl"/>
    </exec>

    <!-- rmic base="${component.classes.dir}" iiop="yes" iiopopts="-poa" debug="${javac.debug}">
        <classpath refid="compile.classpath"/>
        <include name="com/sun/enterprise/naming/SerialContextProviderImpl.class"/>
    </rmic -->
 </target>



<!-- NEED TO RESOLVE -->
<!-- Creating Version.java from VersionTemplate and populating 
   - it the same as the http core version 
-->
<target name="create-version"
        description="Creating Version.java from VersionTemplate">
    <echo message="Creating com/sun/appserv/server/util/Version.java 
                   class from VersionTemplate"/>
    <delete file="${src.dir}/com/sun/appserv/server/util/Version.java"/>
    <copy file="${src.dir}/com/sun/appserv/server/util/VersionTemplate" 
          tofile="${src.dir}/com/sun/appserv/server/util/Version.java">
        <filterset>
            <filter token="BRAND_NAME" value="${brand_name}" />
            <filter token="PRODUCT_NAME" value="${product_name}" />
            <filter token="ABBREV_PRODUCT_NAME" value="${abbrev_product_name}" />
            <filter token="FULL_VERSION" value="${full_version}" />
            <filter token="MAJOR_VERSION" value="${major_version}" />
            <filter token="MINOR_VERSION" value="${minor_version}" />
            <filter token="BUILD_ID" value="${build_id}" />
        </filterset>
    </copy>
</target>

<target name="setup.init" depends="get.java.home" description="Set up the OS version">
    <tstamp>
      <format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
    </tstamp>
    <condition property="windows">
        <os family="windows" />
    </condition>
    <condition property="unix">
        <os family="unix" />
    </condition>
    <condition property="solaris">
        <equals arg1="${os.name}" arg2="SunOS"/>
    </condition>
    <condition property="linux">
        <equals arg1="${os.name}" arg2="Linux"/>
    </condition>
</target>

<target name="get.java.home">
     <condition property="suffix" value="/..">
        <and>
            <os family="unix"/>
            <not>
                <os name="Mac OS X"/>
            </not>
        </and>
     </condition>
     <condition property="suffix" value="">
        <os name="Mac OS X"/>
     </condition>
     <condition property="suffix" value="/..">
        <os family="windows"/>
     </condition>
    <!-- setup the local.java.home -->
    <property name="local.java.home" value="${java.home}${suffix}"/>
</target>

 
 
Close
loading
Please Confirm
Close