Skip to main content

Source code file content

Revision: 58303

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

» Checkout URL

svn / tags / gfv3-express-b15a / installer / build.xml

Size: 8426 bytes, 1 line
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- 
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# 
# Use is subject to License Terms
#
--> 
<!DOCTYPE project []>

<project name="GlassFish Installer build" default="all" basedir=".">  

    <property name="component.name" value="installer"/>
    <property name="src.dir" value="${basedir}/src/main/java"/>
    <property name="component.classes.dir" value="${basedir}/target/classes"/>
    <property name="component.lib.dir" value="${basedir}/target/lib"/>
    <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
    <property name="stage.dir" value="${basedir}/target/stage" />
    <property name="uc.stage.dir" value="${basedir}/target/uc" />
    <property name="tmp.dir" value="${basedir}/target/tmp" />
    <property name="resources.dir" value="${basedir}/src/main/resources" />
    <property name="gf.zip.dir" value="${basedir}/../packager/build" />
    <property name="javaresources.dir" value="${basedir}/src/main/java/org/openinstaller/resource" />
      
    <!-- all -->
    <target name="all" depends="extract.oi, extract.uc, compile, assemble, package"  description="Build entire component">
    </target>

    <target name="extract.oi"  description="Extracting openInstaller files">
        <mkdir dir="${stage.dir}"/>
	<unzip src="${maven.repo.local}/org/openinstaller/engine/0.9.4.1/engine-0.9.4.1.zip"
            dest="${stage.dir}"/>
        <unzip src="${maven.repo.local}/org/openinstaller/resources/0.9.4.1/resources-0.9.4.1.zip"
            dest="${stage.dir}"/>

	<!-- Overwrite the Default resource file bundled in OI with GlassFish Resource file -->
  	<copy tofile="${stage.dir}/install/lib/resources/org/openinstaller/resources/ResourceMsgs.properties"
            file="${javaresources.dir}/ResourceMsgs.properties" overwrite="true"/>

        <chmod file="${stage.dir}/install/bin/engine-wrapper" perm="ugo+rx"/>
    </target>

    <target name="extract.uc"  description="Extracting UC bootstrap files">
        <mkdir dir="${uc.stage.dir}"/>
	<unzip src="${maven.repo.local}/com/sun/pkg/client/ucbootstrap/0.0.0.5/ucbootstrap-0.0.0.5.zip" 
            dest="${uc.stage.dir}"/>
    </target>

    <target name="compile"  description="Compiling configurator">

         <mkdir dir="${component.classes.dir}"/>

         <javac srcdir="${src.dir}" 
               destdir="${component.classes.dir}"               
               failonerror="true">
               <classpath>              
                   <pathelement location="${stage.dir}/install/lib/engine.jar"/>
                   <pathelement location="${stage.dir}/install/lib/config.jar"/>
                   <pathelement location="${stage.dir}/install/lib/providers/providers.jar"/>
               </classpath>
        </javac>
 
        <unjar src="${stage.dir}/install/lib/providers/providers.jar"
            dest="${tmp.dir}" />

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

        <jar jarfile="${stage.dir}/install/lib/providers/providers.jar"
            basedir="${tmp.dir}"
            manifest="${tmp.dir}/META-INF/MANIFEST.MF">
        </jar>

        <delete dir="${tmp.dir}" />

    </target>

    <target name="assemble"  description="Assembling installer distribution layout">
         <mkdir dir="${stage.dir}/metadata"/>
         <mkdir dir="${stage.dir}/Product/Packages"/>

         <echo message="Staging installer metadata"/>
         <copy todir="${stage.dir}/metadata/dependency">
               <fileset dir="${resources.dir}/dependency" excludes=".svn"/> 
         </copy>
         <copy todir="${stage.dir}/metadata/model">
               <fileset dir="${resources.dir}/model" excludes=".svn"/>
         </copy>
         <copy todir="${stage.dir}/metadata/templates">
               <fileset dir="${resources.dir}/templates" excludes=".svn"/>
         </copy>
         <copy todir="${stage.dir}/metadata/view">
               <fileset dir="${resources.dir}/view" excludes=".svn"/> 
         </copy>
         <copy todir="${stage.dir}/metadata"
               file="${resources.dir}/pagesequence.xml">
         </copy>
         <copy todir="${stage.dir}/metadata"
               file="${resources.dir}/pagesequence.properties">
         </copy>

         <echo message="Staging wrappers"/>

         <copy todir="${stage.dir}">
               <fileset dir="${resources.dir}/wrappers" excludes=".svn,wrapper.sh,engine-wrapper"/>               
         </copy>

         <echo message="Staging registration jar files"/>

	 <copy tofile="${stage.dir}/registration-api.jar"
             file="${maven.repo.local}/org/glassfish/registration/registration-api/10.0-SNAPSHOT/registration-api-10.0-SNAPSHOT.jar"/>

	 <copy tofile="${stage.dir}/registration-impl.jar"
		 file="${maven.repo.local}/org/glassfish/registration/registration-impl/10.0-SNAPSHOT/registration-impl-10.0-SNAPSHOT.jar"/>

	 <copy tofile="${stage.dir}/sysnet-registration.jar"
		 file="${maven.repo.local}/org/glassfish/external/sysnet-registration-repackaged/10.0-SNAPSHOT/sysnet-registration-repackaged-10.0-SNAPSHOT.jar"/>

	 <copy tofile="${stage.dir}/commons-codec-1.3.jar"
		 file="${maven.repo.local}/org/glassfish/external/commons-codec-repackaged/10.0-SNAPSHOT/commons-codec-repackaged-10.0-SNAPSHOT.jar"/>

         <chmod file="${stage.dir}/product-installer.sh" perm="ugo+rx"/>

         <echo message="Staging product payload"/>

         <echo message="Copying Glassfish zip file"/>
 
         <copy tofile="${stage.dir}/Product/Packages/glassfish.zip"
               file="${gf.zip.dir}/V3IPSImage_Installer.zip" />

         <echo message="Copying openInstaller zip files"/>
 
         <copy tofile="${stage.dir}/Product/Packages/Engine.zip"
               file="${maven.repo.local}/org/openinstaller/engine/0.9.4.1/engine-0.9.4.1.zip"/>

         <copy tofile="${stage.dir}/Product/Packages/Resources.zip"
               file="${maven.repo.local}/org/openinstaller/resources/0.9.4.1/resources-0.9.4.1.zip"/>
               
         <echo message="Creating icons zip file"/>

         <copy todir="${tmp.dir}/glassfish/icons">
             <fileset dir="${resources.dir}/icons" excludes=".svn"/>
         </copy>

         <zip destfile="${stage.dir}/Product/Packages/icons.zip"
             basedir="${tmp.dir}" />

         <delete dir="${tmp.dir}/glassfish" />

         <echo message="Creating updatetool bootstrap zip file"/>

         <copy tofile="${tmp.dir}/updatetool/lib/ucbootstrap.jar"
             file="${uc.stage.dir}/ucbootstrap.jar"/>          
         <copy tofile="${tmp.dir}/bin/updatetool"
		 file="${uc.stage.dir}/ucbootstub.sh"/>  
         <copy tofile="${tmp.dir}/bin/updatetool.bat"
		 file="${uc.stage.dir}/ucbootstub.bat"/> 
         <copy tofile="${tmp.dir}/bin/pkg"
		 file="${uc.stage.dir}/ucbootstub.sh"/>  
         <copy tofile="${tmp.dir}/bin/pkg.bat"
                 file="${uc.stage.dir}/ucbootstub.bat"/>	 
         <zip destfile="${stage.dir}/Product/Packages/updatetool.zip"
             basedir="${tmp.dir}" />

         <delete dir="${tmp.dir}" />        

    </target>

    <target name="package"  description="Packaging installer distributions">

         <zip destfile="${basedir}/target/installer_distro.zip"
             basedir="${stage.dir}" />
         <copy tofile="${basedir}/target/setup-windows" file="${resources.dir}/wrappers/setup.exe" overwrite="true"/>
         <concat append="true" encoding="ISO-8859-1" destfile="${basedir}/target/setup-windows">
            <fileset dir="${basedir}/target" includes="installer_distro.zip"/>
        </concat>
        <jar jarfile="${basedir}/target/installer_distro.jar"
            basedir="${stage.dir}">            
        </jar>
        <copy tofile="${basedir}/target/setup-unix" file="${resources.dir}/wrappers/wrapper.sh" overwrite="true"/>
        <concat append="true" encoding="ISO-8859-1" destfile="${basedir}/target/setup-unix">
           <fileset dir="${basedir}/target" includes="installer_distro.jar"/>
        </concat>
    </target>

</project>
 
 
Close
loading
Please Confirm
Close