FeaturesPluginsDocs & SupportCommunityPartners

<?xml version="1.0"?>

<!--
 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.

 Copyright 2005 Sun Microsystems Inc. All Rights Reserved.

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 do not 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.-->

<![CDATA[                                                                                                                                                                            
function matchwo(a,b)                                                                                                                                                                
{                                                                                                                                                                                    
if (a < b && a < 0) then                                                                                                                                                             
   {                                                                                                                                                                                 
   	return 1                                                                                                                                                                       
   }                                                                                                                                                                                 
else                                                                                                                                                                                 
   {                                                                                                                                                                                 
   	return 0                                                                                                                                                                       
   }                                                                                                                                                                                 
}                                                                                                                                                                                    
]]>                                                                                                                                                                                             

<project name="jsf-demo" default="main" basedir=".">

    <taskdef resource="net/sf/antcontrib/antlib.xml"/>
    
    <!-- below selected text -->
    <property file="build.properties"/>
    <property name="jsf-api.jar" value="../lib/jsf-api.jar"/>
    <property name="jsf-impl.jar" value="../lib/jsf-impl.jar"/>
    <property name="ui.jar" value="${basedir}/ui.jar"/>                                                                                                                           
        
        
    <target name="main">
        <build-sample sample-name="jsf-cardemo" sample-dir="cardemo"/>
        <build-sample sample-name="jsf-guessNumber" sample-dir="guessNumber"/>
        <build-sample sample-name="jsf-nonjsp" sample-dir="nonjsp"/>
    </target>    

    <macrodef name="build-sample">
        <attribute name="sample-name"/>
        <attribute name="sample-dir"/>
        
        <sequential>
            <echo>
                
--------------- Building @{sample-name} ----------------
                
            </echo>
            <mkdir dir="@{sample-dir}/build/classes"/>
            <javac srcdir="@{sample-dir}/src"
                   destdir="@{sample-dir}/build/classes">
                <classpath>
                    <pathelement location="${jsf-api.jar}"/>
                    <pathelement location="${jsf-impl.jar}"/>
                    <pathelement location="${ui.jar}"/>
                    <pathelement path="${compile.classpath}"/>
                </classpath>
            </javac>
            <if>
                <isset property="${packaged.libs}"/>
                <then>
                    <echo message="Packing dependent libraries"/>
                    <for list="${jsf-impl.jar},${jsf-api.jar},${packaged.libs}"
                         param="jar">
                        <sequential>
                            <jar destfile="${basedir}/@{sample-name}.war"
                                 update="true">
                                <zipfileset file="@{jar}" prefix="WEB-INF/lib"/>
                            </jar>
                        </sequential>
                    </for>                                                                                                                                        
                </then>
            </if>  
            <delete dir="@{sample-dir}/build/classes"/>
        </sequential>
    </macrodef>
    
</project>


Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by