Source

main-silver / jellytools / build.xml

Full commit
<?xml version="1.0" encoding="UTF-8"?>
<!--
                Sun Public License Notice

The contents of this file are subject to the Sun Public License
Version 1.0 (the "License"). You may not use this file except in
compliance with the License. A copy of the License is available at
http://www.sun.com/
 
The Original Code is NetBeans. The Initial Developer of the Original
Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
Microsystems, Inc. All Rights Reserved.
-->
<project name="jellytools" default="jar-library" basedir=".">

    <import file="../nbbuild/templates/projectized.xml"/>
  
    <target name="all" depends="jar-library,zipsrc,javadoc,javadocWithJemmy" description="Create jars, source zip and javadoc zip"/>

    <target name="buildDependentModules">
        <ant dir="../xtest/nbjunit" target="jar-nbjunit" inheritAll="false"/>
        <!-- Write jemmy/idemodule.dir property to moduleCluster.properties. -->
        <ant dir="../jemmy/idemodule" target="init" inheritAll="false"/>
        <!-- Re-read moduleCluster.properties to initialize jemmy/idemodule.dir. -->
        <property file="${netbeans.dest.dir}/moduleCluster.properties"/>
        <!-- Need to build jemmy because jellytools has jemmy/dist/jemmy.jar in cp.extra. -->
        <ant dir="../jemmy" target="jar" inheritAll="false"/>
    </target>
    
    <target name="compile" depends="buildDependentModules,projectized-common.compile"/>

    <target name="timestamp" unless="buildnumber">
      <tstamp>
          <format property="buildnumber" pattern="yyyyMMddHHmm"/>
      </tstamp>
    </target>

    <!-- Create jelly2-nb.jar which hold jellytools library clases -->
    <target name="jar-library" depends="timestamp,compile" description="Create jelly2-nb.jar jar">
        <!-- Update manifest in version_info -->
        <manifest file="${build.classes.dir}/org/netbeans/jellytools/version_info" mode="update">
             <attribute name="Jellytools-Build" value="${buildnumber}"/>
        </manifest>
        <jar basedir="${build.classes.dir}" compress="false" jarfile="jelly2-nb.jar"
             manifest="${build.classes.dir}/org/netbeans/jellytools/version_info"
             excludesfile="../nbbuild/standard-jar-excludes.txt">
        </jar>
     </target>
     
    <target name="zipsrc" description="Create zip containing only sources">
        <zip zipfile="jelly2-nb-src.zip" basedir="src" 
             includes="org/netbeans/jellytools/**/*.java,org/netbeans/jellytools/version_info"
        />
    </target>
    
    <target name="jar" depends="init,compile,jar-prep">
        <property file="src/org/netbeans/jellytools/version_info"/>
        <jarwithmoduleattributes jarfile="${cluster}/${module.jar}" compress="${build.package.compress}" index="${build.package.index}" manifest="${manifest.mf}">
            <fileset dir="${build.classes.dir}" includes="**/modules/jellytools/*"/>
            <manifest>
                <attribute name="OpenIDE-Module-Specification-Version" value="${Jellytools-MajorVersion}.${Jellytools-MinorVersion}"/>
            </manifest>
        </jarwithmoduleattributes>
    </target>
    
    <target name="netbeans-extra" depends="jar-library,javadoc,zipsrc">
        <copy file="jelly2-nb.jar" todir="${cluster}/modules/ext"/>
        <copy file="${netbeans.javadoc.dir}/org-netbeans-modules-jellytools.zip" tofile="${cluster}/docs/jelly2-nb-javadoc.zip"/>
        <copy file="jelly2-nb-src.zip" tofile="${cluster}/sources/jelly2-nb-src.zip"/>
    </target>
    
    <target name="javadocWithJemmy" description="Javadoc for Jellytools and Jemmy">
        <mkdir dir="javadoc/jemmy-jelly2-nb-javadoc"/>
        <!-- Javadoc both for Jelly2 and Jemmy-->
        <javadoc destdir="javadoc/jemmy-jelly2-nb-javadoc" packagenames="org.netbeans.jellytools.*, org.netbeans.jemmy.*" Windowtitle="Jellytools and Jemmy API" Protected="yes">
            <sourcepath>
                <pathelement location="src"/>
                <pathelement location="../jemmy/src"/>
            </sourcepath>
            <classpath>
                <path refid="cp"/>
            </classpath>
        </javadoc>
        <zip zipfile="javadoc/jemmy-jelly2-nb-javadoc.zip" basedir="javadoc/jemmy-jelly2-nb-javadoc" includes="**"/>
    </target>
 
    <target  name="clean" depends="projectized-common.clean">
        <delete>
            <fileset dir=".">
                <include name="*.zip"/>
                <include name="*.jar"/>
            </fileset>
        </delete>
    </target>

</project>