Skip to main content

Source code file content

Revision: 57029

GLASSFISH-18987 Remove call to getService in critical path
» Project Revision History

» Checkout URL

svn / trunk / v2 / tools / build.xml

Size: 16607 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.
-->

<!DOCTYPE project [
  <!ENTITY commonBuild SYSTEM "../bootstrap/ant-common.xml">
]>

<project name="Appserver Tools" default="all" basedir=".">  

<!-- ========== Initialize Properties =================================== -->

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

    &commonBuild;
    
    <!--
        component.name: required property.  the value should be the
                        name of the component directory
    -->
    <property name="component.name" value="tools"/>
  
    <!-- all -->
    <target name="all" depends="build"
            description="Build entire component">
    </target>

    <!-- build -->
    <target name="build" depends="build_sub_components, compile, assemble, publish-tools"
            description="Build entire component">
    </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}"/>
    </target>

    <!-- compile --> 
    <target name="compile" depends="init"
            description="Compile com/sun/enterprise/tools/** sources">  

        <echo message="Compiling com/sun/enterprise/tools/**"/>
        <echo message="Not Compiling sources listed in commands-not-in-ri.list"/>
        <javac srcdir="${src.dir}" 
               destdir="${component.classes.dir}"
               excludesfile="commands-not-in-ri.list"
               debug="${javac.debug}" 
               optimize="${javac.optimize}"
               source="${javac.source}" 
               deprecation="${javac.deprecation}"
               failonerror="true">
	    <!-- all the unsupported commands for RI are in excludesfile -->
            <classpath>
                <pathelement location="${admin-cli.jar}"/>
                <pathelement location="${appserv-admin.jar}"/>
                <pathelement location="${appserv-rt.jar}"/>
                <pathelement location="${jhall.jar}"/>
                <pathelement location="${javaee.jar}"/>
            </classpath>
            <include name="com/sun/enterprise/tools/**"/>
            <include name="PLBootstrap.java"/>
            <exclude name="com/sun/enterprise/tools/verifier/**"/>
	    <exclude name="com/sun/enterprise/tools/common/deploy/**"/>
            <exclude name="com/sun/enterprise/tools/deployment/**"/>
            <exclude name="com/sun/enterprise/tools/common/util/ExtractUtils.java"/>
            <exclude name="com/sun/enterprise/tools/common/properties/PrincipalsEditor.java"/>
            <exclude name="com/sun/enterprise/tools/common/properties/RoleMapElementEditor.java"/>
        </javac>

        <echo message="Rmic ServerListener.class"/>
        <rmic base="${component.classes.dir}" iiop="yes" debug="${javac.debug}">
            <classpath>
                <pathelement location="${appserv-rt.jar}"/>
            </classpath>
            <include name="com/sun/enterprise/tools/deployment/main/ServerListener.class"/>
        </rmic>

    </target>

    <!-- compile-tests -->
    <target name="compile-tests" depends="init"
            description="Compile com/sun/enterprise/tools/**/*Test*.java">
        <echo message="Compiling Unit Tests"/>
        <echo message="Compiling com/sun/enterprise/tools/**"/>
        <javac srcdir="${test.dir}" 
            destdir="${component.classes.dir}"
            debug="${javac.debug}" 
            optimize="${javac.optimize}"
            source="${javac.source}" 
            deprecation="${javac.deprecation}"
            failonerror="true">
            <classpath>
                <pathelement location="${schema2beans.jar}"/>
		<pathelement location="${junit.jar}"/>
            </classpath>
            <include name="**/*Test.java"/>
            <include name="**/*Tests.java"/>
        </javac>
    </target>

    <!-- run-tests -->
    <target name="run-tests" depends="compile-tests"
            description="Run com/sun/enterprise/tools/** unit tests">
        <echo message="Running Unit Tests"/>
        <echo message="Running com/sun/enterprise/tools/**"/>
        <junit printsummary="yes" dir="${test.dir}" fork="true" haltonfailure="yes">
	      <classpath>
		    <!-- classes to test -->
		    <pathelement location="${component.classes.dir}"/>
		</classpath>
	      <classpath>
		    <!-- junit framework classes -->
		    <pathelement location="${junit.jar}"/>
		</classpath>
	      <classpath>
		    <!-- ant classes -->
		    <pathelement location="${ant.jar}"/>
		    <pathelement location="${optional.jar}"/>
		</classpath>
		<batchtest todir="${report.dir}">
		    <fileset dir="${test.dir}">
		        <include name="**/*Test.java"/>
			  <include name="**/*Tests.java"/>
		    </fileset>
	      </batchtest>
        </junit>
    </target>


    <!-- convert sgml to xml -->
    <!-- for solaris, linux and win only -->
    <target name="copymanpages" depends="publish-init" >
        <!-- location of xml files -->
        <property name="xml.dir"    value="${appserv-docs.publish.home}/help"/>
	<property name="help.dir"   value="${tools.publish.home}/internal/classes/com/sun/enterprise/tools/cli/help"/>

	<!-- Copy files from help/locale directory to the default directory -->
        <copy todir="${help.dir}">
            <fileset dir="${xml.dir}"/>
        </copy>
    </target>


    <!-- assemble -->
    <!--
    <target name="assemble" depends="init, copymanpages"
    -->
    <target name="assemble" depends="init"
            description="Create Tools jar files">               

        <copy todir="${component.classes.dir}">
            <fileset dir="${src.dir}">
                <include name="**/*.properties"/>
                <include name="**/*.xml"/>
                <include name="**/*.html"/>
                <include name="**/*.hs"/>
                <include name="**/*.jhm"/>
		    <include name="**/*.gif"/>
                <include name="**/CLIProperties.dtd"/>
            </fileset>
        </copy>

        <copy todir="${glassfish.home}/lib">
            <fileset dir="${launcher.dtds.dir}">
                <include name="processLauncher.xml"/>
                <include name="processLauncher.properties"/>
            </fileset>
        </copy>
        
        <!-- need to also copy PLBootstrap.class to lib directory for proper classloader functionality -->
        <copy todir="${glassfish.home}/lib">
            <fileset dir="${component.classes.dir}">
                <include name="PLBootstrap.class"/>
            </fileset>
        </copy>

        <jar jarfile="${appserv-rt.jar}" update="yes">
            <fileset dir="${component.classes.dir}">
                <include name="**/*.class"/>
                <include name="**/*.properties"/>
                <include name="**/*.xml"/>
                <include name="**/*.dtd"/>
    	          <exclude name="com/sun/enterprise/tools/common/validation/**"/>
    	          <exclude name="com/sun/enterprise/tools/upgrade/**"/>
           </fileset>
        </jar>                        
        <!-- XXX Not sure what to do with the following jars, needed internal by other components
        <jar jarfile="${component.lib.home}/ddbeans.jar">
            <fileset dir="${component.classes.dir}">
                <include name="com/sun/enterprise/tools/common/dd/**/*.class"/>
                <include name="com/sun/enterprise/tools/common/dd/**/*.properties"/>
                <include name="com/sun/enterprise/tools/common/dd/**/*.xml"/>
                <include name="com/sun/enterprise/tools/common/dd/**/*.dtd"/>
            </fileset>
        </jar>
        <jar jarfile="${component.lib.home}/validation.jar">
            <fileset dir="${component.classes.dir}">
                <include name="com/sun/enterprise/tools/common/validation/**/*.*"/>
            </fileset>
        </jar>
        -->

        <!-- assemble upgrade tool jar -->
        <echo message="Creating ${glassfish.home}/lib/appserv-upgrade.jar ..."/>
        <jar jarfile="${glassfish.home}/lib/appserv-upgrade.jar" update="yes" manifest="appserv-upgrade.mf">
            <fileset dir="${component.classes.dir}">
                <include name="com/sun/enterprise/tools/upgrade/**/*.class"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.properties"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.xml"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.html"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.hs"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.jhm"/>
		<include name="com/sun/enterprise/tools/upgrade/**/*.gif"/>
                <include name="com/sun/enterprise/tools/upgrade/**/*.dtd"/>
                <exclude name="com/sun/enterprise/tools/upgrade/build.xml"/>
                <exclude name="com/sun/enterprise/tools/upgrade/build.properties"/>
            </fileset>
        </jar>
    </target>

    <!-- the following published content is used by packaging SUNWasaco
       - which probably should live in appserv-admin module once its setup
     -->
    <target name="publish-init">
        <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>
        <condition property="darwin">
            <os name="Mac OS X"/>
        </condition>
    </target>

    <target name="publish-tools-windows" depends="publish-init" if="windows">
        <echo message="Publishing Windows Specific Tools files..."/>
        <copy todir="${glassfish.templates.home}">
            <fileset dir="${src.dir}/com/sun/enterprise/tools/cli"
                     includes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/verifier"
                     includes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/jspc"
                     includes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/upgrade"
                     includes="**/*.bat.template"/>
        </copy>
    </target>

    <target name="publish-tools-unix" depends="publish-init" if="unix" unless="darwin">
        <echo message="Publishing Unix Specific Tools files..."/>
        <copy todir="${glassfish.templates.home}">
            <fileset dir="${src.dir}/com/sun/enterprise/tools/cli"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/verifier"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/jspc"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/upgrade"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
        </copy>
    </target>

    <target name="publish-tools-darwin" depends="publish-init" if="darwin">
        <echo message="Publishing Unix Specific Tools files..."/>
	<echo message="copy to ${glassfish.templates.home} from ${src.dir}/com/sun/enterprise/tools/cli "/>
        <copy todir="${glassfish.templates.home}">
            <fileset dir="${src.dir}/com/sun/enterprise/tools/cli"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/verifier"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/jspc"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
            <fileset dir="${src.dir}/com/sun/enterprise/tools/upgrade"
                     includes="**/*.template"
                     excludes="**/*.bat.template"/>
        </copy>
    </target>

    <target name="publish-tools" 
            depends="publish-tools-windows, publish-tools-unix, publish-tools-darwin">

        <!-- echo message="Publishing *.pl files..."/>
        <copy todir="${glassfish.home}/lib">
            <fileset dir="${src.dir}/com/sun/enterprise/tools/cli"
                     includes="**/*.pl"/>
        </copy -->
    </target>

    <target name="build_sub_components" depends="tools.init.platform">
        <ant dir="ddgenerator" target="build"/>
    </target>

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

    <target name="javadoc" description="Generate JavaDoc">
        <javadoc 
           destdir="${component.doc.home}/validation"
           author="true"
           use="true"
	   source="1.4"
           public="true"		
           windowtitle="Validation API">
	     <fileset dir="${src.dir}" defaultexcludes="yes">
			<include name="com/sun/enterprise/tools/common/validation/**"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/**/*.dtd"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/**/*.mdd"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/**/*.xml"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/**/*.properties"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/constraints/data/**"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/data/**"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/impl/**"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/util/BundleReader.java"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/util/ObjectFactory.java"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/util/Utils.java"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/Constants.java"/>
			<exclude  name="com/sun/enterprise/tools/common/validation/Validator.java"/>
    	    </fileset>
	    <doctitle><![CDATA[<h1>Validation Framework</h1>]]></doctitle>
	</javadoc>
    </target>
</project>

 
 
Close
loading
Please Confirm
Close