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 / branches / v2_3.1.1 / packager-ext / package-common.xml

Size: 10517 bytes, 1 line
<!--
 Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 Use is subject to license terms.
-->

<property name="packager.jar" 
          value="${publish.home}/packager/lib/packager.jar"/>


<!-- init-common. Common initialization involves creating publishing 
   - directories and OS specific targets. 
--> 
<target name="init-common"
    description="Module initialization">
    <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>
    <condition property="mac">
        <os name="Mac OS X"/>
    </condition>
    <echo message="Building component ${component.name}"/>
    <mkdir dir="${publish.package.home}"/>
</target>

<target name="jarpack" >
    <echo message="${jarpack-task.jar}" />
    <taskdef name="pack200" 
             classname="com.sun.tools.apache.ant.pack200.Pack200Task"
             classpath="${jarpack-task.jar}" />
    <taskdef name="unpack200"
             classname="com.sun.tools.apache.ant.pack200.Unpack200Task"
             classpath="${jarpack-task.jar}" />


</target>
<target name="create-zip-filelist" 
    description="Create zip file listing">        
    <echo message="create zip file using ${packager.jar}"/>
    <java classname="com.sun.appserv.internal.build.util.SVR4PackageDefToFileList"        
          dir="${package.home}/${component.package}" 
          fork="true" 
          failonerror="true">
        <classpath>
            <pathelement location="${packager.jar}"/>
        </classpath>
        <arg value="SVR4PackageDefToFileList.xml"/>    
    </java>      
</target>  


<!-- package targets.  Shared packaging target. We use SVR4PackageDefToFileList
   - to translate a components prototype_com file (which defines its solaris 
   - package) into a file listing (with an OS specific name). For examples 
   - we package DLLs on Win2k and so's on Solaris. This file listing is passed 
   - to zip to create the package.
-->


<target name="package-common" 
    depends="init-common, create-zip-filelist, package-win2k-common, package-linux-common, package-solaris-common, package-mac-common"/>


<target name="package-win2k-common" if="windows" 
        description="create windows specific packaging">
   <zip zipfile="${publish.package.home}/${component.package}.zip" 
        basedir="${component.publish.home}" 
        includesfile="${package.home}/${component.package}/prototype_com.zip.win2k"
        whenempty="fail">            
   </zip>
</target>

<target name="package-linux-common" if="linux" 
        description="create linux specific packaging">
   <zip zipfile="${publish.package.home}/${component.package}.zip" 
        basedir="${component.publish.home}" 
        includesfile="${package.home}/${component.package}/prototype_com.zip.linux"
        whenempty="fail">            
   </zip>
</target>

<target name="package-mac-common" if="mac" 
        description="create Mac OS X specific packaging">
   <available file="${package.home}/${component.package}/prototype_com.zip.darwin"
              property="darwin.file.present"/>
   <antcall target="package-mac-darwin-file"/>
   <antcall target="package-mac-linux-file"/>
</target>

<target name="package-mac-darwin-file" if="darwin.file.present"
        description="create Mac OS X specific packaging based on darwin file">
   <zip zipfile="${publish.package.home}/${component.package}.zip" 
        basedir="${component.publish.home}" 
        includesfile="${package.home}/${component.package}/prototype_com.zip.darwin"
        whenempty="fail">            
   </zip>
</target>

<target name="package-mac-linux-file" unless="darwin.file.present"
        description="create Mac OS X specific packaging based on linux file">
   <zip zipfile="${publish.package.home}/${component.package}.zip" 
        basedir="${component.publish.home}" 
        includesfile="${package.home}/${component.package}/prototype_com.zip.linux"
        whenempty="fail">            
   </zip>
</target>

<target name="package-solaris-common" if="solaris" 
        description="create solaris specific packaging">
   <zip zipfile="${publish.package.home}/${component.package}.zip" 
        basedir="${component.publish.home}" 
        includesfile="${package.home}/${component.package}/prototype_com.zip.solaris"
        whenempty="fail">            
   </zip>
   <!-- NO Solaris package for now -->
<!--
   <exec executable="gmake" 
         dir="${package.home}/${component.package}"
         failonerror="true">
       <arg line="publish"/> 
   </exec>
-->
</target>

<target name="build-solaris-package" if="solarissvr4build" 
        description="create solaris package">
   <!--exec executable="gmake"
         dir="${package.home}/${component.package}"
         failonerror="true">
       <arg line="PRODUCT_VERSION=${full_version} COMPONENT_ROOT=${component.publish.home} publish"/>
   </exec-->
<ant antfile="build.xml" dir="${package.home}/${component.package}" target="create-pkgs"
             inheritAll="true">
</ant>
</target>

<target name="build-rpm" if="linuxrpmbuild" 
        depends="create-zip-filelist"
        description="create linux rpm">
   <!--exec executable="gmake"
         dir="${package.home}/${component.package}"
         failonerror="true">
       <arg line="BUILD_ID=${build_release_id} PRODUCT_VERSION=${full_version} COMPONENT_ROOT=${component.publish.home} HOST_OBJDIR=${host.obj.dir} createrpms"/>
   </exec-->
  <ant antfile="build.xml" dir="${package.home}/${component.package}" target="create-rpms"
             inheritAll="true">
   </ant>
 
</target>

<!-- Adding a target to create debian packages -->
<target name="build-debian" if="linuxdebian"
        depends="create-zip-filelist"
        description="create Debian Packages">
    <ant antfile="build.xml" dir="${package.home}/${component.package}" target="create-debian"
               inheritAll="true">
    </ant>
</target>

<!--
   - publish-common is exclusively used by creating RI server image. 
 -->
<target name="publish-common" 
    depends="init-common, create-zip-filelist, publish-win2k-common, publish-linux-common, publish-solaris-common, publish-mac-common"/>

<target name="publish-win2k-common" if="windows" 
        description="publish windows specific content">
    <copy todir="${publish.dir}"> 
        <fileset dir="${component.publish.home}"
                 includesfile="${package.home}/${component.package}/prototype_com_ri.zip.win2k"/> 
    </copy>
</target>

<target name="publish-linux-common" if="linux" 
        description="publish linux specific content">
    <copy todir="${publish.dir}"> 
        <fileset dir="${component.publish.home}"
                 includesfile="${package.home}/${component.package}/prototype_com_ri.zip.linux"/> 
    </copy>
</target>


<target name="publish-mac-common" if="mac" 
        description="create Mac OS X specific packaging">
   <available file="${package.home}/${component.package}/prototype_com_ri.zip.darwin"
              property="darwin.file.present"/>
   <antcall target="publish-mac-darwin-file"/>
   <antcall target="publish-mac-linux-file"/>
</target>

<target name="publish-mac-linux-file" unless="darwin.file.present" 
        description="publish Mac OS X specific content using linux list of files">
    <copy todir="${publish.dir}"> 
        <fileset dir="${component.publish.home}"
                 includesfile="${package.home}/${component.package}/prototype_com_ri.zip.linux"/> 
    </copy>
</target>

<target name="publish-mac-darwin-file" if="darwin.file.present" 
        description="publish Mac OS X specific content using darwing list of files">
    <copy todir="${publish.dir}"> 
        <fileset dir="${component.publish.home}"
                 includesfile="${package.home}/${component.package}/prototype_com_ri.zip.darwin"/> 
    </copy>
</target>

<target name="publish-solaris-common" if="solaris" 
        description="publish solaris specific content">
    <copy todir="${publish.dir}"> 
        <fileset dir="${component.publish.home}"
                 includesfile="${package.home}/${component.package}/prototype_com_ri.zip.solaris"/> 
    </copy>
</target>
<!--
<target name="jar-pack" unless="ri.build"
    description="Applying the pack utility on jars">        
    <echo message="NOT Applying javapack on  ${pack.jar.name} for JDK 1.5... "/>
    <java classname="com.sun.appserv.internal.build.util"        
          dir="${pack.jar.dir}" 
          fork="true" 
          failonerror="true">
        <classpath>
            <pathelement location="${package-format.jar}"/>
        </classpath>
        <arg value="${pack.jar.name}.pack"/>
        <arg value="${pack.jar.name}"/>
        <arg value="-1"/>  
        <arg value="-C"/>  
        <arg value="-D"/>  
    </java>
</target>
-->
<!-- Target to pack the jars using the Pack200 ant optional task -->
<target name="jar-pack" unless="ri.build" depends="jarpack"
    description="Applying the pack utility on jars">
    <echo message="Applying Pack200 on ${pack.jar.dir}/${pack.jar.name} using JDK1.5 " />
     <mkdir dir="${pack.jar.dir}/normalized" /> 
     <pack200 src="${pack.jar.dir}/${pack.jar.name}"
              destfile="${pack.jar.dir}/normalized/${pack.jar.name}"
              repack="true"
              stripdebug="false"
              deflatehint="keep"
              unknownattribute="pass"
              keepfileorder="true"/>

     <pack200 src="${pack.jar.dir}/normalized/${pack.jar.name}"
              destfile="${pack.jar.dir}/normalized/${pack.jar.name}.pack.gz"
              gzipoutput="true"  
              stripdebug="false"
              deflatehint="keep"
              unknownattribute="pass"
              keepfileorder="true"/>

     <unpack200 src="${pack.jar.dir}/normalized/${pack.jar.name}.pack.gz"
                dest="${pack.jar.dir}/normalized/a-${pack.jar.name}" />   

     <pack200 src="${pack.jar.dir}/normalized/a-${pack.jar.name}"
             destfile="${pack.jar.dir}/${pack.jar.name}.pack.gz"
             gzipoutput="true" 
             stripdebug="false"
             deflatehint="keep"
             unknownattribute="pass" 
             keepfileorder="true" /> 
</target>
 
 
Close
loading
Please Confirm
Close