distributions.xml revision ada1678a4262b208a7b87391f520a7767d25287c
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
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
or packager/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 packager/legal/LICENSE.txt.
GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.
Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [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.
-->
<project name="GlassFish Distributions (IPS) Creation" default="create-prelude-image" basedir=".">
<!-- property name="repo.url" value="http://localhost:10000"/ -->
<property name="title" value="GlassFish 3"/>
<property name="description" value="GlassFish Server is a modular, lightweight, and extensible Java EE 6 application server built on OSGi. Key features include fast startup time, improved developer productivity, hybrid OSGi/Java EE applications, high availability clustering, centralized administration, and overall ease-of-use."/>
<property name="javaeesdk.release.repository.url" value="http://pkg.oracle.com/javaeesdk/6/release/"/>
<target name="init">
</target>
<target name="create-nucleus-distributions">
<ant antfile="/nucleus/nucleus-distributions.xml"/>
<antcall target="create-distributions">
</antcall>
</target>
<target name="create-minnow-distributions" depends="create-nucleus-distributions">
<ant antfile="/minnow/minnow-distributions.xml"/>
<mkdir dir="${image.root}"/>
<mkdir dir="${installer.image.dir}"/>
<antcall target="remove-default-domain"/>
<antcall target="create-distributions">
</antcall>
<antcall target="restore-default-domain"/>
</target>
<target name="create-web-distributions" depends="create-minnow-distributions">
<ant antfile="/web/web-distributions.xml"/>
<mkdir dir="${image.root}"/>
<mkdir dir="${installer.image.dir}"/>
<antcall target="create-distributions">
</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">
</antcall>
</target>
<target name="create-distributions" description="Creating IPS Distributions">
<!-- 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.*"/>
<fileset dir="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/download" includes="**/*"/>
<fileset dir="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/pkg" includes="**/license.*"/>
</delete>
<antcall target="pack-compression">
</antcall>
<antcall target="pack-compression">
</antcall>
<!-- backup cfg_cache file, replace repo.url value, remove uuid and variant.arch, 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="${stable.repository.url}"/>
</replace>
<copy file="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<arg line="-c "grep -v '^uuid =' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<copy file="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp"
overwrite="true"/>
<arg line="-c "grep -v 'variant.arch' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<delete file="${installer.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<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" />
<copy file="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${basedir}/cfg_cache.bak" />
<replace file="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache">
<replacefilter token="${repo.url}"
value="${stable.repository.url}"/>
</replace>
<copy file="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<exec dir="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg" executable="/bin/sh">
<arg line="-c "grep -v '^uuid =' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<copy file="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
overwrite="true"/>
<exec dir="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg" executable="/bin/sh">
<arg line="-c "grep -v 'variant.arch' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<delete file="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<arg line= "-r /target/${image.name}-ips-ml-installer.zip ."/>
</exec>
<move file="${basedir}/cfg_cache.bak"
tofile="${installer.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
overwrite="true" />
<!-- 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.*"/>
<fileset dir="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/download" includes="**/*"/>
<fileset dir="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/pkg" includes="**/license.*"/>
</delete>
<!-- backup cfg_cache file, replace repo.url value, remove uuid and variant.arch, 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="${stable.repository.url}"/>
</replace>
<copy file="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<arg line="-c "grep -v '^uuid =' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<copy file="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp"
overwrite="true"/>
<arg line="-c "grep -v 'variant.arch' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<delete file="${glassfish.image.dir}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<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" />
<copy file="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${basedir}/cfg_cache.bak" />
<replace file="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache">
<replacefilter token="${repo.url}"
value="${stable.repository.url}"/>
</replace>
<copy file="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
tofile="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<exec dir="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg" executable="/bin/sh">
<arg line="-c "grep -v '^uuid =' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<copy file="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
overwrite="true"/>
<exec dir="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg" executable="/bin/sh">
<arg line="-c "grep -v 'variant.arch' cfg_cache.grep.tmp > cfg_cache""/>
</exec>
<delete file="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache.grep.tmp" />
<arg line= "-r /target/${image.name}-ips-ml.zip ${install.dir.name}"/>
</exec>
<move file="${basedir}/cfg_cache.bak"
tofile="${glassfish.image.dir.l10n}/${install.dir.name}/.org.opensolaris,pkg/cfg_cache"
overwrite="true" />
</target>
<target name="create-local-image" depends="check-ips"
description="Create local IPS image using ${repo.url}">
<mkdir dir="${image.dir}"/>
<exec executable="pkg" failonerror="true">
<arg line="image-create -U -a ${stable.authority}=${repo.url} ${image.dir}" />
</exec>
<arg line="refresh" />
</exec>
<!-- Set title and description properties in UC cfg_cache -->
<echo message="title: ${title}"/>
<echo message="description: ${description}"/>
<arg line="set-property title 'GlassFish 3'"/>
</exec>
<arg line="set-property image-tou-url 'http://glassfish-repo.java.net/terms.html'"/>
</exec>
<arg line="set-property description 'GlassFish Server is a modular, lightweight, and extensible Java EE 6 application server built on OSGi. Key features include fast startup time, improved developer productivity, hybrid OSGi/Java EE applications, high availability clustering, centralized administration, and overall ease-of-use.'"/>
</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}"/>
<arg line="install ${package.name}" />
</exec>
</target>
<target name="check-ips">
<!-- 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">
<echo message="Updating cfg_cache in local IPS image with ${repo.url}"/>
<echo message="cfg_cache: ${image.cache}"/>
<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">
</antcall>
</target>
<target name="create-authorities" depends="check-ips"
description="Update cfg_cache for authorities">
<arg line="set-authority -P -O ${repo.url} '${stable.authority}'"/>
</exec>
<!-- removing dev publisher reference
<exec dir="${image.dir}" executable="pkg" failonerror="true">
<arg line="set-authority -O ${dev.repository.url} '${dev.authority}'"/>
</exec>
-->
<arg line="set-authority -O ${contrib.repository.url} '${contrib.authority}'"/>
</exec>
<arg line="set-authority -O ${sun.contrib.repository.url} '${sun.contrib.authority}'"/>
</exec>
<!-- adding Java EE SDK repository for non-AIX platforms -->
<condition property="isAIX">
<os name="AIX" />
</condition>
<antcall target="add-SDK-publisher">
</antcall>
</target>
<target name="add-SDK-publisher" unless="isAIX">
<arg line="set-authority -O ${javaeesdk.release.repository.url} -d '${javaeesdk.release.authority}'"/>
</exec>
</target>
<target name="stage-updatetool-stubs" unless="isAIX">
</target>
<target name="remove-default-domain">
<mkdir dir="${basedir}/domains_bak"/>
<move file="${glassfish.image.dir}/${install.dir.name}/glassfish/domains/domain1" todir="${basedir}/domains_bak"/>
</target>
<target name="restore-default-domain">
<move file="${basedir}/domains_bak/domain1" todir="${glassfish.image.dir}/${install.dir.name}/glassfish/domains"/>
</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}"/>
<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.main.admin" property="cli-optional.jar"/>
<resolveArtifact artifactId="server-mgmt" groupId="org.glassfish.main.admin" property="server-mgmt.jar"/>
<echo message="cli-optional jar: ${cli-optional.jar}"/>
<echo message="server-mgmt jar: ${server-mgmt.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"/>
</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,**/org.eclipse.persistence.*.jar" />
</apply>
<!-- remove *.pack.gz files -->
<delete>
<fileset dir="${image.directory}/${install.dir.name}/glassfish/modules" includes="**/*.jar" excludes="**/javahelp.jar,**/org.eclipse.persistence.*.jar" />
</delete>
</target>
</project>