<?xml version="1.0" encoding="iso-8859-1"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
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
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
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 nucleus distribution creation" default="create.distribution" basedir=".">
<import file="/distributions.xml"/>
<property name="source.distribution.name" value="GlassFish Open Source Edition 3.1.2 Nucleus"/>
<target name="init">
<condition property="windows">
<os family="windows" />
</condition>
<condition property="unix">
<os family="unix" />
</condition>
</target>
<target name="create.distribution">
<echo message="Creating distribution: nucleus"/>
<unzip dest="target/stage">
<fileset dir="target/stage">
<include name="*.zip"/>
</fileset>
</unzip>
<mkdir dir="/target"/>
<delete dir="target/stage" includes="*.zip"/>
<chmod file="target/stage/${install.dir.name}/bin/*" perm="ugo+rx"/>
<chmod file="target/stage/${install.dir.name}/glassfish/bin/*" perm="ugo+rx"/>
<!-- get modules required to create default domain -->
<ant antfile="/distributions.xml" target="fetch-domain-creation-artifacts">
<property name="modules.dir" value="${basedir}/target/stage/${install.dir.name}/glassfish/modules"/>
</ant>
<!-- create domain -->
<antcall target="create-domain"/>
<!-- delete modules required to create default domain; these are not bundled as part of nucleus -->
<ant antfile="/distributions.xml" target="delete-domain-creation-artifacts">
<property name="modules.dir" value="${basedir}/target/stage/${install.dir.name}/glassfish/modules"/>
</ant>
<!-- stage servicetag registry file and set source value -->
<resolveArtifact artifactId="servicetag-registry" groupId="org.glassfish.main.registration" property="servicetag-registry.zip"/>
<unzip src="${servicetag-registry.zip}"
dest="target/stage/${install.dir.name}">
<patternset>
<exclude name="META-INF/**"/>
</patternset>
</unzip>
<replace file="target/stage/${install.dir.name}/glassfish/lib/registration/servicetag-registry.xml"
token="%%%SOURCE%%%" value="${source.distribution.name}"/>
<!-- stage appropriate legal content for this distribution -->
<resolveArtifact artifactId="legal-fragment" groupId="org.glassfish.main.packager" property="legal-fragment.zip"/>
<unzip src="${legal-fragment.zip}"
dest="target/stage/${install.dir.name}">
<patternset>
<exclude name="META-INF/**"/>
</patternset>
</unzip>
<!-- use web profile 3rd party licence file -->
<delete file="target/stage/${install.dir.name}/glassfish/legal/3RD-PARTY-LICENSE.txt" quiet="true" />
<move file="target/stage/${install.dir.name}/glassfish/legal/3RD-PARTY-LICENSE-WEB-PROFILE.txt"
tofile="target/stage/${install.dir.name}/glassfish/legal/3RD-PARTY-LICENSE.txt" />
<!-- create distribution zip -->
<zip file="target/nucleus.zip" duplicate="preserve">
<zipfileset dir="target/stage" filemode="755"
includes="${install.dir.name}/bin/*"
excludes="${install.dir.name}/bin/*.bat" />
<zipfileset dir="target/stage" filemode="755"
includes="${install.dir.name}/glassfish/bin/*"
excludes="${install.dir.name}/glassfish/bin/*.bat" />
<zipfileset dir="target/stage">
<include name="${install.dir.name}/bin/*.bat" />
</zipfileset>
<zipfileset dir="target/stage">
<include name="${install.dir.name}/glassfish/bin/*.bat" />
</zipfileset>
<zipfileset dir="target/stage"
includes="${install.dir.name}/**">
</zipfileset>
</zip>
<!-- Deploy distribution artifact to maven repository" -->
<attachArtifact file="target/nucleus.zip"/>
</target>
<target name="create-domain" depends="create-domain-on-windows, create-domain-on-unix"/>
<target name="create-domain-on-windows" depends="init" if="windows">
<ant antfile="/distributions.xml" target="create-domain">
<property name="exec.dir" value="${basedir}/target/stage/${install.dir.name}/glassfish/bin"/>
<property name="exec.executable" value="${basedir}/target/stage/${install.dir.name}/glassfish/bin/asadmin.bat"/>
</ant>
</target>
<target name="create-domain-on-unix" depends="init" if="unix">
<ant antfile="/distributions.xml" target="create-domain">
<property name="exec.dir" value="${basedir}/target/stage/${install.dir.name}/glassfish/bin"/>
<property name="exec.executable" value="${basedir}/target/stage/${install.dir.name}/bin/asadmin"/>
</ant>
</target>
</project>