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 / tags / gf-v3-pre-gui-redesign / distributions-prelude / distributions.xml

Size: 16078 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 Prelude"/>
<property name="description" value="GlassFish v3 Prelude is the first production-ready release of the GlassFish v3 Application Server. This includes Java EE 5 based web tier, scripting support, OSGi support, JDBC and persistence API on top of the new modular kernel of GlassFish. In addition, through update center the users will be obtain new Java EE 6 APIs and containers (for example, EJB 3.1 and JAX-RS 1.0)."/>
<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>
    <exec dir="${installer.image.dir}/${install.dir.name}" executable="zip">
        <arg line= "-r ../../../../target/${image.name}-ips-installer.zip ."/>
    </exec>

    <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>
    <exec dir="${glassfish.image.dir}" executable="zip">
        <arg line= "-r ../../../target/${image.name}-ips.zip ${install.dir.name}"/>
    </exec>
    <!-- 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 description 'GlassFish v3 Prelude is the first production-ready release of the GlassFish v3 Application Server. This includes Java EE 5 based web tier, scripting support, OSGi support, JDBC and persistence API on top of the new modular kernel of GlassFish. In addition, through update center the users will be obtain new Java EE 6 APIs and containers (for example, EJB 3.1 and JAX-RS 1.0).'"/>
    </exec>
    <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 ${repo.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="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="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="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" -->
    <exec dir="${exec.dir}" executable="${exec.executable}">
        <arg line= "create-domain --savelogin=true --checkports=false --adminport 4848 --user anonymous --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="realms" groupId="org.glassfish.security" property="realms.jar"/>
    <resolveArtifact artifactId="amx-api" groupId="org.glassfish.common" property="amx-api.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="realms jar: ${realms.jar}"/>
    <echo message="amx-api jar: ${amx-api.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="${realms.jar}" tofile="${modules.dir}/realms.jar"/>
    <copy file="${amx-api.jar}" tofile="${modules.dir}/amx-api.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="realms.jar"/>
            <include name="backup.jar"/>
            <include name="amx-api.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" />
        <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"/>
    </delete>
</target>
</project>
 
 
Close
loading
Please Confirm
Close