Code Search for Developers
 
 
  

build.xml from Tea Stats at Krugle


Show build.xml syntax highlighted

<project name="teastats-build" default="jar">

    <property name="version" value="developer-build"/>

    <property name="application" value="teastats"/>

    <property name="src.project.dir" location="src/java"/>
    <property name="src.test.dir" location="src/test-unit"/>
    <property name="src.integration-test.dir" location="src/test-integration"/>
    <property name="resources.dir" location="src/resources"/>
    <property name="test.files.dir" location="src/test-files"/>
    <property name="scripts.dir" location="scripts"/>

    <property name="build.dir" location="build"/>
    <property name="build.classes.dir" location="${build.dir}/classes"/>
    <property name="build.test.classes.dir" location="${build.dir}/test-classes"/>

    <property name="build.integrationtest.classes.dir" location="${build.dir}/integration-test-classes"/>

    <property name="build.test.output.dir" location="${build.dir}/test/output"/>
    <property name="build.test.report.dir" location="${build.dir}/test/reports"/>
    <property name="build.test.report.html.dir" location="${build.dir}/test/reports/html"/>

    <property name="build.resources.dir" location="${resources.dir}/build"/>

    <property name="findbugs.home" location="tools/findbugs-0.9.5"/>

    <fileset id="deploy-jars" dir="lib">
        <include name="**/*.jar"/>
    </fileset>

    <path id="build-classpath">
        <fileset refid="deploy-jars"/>
    </path>

    <path id="test-resources-classpath">
        <pathelement location="${resources.dir}"/>
        <pathelement location="${test.files.dir}"/>
    </path>

    <path id="test-classpath">
        <path refid="build-classpath"/>
        <pathelement location="${build.classes.dir}"/>
        <pathelement location="${build.test.classes.dir}"/>
        <path refid="test-resources-classpath"/>
        <pathelement location="src/templates"/>
    </path>

    <path id="integration-test-classpath">
        <path refid="test-classpath"/>
        <pathelement location="${build.integrationtest.classes.dir}"/>
    </path>

    <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

    <target name="clean">
        <delete dir="build"/>
    </target>

    <target name="init">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.classes.dir}"/>
        <mkdir dir="${build.test.classes.dir}"/>
        <mkdir dir="${build.integrationtest.classes.dir}"/>
        <mkdir dir="${build.test.output.dir}"/>
        <mkdir dir="${build.test.report.dir}"/>
    </target>

    <target name="compile" depends="clean, compile-integration-tests"/>

    <target name="compile-main" depends="init">
        <javac destdir="${build.classes.dir}"
               classpathref="build-classpath"
               source="1.5" debug="on" fork="true"
               memoryMaximumSize="1024m">
            <src path="${src.project.dir}"/>
            <include name="**/*.java"/>
        </javac>

        <copy todir="${build.classes.dir}">
            <fileset dir="${src.project.dir}">
                <include name="**/*.xml"/>
                <include name="**/*.ftl"/>
                <include name="**/*.properties"/>
                <include name="**/*.txt"/>
            </fileset>
        </copy>
    </target>

    <target name="compile-tests" depends="compile-main,init">
        <javac destdir="${build.test.classes.dir}"
               classpathref="test-classpath"
               source="1.5" debug="on" fork="true"
               memoryMaximumSize="1024m">
            <src path="${src.test.dir}"/>
            <include name="**/*.java"/>
        </javac>

        <copy todir="${build.test.classes.dir}">
            <fileset dir="${src.test.dir}">
                <include name="**/*.xml"/>
                <include name="**/*.ftl"/>
                <include name="**/*.properties"/>
                <include name="**/*.txt"/>
            </fileset>
        </copy>
    </target>

    <target name="compile-integration-tests" depends="compile-tests,init">
        <javac destdir="${build.integrationtest.classes.dir}"
               classpathref="integration-test-classpath"
               source="1.5" debug="on" fork="true"
               memoryMaximumSize="1024m">
            <src path="${src.integration-test.dir}"/>
            <include name="**/*.java"/>
        </javac>

        <copy todir="${build.test.classes.dir}">
            <fileset dir="${src.test.dir}">
                <include name="**/*.xml"/>
                <include name="**/*.ftl"/>
                <include name="**/*.properties"/>
                <include name="**/*.txt"/>
            </fileset>
        </copy>
    </target>

    <target name="junitreport">
        <junitreport todir="${build.test.report.dir}">
            <fileset dir="${build.test.output.dir}">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${build.test.report.html.dir}"/>
        </junitreport>
        <echo>JUnit report created at ${build.test.report.html.dir}/index.html</echo>
    </target>

    <target name="test" depends="unit-test, integration-test" description="Run all tests"/>

    <target name="unit-test" depends="compile" description="Compile code and run all unit testcases">
        <junit printsummary="yes" failureproperty="test.failure">
            <classpath refid="test-classpath"/>
            <formatter type="xml"/>
            <batchtest fork="true" todir="${build.test.output.dir}">
                <fileset dir="${src.test.dir}">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>

        <antcall target="junitreport"/>

        <fail if="test.failure" message="There were unit test failures. Can't continue"/>
    </target>

    <target name="integration-test" depends="unit-test" description="Compile code and run all integration testcases">
        <junit printsummary="yes" failureproperty="test.failure">
            <classpath refid="integration-test-classpath"/>
            <formatter type="xml"/>
            <batchtest fork="yes" todir="${build.test.output.dir}">
                <fileset dir="${src.integration-test.dir}">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>

        <antcall target="junitreport"/>

        <fail if="test.failure" message="There were unit test failures. Can't continue"/>
    </target>

    <target name="jar" depends="integration-test">
        <jar jarfile="${build.dir}/${application}.jar">
            <manifest>
                <attribute name="Teastats-Version" value="${version}"/>
                <attribute name="Main-Class" value="net.time4tea.webstats.main.Teastats"/>
            </manifest>

            <fileset dir="${build.classes.dir}">
                <include name="**/*"/>
            </fileset>
        </jar>
    </target>


    <target name="findbugs" depends="compile">
        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
            <classpath refid="test-classpath"/>
        </taskdef>

        <findbugs home="${findbugs.home}" workHard="true" output="xml"
                  outputFile="${build.test.report.dir}/findbugs.xml" jvmargs="-mx512m">
            <sourcePath path="${src.project.dir}"/>
            <class location="${build.classes.dir}"/>
        </findbugs>

        <delete file="${build.test.report.dir}/findbugs.html"/>
        <xslt in="${build.test.report.dir}/findbugs.xml" out="${build.test.report.dir}/findbugs.html"
              style="${findbugs.home}/src/xsl/plain.xsl"/>
    </target>

    <property name="pmd.home" location="tools/pmd-3.6"/>

    <path id="pmd-classpath">
        <fileset dir="${pmd.home}/lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <target name="pmd">
        <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
            <classpath refid="pmd-classpath"/>
        </taskdef>
        <pmd>
            <ruleset>basic</ruleset>
            <ruleset>braces</ruleset>
            <ruleset>codesize</ruleset>
            <ruleset>junit</ruleset>
            <formatter type="xml" toFile="${build.test.report.dir}/pmd.xml" toConsole="true"/>
            <fileset dir="${src.project.dir}">
                <include name="**/*.java"/>
            </fileset>
        </pmd>

        <delete file="${build.test.report.dir}/pmd.html"/>
        <xslt in="${build.test.report.dir}/pmd.xml" out="${build.test.report.dir}/pmd.html"
              style="${pmd.home}/etc/xslt/wz-pmd-report.xslt"/>
    </target>

    <target name="cpd">
        <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
            <classpath refid="pmd-classpath"/>
        </taskdef>
        <cpd minimumTokenCount="50" outputFile="${build.test.report.dir}/cpd.txt" ignoreLiterals="true">
            <fileset dir="${src.project.dir}">
                <include name="**/*.java"/>
            </fileset>
            <fileset dir="${src.test.dir}">
                <include name="**/*.java"/>
            </fileset>
        </cpd>
    </target>

    <target name="get-maxmind-geoip" description="Run this to download the MaxMind Files">
        <get src="http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"
             dest="src/resources/GeoLiteCity.dat.gz" usetimestamp="true"/>
        <gunzip src="src/resources/GeoLiteCity.dat.gz"/>

        <get src="http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz" dest="src/resources/GeoIP.dat.gz"
             usetimestamp="true"/>
        <gunzip src="src/resources/GeoIP.dat.gz"/>
    </target>
</project>



See more files for this project here

Tea Stats

Web log analyzer... Written in OO Perl, provides the usual host / page analysis. Can also do site graphing using graphviz, browser, os, worm and search engine identification, and country and session tracking.

Project homepage: http://sourceforge.net/projects/teastats
Programming language(s): Java
License: other

  lib/
    activemq/
      activeio-core-3.0-beta3.jar
      activemq-console-4.0.1.jar
      activemq-core-4.0.1.jar
      backport-util-concurrent-2.1.jar
      commons-logging-1.0.4.jar
      geronimo-j2ee-management_1.0_spec-1.0.jar
      geronimo-jms_1.1_spec-1.0.jar
      mx4j-2.1.1.jar
    commons-beanutils-1.7.0/
      commons-beanutils-bean-collections.jar
      commons-beanutils-core.jar
      commons-beanutils.jar
    commons-dbcp/
      commons-dbcp-1.2.1.jar
      commons-pool-1.3.jar
    commons-lang/
      commons-lang-2.0.jar
    commons-logging-1.0.4/
      commons-logging-api.jar
      commons-logging.jar
    dnsjava/
      dnsjava-2.0.1.jar
    freemarker/
      freemarker.jar
    hamcrest/
      hamcrest-all-1.1.jar
    hibernate/
    jdom/
      jdom.jar
    jfree/
      jcommon-1.0.0.jar
      jfreechart-1.0.1.jar
      jfreechart-1.0.1.tar.gz
    joda/
      joda-time-1.4.jar
    junit/
      jmock-1.1.0RC1.jar
      jmock-cglib-1.0.1.jar
      jmock-cglib-1.1.0RC1.jar
      junit-3.8.1.jar
    log4j/
      log4j-1.2.11.jar
    mysql/
    oscache/
      oscache-2.1.jar
    spring/
    velocity/
      velocity-1.4.jar
      velocity-dep-1.4.jar
      velocity-tools-generic-1.2.jar
    xerces/
      xercesImpl.jar
      xml-apis.jar
    xom/
      xom-1.1.jar
    xstream/
      xpp3_min-1.1.3.4.O.jar
      xstream-1.2.2.jar
  src/
    java/
      com/
        maxmind/
          geoip/
            Country.java
            DatabaseInfo.java
            Location.java
            LookupService.java
            Region.java
      net/
        time4tea/
          webstats/
            analyser/
            dao/
            enhancer/
            filter/
            freemarker/
            geoip/
            graph/
            identify/
            jms/
            main/
            parser/
            pipeline/
            process/
            record/
            report/
            session/
            site/
            source/
            spring/
            statistic/
            uri/
            util/
      teastats/
    resources/
      log4j.properties
    shell/
    templates/
      new/
      bg_header.jpg
      frontpage.ftl
      index.ftl
      index.html
      macros.ftl
      singlesource.ftl
      teastats.css
    test-files/
    test-integration/
      net/
    test-unit/
      net/
    website/
      index.html
      style.css
  COMPILE.txt
  README.txt
  build.xml
  teastats.iml
  teastats.ipr