Code Search for Developers
 
 
  

builder.xml from GridBlocks at Krugle


Show builder.xml syntax highlighted

<!-- ================================================================== -->
<!-- Generic ANT builder file for GridBlocks projects.                  -->
<!-- ================================================================== -->

<project basedir="..">

<!-- ================================================================== -->
<!-- Initialization                                                     -->
<!-- ================================================================== -->

<!-- Initialize the build system. -->
<target name="builder:init" unless="builder:initialised">
    <!-- Detect JDK version -->
    <available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
    <available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
    <fail unless="HAVE_JDK_1.5">
        Unsupported Java version: You need at least JDK1.5
    </fail>

    <property environment="env"/>
    <tstamp/>
    
    <!-- Set a hostname property based on COMPUTERNAME for win32, HOSTNAME
        otherwise and initialize the node0/node1 cluster hostnames to localhost
        and ${hostname} by default. If you cannot route multicast traffic between
        localhost and hostname, then you need to specify node0 and node1 binding
        in the local.properties that can in order to be able to run the clustering
        tests.
        -->
    <condition property="hostname" value="${env.COMPUTERNAME}">
      <os family="windows"/>
    </condition>
    <condition property="hostname" value="${env.HOSTNAME}">
      <not>
        <os family="windows"/>
      </not>
    </condition>

    <!-- Setup the general build environment. -->
    <property name="builder.dir" value="${basedir}/builder"/>
    <property name="builder.buildlib" value="${builder.dir}/buildlib"/>
    
    <!-- Include module dependent overrides. -->
    <property file="${module.dir}/module.properties"/>

    <!-- Setup the module environment. -->
    <property name="module.lib" value="${module.dir}/lib"/>
    <property name="module.buildlib" value="${module.dir}/buildlib"/>
    <property name="module.source" value="${module.dir}/src"/>
    <property name="module.output" value="${module.dir}/output"/>

    <!-- Where source files are loaded. -->
    <property name="source.bin" value="${module.source}/bin"/>
    <property name="source.docs" value="${module.source}/docs"/>
    <property name="source.etc" value="${module.source}/etc"/>
    <property name="source.java" value="${module.source}/main"/>
    <property name="source.resources" value="${module.source}/resources"/>
    <property name="source.test" value="${module.source}/test"/>
    <property name="source.web" value="${module.source}/web"/>

    <!-- Where generated release files will go. -->
    <property name="build.classes" value="${module.output}/classes"/>
    <property name="build.etc" value="${module.output}/etc"/>
    <property name="build.lib" value="${module.output}/lib"/>
    <property name="build.docs" value="${module.output}/docs"/>
    <property name="build.javadoc" value="${build.docs}/javadoc"/>
    <property name="build.resources" value="${module.output}/resources"/>
    <property name="build.reports" value="${module.output}/tests"/>

    <!-- Temporary output files. Files/directories with prefix "tmp-" are not included 
        in release packages. -->
    <property name="build.test" value="${module.output}/tmp-test"/>
    <property name="build.appdoc" value="${module.output}/tmp-appdoc"/>

    <!-- Include generic properties. -->
    <property file="${builder.dir}/build.properties"/>
    <property file="${builder.dir}/local.properties"/>
        
    <!-- The classpath of build environment -->
    <path id="builder.classpath">
        <fileset dir="${builder.buildlib}">
            <include name="**/*.jar"/>
        </fileset>
    </path>
    <!-- Add local configurations now -->
    <taskdef file="${builder.dir}/autoload.properties"
        classpathref="builder.classpath"/>
    <call target="configure"/>

    <!-- Release names and directories. -->
    <property name="release.prefix" value="${module.name}"/>
    <property name="release.dir" value="${module.output}"/>
    <property name="release.id" value="${module.name}-${module.version}"/>
    <property name="release.file" value="${release.id}.jar"/>

    <!-- The classpath required to build classes -->
    <path id="javac.classpath">
        <path refid="builder.classpath"/>
        <!-- Module dependent libraries -->
        <path refid="library.classpath"/>
    </path>

    <!-- The bootstrap classpath used to override jdk classes -->
    <path id="javac.bootclasspath">
        <!-- Optional module override boot classpath -->
        <pathelement path="${bootclasspath.local}"/>
        <!-- The sun jdk boot classpath property -->
        <pathelement path="${sun.boot.class.path}"/>
    </path>

    <!-- The classpath required to build javadocs -->
    <path id="javadoc.classpath">
        <path refid="javac.classpath"/>
    </path>

    <!-- The classpath required for testing -->
    <path id="test.classpath">
        <path refid="builder.classpath"/>
        <pathelement path="${build.classes}"/>
        <pathelement path="${build.test}"/>
        <path refid="javac.classpath"/>
    </path>

    <!-- Finish up -->
    <property name="builder:initialised" value="true"/>
</target>

<target name="builder:require_tomcat" depends="builder:init" unless="tomcat.home">
    <echo message="**************************************************"/>
    <echo message="Warning: Declare the TOMCAT_HOME variable"/>
    <echo message="         TOMCAT_HOME  ---> (Tomcat installation directory)"/>
    <echo message="**************************************************"/>
    <fail/>
</target>

<target name="builder:require_jboss" depends="builder:init" unless="jboss.home">
    <echo message="**************************************************"/>
    <echo message="Warning: Declare the JBOSS_HOME variable"/>
    <echo message="         JBOSS_HOME  ---> (JBoss installation directory)"/>
    <echo message="**************************************************"/>
    <fail/>
</target>

<!-- ================================================================= -->
<!-- Help-->
<!-- ================================================================= -->

<target name="builder:help" depends="builder:init">
    <echo><![CDATA[
The ${module.name} build file:

      -projecthelp for all targets
      -help for Ant options
]]></echo>
</target>

<!-- ================================================================= -->
<!-- Compilation-->
<!-- ================================================================= -->

<!-- Compile all class files. -->
<target name="builder:compile-classes" depends="builder:init">
    <mkdir dir="${build.classes}"/>
    <javac
            destdir="${build.classes}"
            srcdir="${source.java}"
            excludes=""
            debug="${javac.debug}"
            depend="${javac.depend}"
            deprecation="${javac.deprecation}"
            optimize="${javac.optimize}"
            verbose="${javac.verbose}"
            failonerror="${javac.fail.onerror}">
        <bootclasspath refid="javac.bootclasspath"/>
        <classpath refid="javac.classpath"/>
    </javac>
</target>

<!-- Compile resource files. -->
<target name="builder:compile-resources" depends="builder:init">
    <mkdir dir="${build.resources}"/>
    <copy todir="${build.resources}" filtering="no">
      <fileset dir="${source.resources}">
        <include name="**"/>
      </fileset>
    </copy>
  </target>

<!-- Compile etc files (manifests and such) -->
<target name="builder:compile-etc" depends="builder:init">
    <mkdir dir="${build.etc}"/>
    <copy todir="${build.etc}" filtering="yes" overwrite="yes">
        <fileset dir="${source.etc}">
            <include name="**/*"/>
        </fileset>
    </copy>
</target>

<!-- ================================================================= -->
<!-- Documenting-->
<!-- ================================================================= -->

<!-- Build Java documentation -->
<target name="builder:docs-api" depends="builder:init">
    <mkdir dir="${build.javadoc}"/>
    <javadoc
            destdir="${build.javadoc}"
            classpathref="javadoc.classpath"
            sourcepath="${source.java}"
            packagenames="${javadoc.packages}"
            windowtitle="${module.name} Java documentation">
        <bootclasspath refid="javac.bootclasspath"/>
        <classpath refid="javadoc.classpath"/>
    </javadoc>
</target>

<!-- Build Application documents -->
<target name="builder:docs-app" depends="builder:init">
    <mkdir dir="${build.docs}"/>
    <copy todir="${build.docs}" filtering="on">
        <fileset dir="${source.resources}" includes="**/*.jpg,**/*.png,**/*.gif"/>
    </copy>
    <java classname="org.apache.cocoon.Main" fork="yes">
        <classpath refid="javac.classpath" />
        <arg value="-c${source.docs}"/>
        <arg value="-d${build.docs}/"/>
        <arg value="-w${build.appdoc}"/>
        <arg value="-l${build.appdoc}/cocoon.log"/>
        <arg value="-uWARN"/>
        <arg value="-f${source.docs}/docs.uris"/>
    </java>
</target>

<!-- ================================================================== -->
<!-- Release                                                            -->
<!-- ================================================================== -->

<!-- Build binary release -->
<target name="builder:release:zip" depends="builder:init">
    <zip zipfile="${module.output}/${release.id}.zip">
        <fileset dir="${module.output}">
            <exclude name="${module.name}*/**"/>
            <exclude name="tmp-*/**"/>
        </fileset>
    </zip>
</target>

<target name="builder:release:jar" depends="builder:init">
    <jar jarfile="${module.output}/${release.id}.jar">
        <zipfileset dir="${module.output}" prefix="${release.prefix}">
            <exclude name="${module.name}*/**"/>
            <exclude name="tmp-*/**"/>
        </zipfileset>
    </jar>
</target>

<!-- ================================================================= -->
<!-- Testing -->
<!-- ================================================================= -->

<!-- Compile test code -->
<target name="builder:compiletests" depends="builder:init,builder:compile-classes">
    <mkdir dir="${build.test}"/>
    <javac srcdir="${source.test}" destdir="${build.test}">
        <classpath refid="test.classpath"/>
        <include name="**/*.java"/>
    </javac>
</target>

<!-- Perform unit tests -->
<target name="builder:test" depends="builder:init,builder:compiletests">
    <taskdef name="junit"
            classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
        <classpath refid="test.classpath"/>
    </taskdef>
  
    <delete dir="${build.reports}"/>
    <mkdir dir="${build.reports}"/>
    <junit fork="yes" haltonfailure="yes">
        <sysproperty key="GB_HOME" value="${module.dir}"/>
        <test name="fi.hip.gb.test.AllJUnitTests" todir="${build.reports}"/>
        <formatter type="plain" usefile="false"/>
        <formatter type="xml"/>
        <classpath refid="test.classpath"/>
    </junit>
</target>

<!-- ================================================================= -->
<!-- Cleaning -->
<!-- ================================================================= -->

<!-- Clean up everything -->
<target name="builder:clean">
    <delete dir="${module.output}"/>
</target>

</project>



See more files for this project here

GridBlocks

GridBlocks builds a grid application framework via easy-to-use building blocks in distributed environment. The framework offers components for Grid security, distributed storage, computing, and Portlet web interfaces.

Project homepage: http://sourceforge.net/projects/gridblocks
Programming language(s): Java,JSP,XML
License: other

  buildlib/
    ant-junit.jar
    ant-launcher.jar
    ant.jar
    buildmagic-tasks.jar
    cruisecontrol.jar
    junit-4.1.jar
  legal/
    LICENSE
    LICENSE.axis
    LICENSE.chello
    LICENSE.cocoon
    LICENSE.cruisecontrol
    LICENSE.cryptix
    LICENSE.edg
    LICENSE.ermapper
    LICENSE.globus
    LICENSE.httpunit
    LICENSE.jaf
    LICENSE.javamail
    LICENSE.maybeupload
    LICENSE.resolver
  .project
  CHANGES
  README
  autoload.properties
  build.properties
  builder.xml
  local.properties
  modules.xml