Skip to main content

Source code file content

Revision: 57041

Fix copyright
» Project Revision History

» Checkout URL

svn / tags / 3.0-b64 / distributions / distributions.xml

Size: 17241 bytes, 1 line
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
The contents of this file are subject to the terms
of the Common Development and Distribution License
(the "License").  You may not use this file except
in compliance with the License.

You can obtain a copy of the license at
glassfish/bootstrap/legal/CDDLv1.0.txt or
https://glassfish.dev.java.net/public/CDDLv1.0.html.
See the License for the specific language governing
permissions and limitations under the License.

When distributing Covered Code, include this CDDL
HEADER in each file and include the License file at
glassfish/bootstrap/legal/CDDLv1.0.txt.  If applicable,
add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your
own identifying information: Portions Copyright [yyyy]
[name of copyright owner]
-->
<project name="GlassFish Distributions (IPS) Creation" default="create-prelude-image" basedir=".">

<property name="image.root" value="target/local_image"/>
<property name="installer.image.dir" value="${image.root}/installer"/>
<property name="glassfish.image.dir" value="${image.root}/glassfish"/>
<property name="install.dir.name" value="glassfishv3"/>
<property name="repo.url" value="http://repine.sfbay.sun.com:40000"/>
<!-- property name="repo.url" value="http://localhost:10000"/ -->
<property name="repo.host" value="http://pkg.glassfish.org"/>
<property name="title" value="GlassFish v3 Preview"/>
<property name="description" value="GlassFish v3 is the reference implementation of Java EE 6 Platform as defined by JCP (Java Community Process, www.jcp.org). In addition to the latest Java EE standards, GlassFish v3 includes scripting support built on top of the new modular GlassFish kernel running on OSGi platform."/>
<property name="image.cache" value="${image.dir}/.org.opensolaris,pkg/cfg_cache"/>
<property name="dev.authority" value="dev.glassfish.org"/>
<property name="contrib.authority" value="contrib.glassfish.org"/>
<property name="repository.url" value="http://pkg.glassfish.org/v3"/>
<property name="dev.repository.url" value="${repository.url}/dev/"/>
<property name="contrib.repository.url" value="${repository.url}/contrib/"/>
<property name="sun.contrib.authority" value="contrib.glassfish.sun.com"/>
<property name="sun.repository.url" value="http://pkg.sun.com/glassfish/v3/dev/"/>
<property name="sun.contrib.repository.url" value="http://pkg.sun.com/glassfish/v3/contrib/"/>

<target name="init"> 
    
</target>

<target name="create-nucleus-distributions"> 
    <ant antfile="../nucleus/nucleus-distributions.xml"/>
    <antcall target="create-distributions"> 
         <param name="image.name" value="nucleus"/>
    </antcall>
</target>

<target name="create-scripting-distributions" depends="create-nucleus-distributions"> 
    <ant antfile="../scripting/scripting-distributions.xml"/>
    <antcall target="create-distributions"> 
         <param name="image.name" value="scripting"/>
    </antcall>
</target>

<target name="create-web-nb-distributions" depends="create-scripting-distributions"> 
    <ant antfile="../web-nb/web-nb-distributions.xml"/>
    <antcall target="create-distributions"> 
         <param name="image.name" value="web-nb"/>
    </antcall>
</target>

<target name="create-web-distributions" depends="create-web-nb-distributions"> 
    <ant antfile="../web/prelude-distributions.xml"/>
    <mkdir dir="${image.root}"/>
    <mkdir dir="${installer.image.dir}"/>
    <antcall target="create-distributions"> 
         <param name="image.name" value="web"/>
    </antcall>
</target>

<target name="create-glassfish-distributions" depends="create-web-distributions"> 
    <ant antfile="../glassfish/glassfish-distributions.xml"/>
    <mkdir dir="${image.root}"/>
    <mkdir dir="${installer.image.dir}"/>
    <antcall target="create-distributions"> 
         <param name="image.name" value="glassfish"/>
    </antcall>
</target>

<target name="create-distributions" description="Creating IPS Distributions">
    <chmod file="${installer.image.dir}/${install.dir.name}/bin/*" perm="ugo+rx"/>
    <chmod file="${installer.image.dir}/${install.dir.name}/glassfish/bin/*" perm="ugo+rx"/>
    <!-- Delete all contents under ips-metadata download directory --> 
    <delete includeemptydirs="true">
        <fileset dir="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/download" includes="**/*"/>
        <fileset dir="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/pkg" includes="**/license.*"/>
    </delete>
    <antcall target="pack-compression">
        <param name="image.directory" value="${installer.image.dir}"/>
    </antcall>
    <!-- backup cfg_cache file, replace repo.url value, zip, restore -->
    <copy file="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
	    tofile="${basedir}/cfg_cache.bak" />
    <replace file="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache">
	    <replacefilter token="${repo.url}"
		    value="${dev.repository.url}"/>
    </replace>	
    <exec dir="${installer.image.dir}/${install.dir.name}" executable="zip">
        <arg line= "-r ../../../../target/${image.name}-ips-installer.zip ."/>
    </exec>
    <move file="${basedir}/cfg_cache.bak" 
	  tofile="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
	  overwrite="true" />

    <chmod file="${glassfish.image.dir}/${install.dir.name}/bin/*" perm="ugo+rx"/>
    <chmod file="${glassfish.image.dir}/${install.dir.name}/glassfish/bin/*" perm="ugo+rx"/>
    <!-- Delete all contents under ips-metadata download directory --> 
    <delete includeemptydirs="true">
        <fileset dir="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/download" includes="**/*"/>
        <fileset dir="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/pkg" includes="**/license.*"/>
    </delete>
    <!-- backup cfg_cache file, replace repo.url value, zip, restore -->
    <copy file="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
	    tofile="${basedir}/cfg_cache.bak" />
    <replace file="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache">
	    <replacefilter token="${repo.url}"
		    value="${dev.repository.url}"/>
    </replace>	
    <exec dir="${glassfish.image.dir}" executable="zip">
        <arg line= "-r ../../../target/${image.name}-ips.zip ${install.dir.name}"/>
    </exec>
    <move file="${basedir}/cfg_cache.bak" 
	  tofile="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
	  overwrite="true" />
    <!-- delete dir="${image.root}"/ -->
</target>

<target name="create-local-image" depends="check-ips"
    description="Create local IPS image using ${repo.url}">
    <echo message="Creating local IPS image for ${repo.url} to ${image.dir}"/>
    <mkdir dir="${image.dir}"/>
    <exec executable="pkg" failonerror="true">
        <arg line="image-create -U -a ${dev.authority}=${repo.url} ${image.dir}" />
    </exec>
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="refresh" />
    </exec>

    <!-- Set title and description properties in UC cfg_cache -->
    <echo message="title: ${title}"/>
    <echo message="description: ${description}"/>
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="set-property title 'GlassFish v3'"/>
    </exec>
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="set-property image-tou-url 'https://glassfish-repo.dev.java.net/terms.html'"/>
    </exec>

    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="set-property description 'GlassFish v3 is the reference implementation of Java EE 6 Platform as defined by JCP (Java Community Process, www.jcp.org). In addition to the latest Java EE standards, GlassFish v3 includes scripting support built on top of the new modular GlassFish kernel running on OSGi platform.'"/>
    </exec>
   
</target>

<target name="install-package" depends="check-ips"
    description="Install Package ${package.name} from ${repo.url}">
    <echo message="Install Package ${package.name} from ${repo.url} to ${image.dir}"/>
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="install ${package.name}" />
    </exec>
</target>

<target name="check-ips">
    <available file="pkg" property="ips.present"/>
    <!-- fail message="Install IPS/UC2.0 Client. Unable to find pkg, pkgsend commands" unless="ips.present"/ -->
</target>

<target name="update-cfg-cache" depends="check-ips">
    <property name="image.cache" value="${image.dir}/.org.opensolaris,pkg/cfg_cache"/>
    <echo message="Updating cfg_cache in local IPS image with ${repo.url}"/>
    <echo message="image.dir: ${image.dir}"/>
    <echo message="cfg_cache: ${image.cache}"/>
    <available file="${image.dir}/.org.opensolaris,pkg/cfg_cache" property="cache.present"/>
    <fail message="${image.dir}/.org.opensolaris,pkg/cfg_cache File NOT present, call create-local-image target first" unless="cache.present"/>

    <antcall target="create-authorities"> 
         <param name="image.dir" value="${image.dir}"/>
    </antcall> 

    <!-- final origin URLs are already set in set-authority commands -->

    <!--antcall target="update-cfg-cache-for-dev-repository-urls"/--> 

    <!--antcall target="update-cfg-cache-for-contrib-repository-urls"/-->

    <!-- disabling sun contrib repo setup until close to fcs
    <antcall target="update-cfg-cache-for-sun-contrib-repository-urls"/>
    --> 
</target>

<target name="create-authorities" depends="check-ips"
	description="Update cfg_cache for authorities">

    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="set-authority -P -O ${repo.url} '${dev.authority}'"/>
    </exec>
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
        <arg line="set-authority -O ${contrib.repository.url} '${contrib.authority}'"/>
    </exec>
    <!-- disabling sun contrib authority setup - not used until close to fcs
    <exec dir="${image.dir}" executable="pkg" failonerror="true">
	    <arg line="set-authority -O ${repo.url} '${sun.contrib.authority}'"/>
    </exec>
    -->
</target>


<target name="update-cfg-cache-for-dev-repository-urls">
    <!-- This double replacement is necessary because the replace task doesn't allow properties to be substituted in a multi-line replace -->
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache" token="prefix = ${dev.authority}">
        <replacevalue><![CDATA[prefix = dev.glassfish.org
origin-for-windows-i386-dev
origin-for-sunos-i386-dev
origin-for-sunos-sparc-dev
origin-for-linux-i386-dev
origin-for-darwin-universal-dev]]>
        </replacevalue>
    </replace>
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache">
        <replacefilter token="origin-for-windows-i386-dev"
            value="origin-for-windows-i386 = http://pkg.glassfish.org/v3/dev/windows/"/>
        <replacefilter token="origin-for-sunos-i386-dev"
            value="origin-for-sunos-i386 = http://pkg.glassfish.org/v3/dev/solaris-x86/"/>
        <replacefilter token="origin-for-sunos-sparc-dev"
            value="origin-for-sunos-sparc = http://pkg.glassfish.org/v3/dev/solaris-sparc/"/>
        <replacefilter token="origin-for-linux-i386-dev"
            value="origin-for-linux-i386 = http://pkg.glassfish.org/v3/dev/linux/"/>
        <replacefilter token="origin-for-darwin-universal-dev"
            value="origin-for-darwin-universal = http://pkg.glassfish.org/v3/dev/mac/"/>
    </replace>
</target>

<target name="update-cfg-cache-for-contrib-repository-urls">
    <!-- This double replacement is necessary because the replace task doesn't allow properties to be substituted in a multi-line replace -->
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache" token="prefix = ${contrib.authority}">
        <replacevalue><![CDATA[prefix = contrib.glassfish.org
origin-for-windows-i386-contrib
origin-for-sunos-i386-contrib
origin-for-sunos-sparc-contrib
origin-for-linux-i386-contrib
origin-for-darwin-universal-contrib]]>
        </replacevalue>
    </replace>
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache">
        <replacefilter token="origin-for-windows-i386-contrib"
            value="origin-for-windows-i386 = http://pkg.glassfish.org/v3/contrib/windows/"/>
        <replacefilter token="origin-for-sunos-i386-contrib"
            value="origin-for-sunos-i386 = http://pkg.glassfish.org/v3/contrib/solaris-x86/"/>
        <replacefilter token="origin-for-sunos-sparc-contrib"
            value="origin-for-sunos-sparc = http://pkg.glassfish.org/v3/contrib/solaris-sparc/"/>
        <replacefilter token="origin-for-linux-i386-contrib"
            value="origin-for-linux-i386 = http://pkg.glassfish.org/v3/contrib/linux/"/>
        <replacefilter token="origin-for-darwin-universal-contrib"
            value="origin-for-darwin-universal = http://pkg.glassfish.org/v3/contrib/mac/"/>
    </replace>
</target>

<target name="update-cfg-cache-for-sun-contrib-repository-urls">
    <!-- This double replacement is necessary because the replace task doesn't allow properties to be substituted in a multi-line replace -->
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache" token="prefix = ${sun.contrib.authority}">
        <replacevalue><![CDATA[prefix = contrib.glassfish.sun.com 
origin-for-windows-i386-sun-contrib
origin-for-sunos-i386-sun-contrib
origin-for-sunos-sparc-sun-contrib
origin-for-linux-i386-sun-contrib
origin-for-darwin-universal-sun-contrib]]>
        </replacevalue>
    </replace>
    <replace file="${image.dir}/.org.opensolaris,pkg/cfg_cache">
        <replacefilter token="origin-for-windows-i386-sun-contrib"
            value="origin-for-windows-i386 = http://pkg.sun.com/glassfish/v3/contrib/windows/"/>
        <replacefilter token="origin-for-sunos-i386-sun-contrib"
            value="origin-for-sunos-i386 = http://pkg.sun.com/glassfish/v3/contrib/solaris-x86/"/>
        <replacefilter token="origin-for-sunos-sparc-sun-contrib"
            value="origin-for-sunos-sparc = http://pkg.sun.com/glassfish/v3/contrib/solaris-sparc/"/>
        <replacefilter token="origin-for-linux-i386-sun-contrib"
            value="origin-for-linux-i386 = http://pkg.sun.com/glassfish/v3/contrib/linux/"/>
        <replacefilter token="origin-for-darwin-universal-sun-contrib"
            value="origin-for-darwin-universal = http://pkg.sun.com/glassfish/v3/contrib/mac/"/>
    </replace>
</target>

<!-- Create Domain -->
<target name="create-domain"
    description="Create default domain- domain1">
    <echo message="Directory to run command from: ${exec.dir}"/>
    <echo message="Command to run: ${exec.executable}"/>
    <exec dir="${exec.dir}" executable="${exec.executable}" failonerror="true" >
        <arg line="--user admin create-domain --nopassword --savelogin=true --checkports=false --adminport 4848 --instanceport 8080 --keytooloptions CN=localhost domain1"/>
    </exec>
</target>

<!-- get artifacts required to create default domain -->
<target name="fetch-domain-creation-artifacts">
    <resolveArtifact artifactId="cli-optional" groupId="org.glassfish.admin" property="cli-optional.jar"/>
    <resolveArtifact artifactId="server-mgmt" groupId="org.glassfish.admin" property="server-mgmt.jar"/>
    <resolveArtifact artifactId="admin-util" groupId="org.glassfish.admin" property="admin-util.jar"/>
    <resolveArtifact artifactId="security" groupId="org.glassfish.security" property="security.jar"/>

    <echo message="cli-optional jar: ${cli-optional.jar}"/>
    <echo message="server-mgmt jar: ${server-mgmt.jar}"/>
    <echo message="admin-util jar: ${admin-util.jar}"/>
    <echo message="security jar: ${security.jar}"/>

    <copy file="${cli-optional.jar}" tofile="${modules.dir}/cli-optional.jar"/>
    <copy file="${server-mgmt.jar}" tofile="${modules.dir}/server-mgmt.jar"/>
    <copy file="${admin-util.jar}" tofile="${modules.dir}/admin-util.jar"/>
    <copy file="${security.jar}" tofile="${modules.dir}/security.jar"/>
</target>

<!-- delete artifacts required to create default domain; these are not bundled as part of nucleus -->
<target name="delete-domain-creation-artifacts">
    <delete>
        <fileset dir="${modules.dir}">
            <include name="cli-optional.jar"/>
            <include name="server-mgmt.jar"/>
            <include name="admin-util.jar"/>
            <include name="security.jar"/>
            <include name="backup.jar"/>
        </fileset>
    </delete>
</target>
<!-- pack200 compression -->
<target name="pack-compression">
    <apply executable="pack200" dest="${image.directory}/${install.dir.name}/glassfish/modules" parallel="false">
        <targetfile/>
        <srcfile/>
	<fileset dir="${image.directory}/${install.dir.name}/glassfish/modules" includes="**/*.jar" excludes="**/javahelp.jar" />
        <mapper type="glob" from="*.jar" to="*.pack.gz"/>
    </apply>
    <!-- remove *.pack.gz files -->
    <delete>
	    <fileset dir="${image.directory}/${install.dir.name}/glassfish/modules" includes="**/*.jar" excludes="**/javahelp.jar" />
    </delete>
</target>
</project>
 
 
Close
loading
Please Confirm
Close