<?xml version="1.0" encoding="UTF-8"?>
<project name="fxcop" default="all">
  
  
  <!-- Uncomment the following property if no tests compilation is needed -->
  <!-- 
  <property name="skip.tests" value="true"/>
   -->
  
  <!-- Compiler options -->
  
  <property name="compiler.debug" value="on"/>
  <property name="compiler.generate.no.warnings" value="off"/>
  <property name="compiler.args" value=""/>
  <property name="compiler.max.memory" value="128m"/>
  <patternset id="ignored.files">
    <exclude name="**/CVS/**"/>
    <exclude name="**/SCCS/**"/>
    <exclude name="**/RCS/**"/>
    <exclude name="**/rcs/**"/>
    <exclude name="**/.DS_Store/**"/>
    <exclude name="**/.svn/**"/>
    <exclude name="**/.sbas/**"/>
    <exclude name="**/.IJI.*/**"/>
    <exclude name="**/vssver.scc/**"/>
    <exclude name="**/vssver2.scc/**"/>
    <exclude name="**/.pyc/**"/>
    <exclude name="**/.pyo/**"/>
    <exclude name="**/*.pyc/**"/>
    <exclude name="**/*.pyo/**"/>
    <exclude name="**/.git/**"/>
    <exclude name="**/*.hprof/**"/>
    <exclude name="**/_svn/**"/>
  </patternset>
  <patternset id="library.patterns">
    <include name="*.zip"/>
    <include name="*.war"/>
    <include name="*.egg"/>
    <include name="*.ear"/>
    <include name="*.swc"/>
    <include name="*.jar"/>
  </patternset>
  <patternset id="compiler.resources">
    <include name="**/?*.properties"/>
    <include name="**/?*.xml"/>
    <include name="**/?*.gif"/>
    <include name="**/?*.png"/>
    <include name="**/?*.jpeg"/>
    <include name="**/?*.jpg"/>
    <include name="**/?*.html"/>
    <include name="**/?*.dtd"/>
    <include name="**/?*.tld"/>
    <include name="**/?*.jsp"/>
    <include name="**/?*.gif"/>
    <include name="**/?*.png"/>
  </patternset>
  
  
  <!-- Project Libraries -->
  
  <path id="library.api-agent.classpath">
    <pathelement location="${path.variable.teamcitydistribution}/devPackage/agent-api.jar"/>
  </path>
  
  <path id="library.api-common.classpath">
    <pathelement location="${path.variable.teamcitydistribution}/devPackage/common-api.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/devPackage/runtime-util.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/annotations.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/junit-3.8.2.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/log4j-1.2.12.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/openapi.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/util.jar"/>
  </path>
  
  <path id="library.api-server.classpath">
    <pathelement location="${path.variable.teamcitydistribution}/devPackage/server-api.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/lib/servlet-api.jar"/>
  </path>
  
  <path id="library.jni.classpath">
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/jniwrap-3.6.1.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/winpack.jar"/>
  </path>
  
  <path id="library.test-sup.classpath">
    <pathelement location="${basedir}/lib/testng-jdk15.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/jmock-SNAPSHOT.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/junit-3.8.2.jar"/>
  </path>
  
  <path id="library.xml.classpath">
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/xercesImpl.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/xmlrpc-2.0.1.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/xpp3_min-1.1.3.4.M.jar"/>
    <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/xstream-1.2.1.jar"/>
  </path>
  
  
  <!-- Application Server Libraries -->
  
  <!-- Modules -->
  
  
  <!-- Module fxcop-common -->
  
  <dirname property="module.fxcop-common.basedir" file="${ant.file}"/>
  
  
  
  <property name="compiler.args.fxcop-common" value="${compiler.args}"/>
  
  <property name="fxcop-common.output.dir" value="${module.fxcop-common.basedir}/out/production/fxcop-common"/>
  <property name="fxcop-common.testoutput.dir" value="${module.fxcop-common.basedir}/out/test/fxcop-common"/>
  
  <path id="fxcop-common.module.bootclasspath">
    <!-- Paths to be included in compilation bootclasspath -->
  </path>
  
  <path id="fxcop-common.module.classpath">
    <path refid="library.api-common.classpath"/>
  </path>
  
  <path id="fxcop-common.runtime.module.classpath">
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.api-common.classpath"/>
  </path>
  
  
  <patternset id="excluded.from.module.fxcop-common">
    <patternset refid="ignored.files"/>
  </patternset>
  
  <patternset id="excluded.from.compilation.fxcop-common">
    <patternset refid="excluded.from.module.fxcop-common"/>
  </patternset>
  
  <path id="fxcop-common.module.sourcepath">
    <dirset dir="${module.fxcop-common.basedir}/fxcop-common">
      <include name="src"/>
    </dirset>
  </path>
  
  
  <target name="compile.module.fxcop-common" depends="compile.module.fxcop-common.production,compile.module.fxcop-common.tests" description="Compile module fxcop-common"/>
  
  <target name="compile.module.fxcop-common.production" description="Compile module fxcop-common; production classes">
    <mkdir dir="${fxcop-common.output.dir}"/>
    <javac destdir="${fxcop-common.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
      <compilerarg line="${compiler.args.fxcop-common}"/>
      <bootclasspath refid="fxcop-common.module.bootclasspath"/>
      <classpath refid="fxcop-common.module.classpath"/>
      <src refid="fxcop-common.module.sourcepath"/>
      <patternset refid="excluded.from.compilation.fxcop-common"/>
    </javac>
    
    <copy todir="${fxcop-common.output.dir}">
      <fileset dir="${module.fxcop-common.basedir}/fxcop-common/src">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.module.fxcop-common.tests" depends="compile.module.fxcop-common.production" description="compile module fxcop-common; test classes" unless="skip.tests"/>
  
  <target name="clean.module.fxcop-common" description="cleanup module">
    <delete dir="${fxcop-common.output.dir}"/>
    <delete dir="${fxcop-common.testoutput.dir}"/>
  </target>
  
  
  <!-- Module fxcop-agent -->
  
  <dirname property="module.fxcop-agent.basedir" file="${ant.file}"/>
  
  
  
  <property name="compiler.args.fxcop-agent" value="${compiler.args}"/>
  
  <property name="fxcop-agent.output.dir" value="${module.fxcop-agent.basedir}/out/production/fxcop-agent"/>
  <property name="fxcop-agent.testoutput.dir" value="${module.fxcop-agent.basedir}/out/test/fxcop-agent"/>
  
  <path id="fxcop-agent.module.bootclasspath">
    <!-- Paths to be included in compilation bootclasspath -->
  </path>
  
  <path id="fxcop-agent.module.classpath">
    <path refid="library.api-common.classpath"/>
    <path refid="library.api-agent.classpath"/>
    <path refid="library.xml.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.jni.classpath"/>
  </path>
  
  <path id="fxcop-agent.runtime.module.classpath">
    <pathelement location="${fxcop-agent.output.dir}"/>
    <pathelement location="${fxcop-agent.testoutput.dir}"/>
    <path refid="library.api-common.classpath"/>
    <path refid="library.api-agent.classpath"/>
    <path refid="library.xml.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.jni.classpath"/>
  </path>
  
  
  <patternset id="excluded.from.module.fxcop-agent">
    <patternset refid="ignored.files"/>
  </patternset>
  
  <patternset id="excluded.from.compilation.fxcop-agent">
    <patternset refid="excluded.from.module.fxcop-agent"/>
  </patternset>
  
  <path id="fxcop-agent.module.sourcepath">
    <dirset dir="${module.fxcop-agent.basedir}/fxcop-agent">
      <include name="src"/>
    </dirset>
  </path>
  
  
  <target name="compile.module.fxcop-agent" depends="compile.module.fxcop-agent.production,compile.module.fxcop-agent.tests" description="Compile module fxcop-agent"/>
  
  <target name="compile.module.fxcop-agent.production" depends="compile.module.fxcop-common" description="Compile module fxcop-agent; production classes">
    <mkdir dir="${fxcop-agent.output.dir}"/>
    <javac destdir="${fxcop-agent.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
      <compilerarg line="${compiler.args.fxcop-agent}"/>
      <bootclasspath refid="fxcop-agent.module.bootclasspath"/>
      <classpath refid="fxcop-agent.module.classpath"/>
      <src refid="fxcop-agent.module.sourcepath"/>
      <patternset refid="excluded.from.compilation.fxcop-agent"/>
    </javac>
    
    <copy todir="${fxcop-agent.output.dir}">
      <fileset dir="${module.fxcop-agent.basedir}/fxcop-agent/src">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.module.fxcop-agent.tests" depends="compile.module.fxcop-agent.production" description="compile module fxcop-agent; test classes" unless="skip.tests"/>
  
  <target name="clean.module.fxcop-agent" description="cleanup module">
    <delete dir="${fxcop-agent.output.dir}"/>
    <delete dir="${fxcop-agent.testoutput.dir}"/>
  </target>
  
  
  <!-- Module fxcop-server -->
  
  <dirname property="module.fxcop-server.basedir" file="${ant.file}"/>
  
  
  
  <property name="compiler.args.fxcop-server" value="${compiler.args}"/>
  
  <property name="fxcop-server.output.dir" value="${module.fxcop-server.basedir}/out/production/fxcop-server"/>
  <property name="fxcop-server.testoutput.dir" value="${module.fxcop-server.basedir}/out/test/fxcop-server"/>
  
  <path id="fxcop-server.module.bootclasspath">
    <!-- Paths to be included in compilation bootclasspath -->
  </path>
  
  <path id="fxcop-server.module.classpath">
    <path refid="library.api-server.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.api-common.classpath"/>
  </path>
  
  <path id="fxcop-server.runtime.module.classpath">
    <pathelement location="${fxcop-server.output.dir}"/>
    <pathelement location="${fxcop-server.testoutput.dir}"/>
    <path refid="library.api-server.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.api-common.classpath"/>
  </path>
  
  
  <patternset id="excluded.from.module.fxcop-server">
    <patternset refid="ignored.files"/>
  </patternset>
  
  <patternset id="excluded.from.compilation.fxcop-server">
    <patternset refid="excluded.from.module.fxcop-server"/>
  </patternset>
  
  <path id="fxcop-server.module.sourcepath">
    <dirset dir="${module.fxcop-server.basedir}/fxcop-server">
      <include name="src"/>
      <include name="resources"/>
    </dirset>
  </path>
  
  
  <target name="compile.module.fxcop-server" depends="compile.module.fxcop-server.production,compile.module.fxcop-server.tests" description="Compile module fxcop-server"/>
  
  <target name="compile.module.fxcop-server.production" depends="compile.module.fxcop-common" description="Compile module fxcop-server; production classes">
    <mkdir dir="${fxcop-server.output.dir}"/>
    <javac destdir="${fxcop-server.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
      <compilerarg line="${compiler.args.fxcop-server}"/>
      <bootclasspath refid="fxcop-server.module.bootclasspath"/>
      <classpath refid="fxcop-server.module.classpath"/>
      <src refid="fxcop-server.module.sourcepath"/>
      <patternset refid="excluded.from.compilation.fxcop-server"/>
    </javac>
    
    <copy todir="${fxcop-server.output.dir}">
      <fileset dir="${module.fxcop-server.basedir}/fxcop-server/src">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
      <fileset dir="${module.fxcop-server.basedir}/fxcop-server/resources">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.module.fxcop-server.tests" depends="compile.module.fxcop-server.production" description="compile module fxcop-server; test classes" unless="skip.tests"/>
  
  <target name="clean.module.fxcop-server" description="cleanup module">
    <delete dir="${fxcop-server.output.dir}"/>
    <delete dir="${fxcop-server.testoutput.dir}"/>
  </target>
  
  
  <!-- Module fxcop-tests -->
  
  <dirname property="module.fxcop-tests.basedir" file="${ant.file}"/>
  
  
  
  <property name="compiler.args.fxcop-tests" value="${compiler.args}"/>
  
  <property name="fxcop-tests.output.dir" value="${module.fxcop-tests.basedir}/out/production/fxcop-tests"/>
  <property name="fxcop-tests.testoutput.dir" value="${module.fxcop-tests.basedir}/out/test/fxcop-tests"/>
  
  <path id="fxcop-tests.module.bootclasspath">
    <!-- Paths to be included in compilation bootclasspath -->
  </path>
  
  <path id="fxcop-tests.module.classpath">
    <path refid="library.api-common.classpath"/>
    <path refid="library.api-agent.classpath"/>
    <pathelement location="${fxcop-agent.output.dir}"/>
    <pathelement location="${fxcop-agent.testoutput.dir}"/>
    <path refid="library.test-sup.classpath"/>
    <path refid="library.xml.classpath"/>
    <path refid="library.api-server.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
  </path>
  
  <path id="fxcop-tests.runtime.module.classpath">
    <pathelement location="${fxcop-tests.output.dir}"/>
    <pathelement location="${fxcop-tests.testoutput.dir}"/>
    <path refid="library.api-common.classpath"/>
    <path refid="library.api-agent.classpath"/>
    <pathelement location="${fxcop-agent.output.dir}"/>
    <pathelement location="${fxcop-agent.testoutput.dir}"/>
    <path refid="library.xml.classpath"/>
    <pathelement location="${fxcop-common.output.dir}"/>
    <pathelement location="${fxcop-common.testoutput.dir}"/>
    <path refid="library.jni.classpath"/>
    <path refid="library.test-sup.classpath"/>
    <path refid="library.api-server.classpath"/>
  </path>
  
  
  <patternset id="excluded.from.module.fxcop-tests">
    <patternset refid="ignored.files"/>
  </patternset>
  
  <patternset id="excluded.from.compilation.fxcop-tests">
    <patternset refid="excluded.from.module.fxcop-tests"/>
  </patternset>
  
  <path id="fxcop-tests.module.sourcepath">
    <dirset dir="${module.fxcop-tests.basedir}/fxcop-tests">
      <include name="src"/>
    </dirset>
  </path>
  
  
  <target name="compile.module.fxcop-tests" depends="compile.module.fxcop-tests.production,compile.module.fxcop-tests.tests" description="Compile module fxcop-tests"/>
  
  <target name="compile.module.fxcop-tests.production" depends="compile.module.fxcop-agent,compile.module.fxcop-common" description="Compile module fxcop-tests; production classes">
    <mkdir dir="${fxcop-tests.output.dir}"/>
    <javac destdir="${fxcop-tests.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
      <compilerarg line="${compiler.args.fxcop-tests}"/>
      <bootclasspath refid="fxcop-tests.module.bootclasspath"/>
      <classpath refid="fxcop-tests.module.classpath"/>
      <src refid="fxcop-tests.module.sourcepath"/>
      <patternset refid="excluded.from.compilation.fxcop-tests"/>
    </javac>
    
    <copy todir="${fxcop-tests.output.dir}">
      <fileset dir="${module.fxcop-tests.basedir}/fxcop-tests/src">
        <patternset refid="compiler.resources"/>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.module.fxcop-tests.tests" depends="compile.module.fxcop-tests.production" description="compile module fxcop-tests; test classes" unless="skip.tests"/>
  
  <target name="clean.module.fxcop-tests" description="cleanup module">
    <delete dir="${fxcop-tests.output.dir}"/>
    <delete dir="${fxcop-tests.testoutput.dir}"/>
  </target>
  
  <target name="init" description="Build initialization">
    <!-- Perform any build initialization in this target -->
  </target>
  
  <target name="clean" depends="clean.module.fxcop-common, clean.module.fxcop-agent, clean.module.fxcop-server, clean.module.fxcop-tests" description="cleanup all"/>
  
  <target name="all" depends="init, clean, compile.module.fxcop-common, compile.module.fxcop-agent, compile.module.fxcop-server, compile.module.fxcop-tests" description="build all"/>
</project>