4N/A<?xml version="1.0" encoding="iso-8859-1"?>
4N/A<!--
292N/A
52N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
52N/A
292N/A Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
52N/A
52N/A The contents of this file are subject to the terms of either the GNU
52N/A General Public License Version 2 only ("GPL") or the Common Development
52N/A and Distribution License("CDDL") (collectively, the "License"). You
292N/A may not use this file except in compliance with the License. You can
292N/A obtain a copy of the License at
292N/A https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
292N/A or packager/legal/LICENSE.txt. See the License for the specific
52N/A language governing permissions and limitations under the License.
4N/A
52N/A When distributing the software, include this License Header Notice in each
292N/A file and include the License file at packager/legal/LICENSE.txt.
292N/A
292N/A GPL Classpath Exception:
292N/A Oracle designates this particular file as subject to the "Classpath"
292N/A exception as provided by Oracle in the GPL Version 2 section of the License
292N/A file that accompanied this code.
292N/A
292N/A Modifications:
292N/A If applicable, add the following below the License Header, with the fields
292N/A enclosed by brackets [] replaced by your own identifying information:
292N/A "Portions Copyright [year] [name of copyright owner]"
52N/A
52N/A Contributor(s):
52N/A If you wish your version of this file to be governed by only the CDDL or
52N/A only the GPL Version 2, indicate your decision by adding "[Contributor]
52N/A elects to include this software in this distribution under the [CDDL or GPL
52N/A Version 2] license." If you don't indicate a single choice of license, a
52N/A recipient has the option to distribute your version of this file under
52N/A either the CDDL, the GPL Version 2 or to extend the choice of license to
52N/A its licensees as provided above. However, if you add GPL Version 2 code
52N/A and therefore, elected the GPL Version 2 license, then the option applies
52N/A only if the new code is made subject to such option by the copyright
52N/A holder.
292N/A
4N/A-->
52N/A
4N/A<!DOCTYPE project [
4N/A <!ENTITY commonBuild SYSTEM "ant-common.xml">
4N/A]>
4N/A<project name="JavaMail" default="all" basedir="."
4N/A xmlns:cpptasks="antlib:org.sf.net.antcontrib.cpptasks">
4N/A
4N/A <taskdef resource="cpptasks.tasks"/>
4N/A <typedef resource="cpptasks.types"/>
4N/A
4N/A<!-- ========== Initialize Properties =================================== -->
4N/A
4N/A <!--
4N/A component.name: required property. the value should be the
4N/A name of the component directory
4N/A -->
4N/A <property name="component.name" value="mbox"/>
4N/A
4N/A <property file="/build.properties"/>
4N/A
4N/A <property name="cc.debug" value="false"/>
13N/A <property name="generated.dir" value="mbox/target/generated"/>
13N/A <property name="obj.dir" value="mbox/target/native/${os.name}-${os.arch}"/>
13N/A <property name="lib.dir" value="mbox/target/lib/${os.name}-${os.arch}"/>
4N/A <condition property="is-solaris">
4N/A <os name="SunOS"/>
4N/A </condition>
4N/A
4N/A &commonBuild;
4N/A
4N/A <!-- all -->
4N/A <target name="all" depends="mboxcompile, mboxcc, mboxjar"
4N/A description="Build entire mbox component">
4N/A </target>
4N/A
4N/A <!-- build -->
4N/A <target name="build" depends="mboxcompile, mboxcc, mboxjar"
4N/A description="Build entire mbox component">
4N/A </target>
4N/A
4N/A <!-- init. Initialization involves creating publishing directories and
4N/A OS specific targets. -->
4N/A <target name="init" description="${component.name} initialization">
4N/A <tstamp>
4N/A <format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
4N/A </tstamp>
4N/A <echo message="Building component ${component.name}"/>
4N/A <mkdir dir="${component.classes.mbox.dir}"/>
4N/A <mkdir dir="${generated.dir}"/>
4N/A <mkdir dir="${obj.dir}"/>
4N/A <mkdir dir="${lib.dir}"/>
4N/A </target>
4N/A
4N/A <!-- prepare manifest files for jars -->
4N/A <target name="cook-manifest" depends="init"
4N/A description="Generate MANIFEST.MF files">
13N/A <mkdir dir="${component.classes.mbox.dir}/manifest"/>
13N/A <copy file="${resources.mbox.dir}/META-INF/MANIFEST.MF"
13N/A tofile="${component.classes.mbox.dir}/manifest/MANIFEST.MF">
13N/A <filterset begintoken="{" endtoken="}">
13N/A <filter token="mail.spec.version"
13N/A value="${release.specversion}"/>
13N/A <filter token="mail.version" value="${release.version}"/>
4N/A </filterset>
4N/A </copy>
4N/A </target>
4N/A
4N/A <!-- mbox compile -->
4N/A <target name="mboxcompile" depends="init"
4N/A description="Compile com/sun/mail/mbox sources">
4N/A
13N/A <javac srcdir="${src.mbox.dir}"
4N/A destdir="${component.classes.mbox.dir}"
4N/A debug="${javac.debug}"
4N/A optimize="${javac.optimize}"
4N/A source="${javac.source}"
4N/A deprecation="${javac.deprecation}"
4N/A failonerror="true"
4N/A target="${javac.target}">
4N/A <classpath>
4N/A <pathelement location="${component.classes.dir}"/>
4N/A <pathelement location="${activation.jar}"/>
4N/A </classpath>
13N/A <!--
4N/A <include name="com/sun/mail/mbox/**"/>
13N/A -->
4N/A </javac>
4N/A </target>
4N/A
4N/A <target name="mboxheaders" depends="mboxcompile">
4N/A <javah destdir="${generated.dir}"
4N/A force="yes"
4N/A verbose="yes"
13N/A classpath="${component.classes.mbox.dir}:${component.classes.dir}">
4N/A <class name="com.sun.mail.mbox.UNIXFile"/>
4N/A <class name="com.sun.mail.mbox.UNIXInbox"/>
4N/A </javah>
4N/A </target>
4N/A
4N/A <target name="mboxcc" depends="mboxheaders, mboxcc-solaris"/>
4N/A
4N/A <!--
4N/A make-based build uses these compiler and linker options:
4N/A
4N/A cc -Xa -xO2 -v -D_REENTRANT -Dsparc -DSOLARIS2
4N/A
4N/A cc -G -o /build/solaris/lib/sparc/libmbox.so
4N/A obj/sparc/UNIXFile.o obj/sparc/UNIXInbox.o
4N/A -L/java/re/jdk/1.4/archive/fcs/binaries/solsparc/jre/lib/sparc
4N/A /build/solaris/lib/sparc
4N/A -lmail
4N/A /build/solaris/lib/sparc
4N/A -ljava
4N/A -lc
4N/A -->
4N/A
4N/A <target name="mboxcc-solaris" depends="mboxheaders" if="is-solaris">
4N/A <cc debug="${cc.debug}"
4N/A link="shared"
4N/A outfile="${lib.dir}/mbox"
4N/A objdir="${obj.dir}">
4N/A <compiler name="sunc89"/>
13N/A <fileset dir="mbox/src/main/cpp" includes="**/*.c"/>
4N/A <includepath location="${generated.dir}"/>
4N/A <sysincludepath location="${java.home}/include"/>
4N/A <sysincludepath location="${java.home}/include/solaris"/>
4N/A <defineset>
4N/A <define name="_REENTRANT"/>
4N/A </defineset>
4N/A <compilerarg value="-Xa"/>
4N/A <compilerarg value="-xO2"/>
4N/A <linker name="sunc89">
4N/A <syslibset libs="mail,java,c"/>
4N/A </linker>
4N/A </cc>
4N/A </target>
4N/A
4N/A <target name="clean" description="Clean the build">
4N/A <delete includeEmptyDirs="true" failonerror="false">
13N/A <fileset dir="${component.classes.mbox.dir}"/>
4N/A </delete>
4N/A </target>
4N/A
4N/A <!-- JavaMail bundle build targets -->
4N/A
4N/A <target name="mboxrelease" depends="init, mboxjar, mboxcc">
13N/A <property name="rel" value="mbox-${release.version}"/>
13N/A <property name="zipname" value="${rel}.zip"/>
13N/A <delete file="${basedir}/mbox/target/${zipname}"/>
13N/A <echo message="Creating mbox bundle ${basedir}/mbox/target/${zipname}"/>
13N/A <zip destfile="${basedir}/mbox/target/${zipname}">
13N/A <zipfileset dir="${resources.legal.dir}/META-INF" prefix="${rel}"
13N/A includes="LICENSE.txt"/>
13N/A <zipfileset dir="${release.dir}/lib" prefix="${rel}"
4N/A includes="mbox.jar"/>
13N/A <zipfileset dir="${lib.dir}/.." prefix="${rel}/lib"
4N/A includes="**/*.so"/>
4N/A </zip>
4N/A </target>
4N/A
4N/A <target name="mboxjar" depends="init, mboxcompile, cook-manifest">
4N/A <mkdir dir="${release.dir}/lib"/>
4N/A <jar jarfile="${release.mbox.jar}"
13N/A manifest="${component.classes.mbox.dir}/manifest/MANIFEST.MF">
13N/A <metainf dir="${resources.legal.dir}/META-INF"
13N/A includes="LICENSE.txt"/>
13N/A <fileset dir="${component.classes.mbox.dir}">
4N/A <include name="com/sun/mail/mbox/*.class"/>
4N/A <include name="com/sun/mail/mbox/mailcap"/>
4N/A </fileset>
4N/A </jar>
4N/A </target>
4N/A
4N/A <target name="push-to-maven-prepare" depends="-push-to-maven-init, mboxjar"
4N/A description="creates an image for the 'push-to-maven' goal">
4N/A <delete dir="target/maven-repo" /><!-- clean it -->
4N/A <maven-repository-importer destdir="target/maven-repo"
4N/A version="${release.version}">
4N/A <artifact jar="target/release/mbox.jar" pom="mbox.pom"
4N/A srczip="target/mbox.src.zip" />
4N/A </maven-repository-importer>
4N/A </target>
4N/A
4N/A <target name="push-to-maven" depends="push-to-maven-prepare"
4N/A description="pushes jars to the java.net maven repository">
4N/A <cvs-import src="target/maven-repo" dest="glassfish/repo" />
4N/A </target>
4N/A</project>