Source

oscache / build.xml

chri...@81dbac14… 656323a 




chri...@81dbac14… 397aca8 
chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 

chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 


chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 


chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 



chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 



chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 


chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 
chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 

chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 

chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 
chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 


chri...@81dbac14… 656323a 

chri...@81dbac14… 397aca8 






chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 






chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 




chri...@81dbac14… 656323a 
chri...@81dbac14… 397aca8 

chri...@81dbac14… 656323a 

chri...@81dbac14… 397aca8 


































chri...@81dbac14… 77c22ea 
ha...@81dbac14-3… 36d1663 
chri...@81dbac14… 397aca8 








chri...@81dbac14… 77c22ea 
chri...@81dbac14… 397aca8 
























dr...@81dbac14-3… e2d3c1e 
chri...@81dbac14… 397aca8 






















dr...@81dbac14-3… e2d3c1e 
chri...@81dbac14… 397aca8 





























dr...@81dbac14-3… e2d3c1e 
chri...@81dbac14… 397aca8 

























dr...@81dbac14-3… ac2d85f 










chri...@81dbac14… 397aca8 
















dr...@81dbac14-3… c0dcdef 






chri...@81dbac14… 397aca8 










ha...@81dbac14-3… 36d1663 

chri...@81dbac14… f6881c1 
chri...@81dbac14… d445cac 
ha...@81dbac14-3… 36d1663 
chri...@81dbac14… 397aca8 
























chri...@81dbac14… 77c22ea 
chri...@81dbac14… 397aca8 



chri...@81dbac14… 77c22ea 
chri...@81dbac14… 397aca8 











chri...@81dbac14… 77c22ea 
chri...@81dbac14… 397aca8 























chri...@81dbac14… 656323a 

<?xml version="1.0" ?>

<!-- OSCache build file - http://www.opensymphony.com/oscache -->
<project name="oscache" default="jar" basedir=".">

    <property file="build.properties"/>

    <!-- Initialise all the variables as required -->
    <target name="init">

        <!-- project properties -->
        <property name="name" value="oscache"/>
        <property name="Name" value="OSCache"/>

        <tstamp>
            <format property="release" pattern="-dMMMyy" locale="en" timezone="GMT"/>
        </tstamp>

        <!-- directory properties -->
        <property name="build.dir" value="build"/>
        <property name="build.test.dir" value="build.test"/>
        <property name="dist.dir" value="dist"/>

        <property name="src.dir" value="src"/>
        <property name="src.core" value="${src.dir}/core"/>
        <property name="src.plugins" value="${src.dir}/plugins"/>
        <property name="src.webapp" value="${src.dir}/webapp"/>

        <property name="doc.dir" value="docs"/>
        <property name="lib.dir" value="lib"/>
        <property name="tmp.dir" value="tmp"/>

        <property name="debug" value="true"/>

        <!-- document properties -->
        <property name="packages" value="com.opensymphony.oscache.*"/>

        <!-- This property must match with what is included in the oscache.properties files -->
        <property name="test.cache.path" value="/tmp/cachetagscache"/>

        <property name="clover.initstring" location="${build.test.dir}/testcoverage.db"/>

        <available property="junit.available" classname="junit.framework.TestCase"/>
        <available property="clover.available" classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
    </target>


    <!-- Classpath -->
    <path id="cp">
        <fileset dir="lib">
            <include name="build/*.jar"/>
            <include name="core/*.jar"/>
        </fileset>
    </path>

    <!-- Plugins Classpath -->
    <path id="plugins.cp">
        <path refid="cp"/>
        <fileset dir="lib">
            <include name="plugins/**/*.jar"/>
        </fileset>
    </path>

    <path id="jalopy.classpath">
        <fileset dir="lib/build/jalopy">
            <include name="*.jar"/>
        </fileset>
    </path>

    <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
        <classpath refid="jalopy.classpath"/>
    </taskdef>

    <target name="junit-check" depends="init" unless="junit.available">
        <fail message="Cannot run test cases. Please copy lib/build/junit-3.8.1.jar to ${ant.home}/lib"/>
    </target>

    <target name="clover-check" depends="init" unless="clover.available">
        <fail message="Cannot run coverage tests. Please copy lib/build/clover-1.2.3.jar to ${ant.home}/lib"/>
    </target>

    <!-- Prepares the build directory -->
    <target name="prepare" depends="init">
        <mkdir dir="${build.dir}/META-INF"/>
        <copy file="${src.core}/etc/${name}.tld" tofile="${build.dir}/META-INF/taglib.tld"/>
    </target>


    <!-- Compiles the core source code -->
    <target name="compile" depends="prepare">
        <javac srcdir="${src.core}/java" destdir="${build.dir}" includes="com/opensymphony/oscache/**" debug="${debug}" classpathref="cp"/>
    </target>

    <target name="plugins-compile" depends="compile">
        <javac srcdir="${src.plugins}/diskpersistence/java" destdir="${build.dir}" includes="com/opensymphony/oscache/**" debug="${debug}" classpathref="plugins.cp"/>

        <javac srcdir="${src.plugins}/clustersupport/java" destdir="${build.dir}" includes="com/opensymphony/oscache/**" debug="${debug}" classpathref="plugins.cp"/>
    </target>


    <!-- Prepares and compiles the web application, which includes the web test suite -->
    <target name="example-war" depends="jar">
        <mkdir dir="${build.dir}/webapp"/>

        <javac srcdir="${src.webapp}/WEB-INF/classes" destdir="${build.dir}/webapp" includes="com/opensymphony/oscache/**" debug="${debug}" classpath="${build.dir}" classpathref="cp"/>

        <war destfile="${dist.dir}/${name}-example.war" basedir="${src.webapp}" webxml="${src.webapp}/WEB-INF/web.xml" excludes="WEB-INF/web.xml">
            <lib dir="${lib.dir}/core"/>
            <lib file="${dist.dir}/${name}-${version}${release}.jar"/>
            <webinf file="${src.dir}/core/etc/oscache.tld"/>
            <classes dir="${build.dir}/webapp"/>
        </war>
    </target>


    <!-- Build a usable jar file -->
    <target name="jar" depends="format, compile, plugins-compile">
        <mkdir dir="${dist.dir}"/>

        <jar jarfile="${dist.dir}/${name}-${version}${release}.jar" basedir="${build.dir}" includes="**" excludes="test/**, docs/**, *.war"/>
    </target>


    <!-- Cleans up generated stuff -->
    <target name="clean" depends="init">
        <delete dir="${build.dir}"/>
        <delete dir="${build.test.dir}"/>
        <delete dir="${dist.dir}"/>
    </target>

    <target name="format" depends="init">
        <jalopy fileformat="unix" convention="${src.dir}/core/etc/jalopy.xml" history="file" historymethod="adler32" loglevel="error" threads="2" classpathref="cp">
            <fileset dir="${src.dir}">
                <include name="**/*.java"/>
            </fileset>
        </jalopy>
    </target>

    <!-- Run the unit tests. This is used by the test target, so do not call directly -->
    <target name="test-base">
        <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

        <!-- Clear out any previous persistent cache directory -->
        <delete dir="${test.cache.path}" failonerror="false"/>

        <junit printsummary="yes" haltonfailure="no" haltonerror="yes" fork="yes">
            <classpath>
                <pathelement location="${build.test.dir}"/>
                <path refid="plugins.cp"/>
            </classpath>

            <formatter type="xml"/>

            <batchtest todir="${dist.dir}/docs/junit">
                <fileset dir="${build.test.dir}">
                    <include name="**/TestComplete*.class"/>
                    <exclude name="**/web/*.*"/>
                    <exclude name="**/clustersupport/*.*"/>
                </fileset>
            </batchtest>
        </junit>
    </target>

    <target name="test-cluster" if="test.cluster">
        <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

        <!-- Clear out any previous persistent cache directory -->
        <delete dir="${test.cache.path}" failonerror="false"/>

        <junit printsummary="yes" haltonfailure="no" haltonerror="yes" fork="yes">
            <classpath>
                <pathelement location="${build.test.dir}"/>
                <path refid="plugins.cp"/>
            </classpath>

            <formatter type="xml"/>

            <batchtest todir="${dist.dir}/docs/junit">
                <fileset dir="${build.test.dir}">
                    <include name="**/TestCompleteCluster.class"/>
                </fileset>
            </batchtest>
        </junit>
    </target>

    <target name="test-web" if="test.web.baseURL">
        <mkdir dir="${dist.dir}/docs/junit"/>
        <mkdir dir="${build.test.dir}"/>

        <!-- Clear out any previous persistent cache directory -->
        <delete dir="${test.cache.path}"/>

        <javac srcdir="${src.core}/test" destdir="${build.test.dir}" includes="com/opensymphony/oscache/web/**" debug="${debug}" classpath="${build.dir}" classpathref="cp"/>

        <java classname="com.opensymphony.oscache.web.CheckDeployment" failonerror="true" classpath="${build.test.dir}" fork="yes">
            <arg value="${test.web.baseURL}"/>
        </java>

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

        <junit printsummary="yes" haltonfailure="no" haltonerror="yes" fork="yes">
            <sysproperty key="test.web.baseURL" value="${test.web.baseURL}"/>
            <classpath>
                <pathelement location="${build.test.dir}"/>
                <pathelement location="${build.dir}"/>
                <path refid="cp"/>
            </classpath>

            <formatter type="xml"/>
            <formatter type="plain" useFile="false"/>
            <batchtest todir="${dist.dir}/docs/junit">
                <fileset dir="${build.test.dir}">
                    <include name="**/web/TestComplete*.class"/>
                    <include name="**/web/TestLoadComplete*.class"/>
                </fileset>
            </batchtest>
        </junit>
    </target>


    <!-- Run JUnit tests using different combinations of disk and memory caching -->
    <target name="test" depends="init, compile, example-war, clover-check, junit-check">
        <mkdir dir="${dist.dir}/docs/junit"/>
        <mkdir dir="${dist.dir}/docs/clover"/>
        <mkdir dir="${build.test.dir}"/>

        <taskdef resource="clovertasks"/>
        <javac destdir="${build.test.dir}" debug="${debug}" classpathref="plugins.cp" compiler="org.apache.tools.ant.taskdefs.CloverCompilerAdapter">
        	<src path="${src.core}/java"/>
        	<src path="${src.plugins}/diskpersistence/java"/>
        	<src path="${src.plugins}/clustersupport/java"/>
        </javac>
    	<javac destdir="${build.test.dir}" debug="${debug}" classpathref="plugins.cp">
    		<src path="${src.core}/test"/>
        	<src path="${src.plugins}/diskpersistence/test"/>
        	<src path="${src.plugins}/clustersupport/test"/>
        </javac>
    	
        <!-- Run tests using Memory Cache Only -->
        <copy file="${src.core}/test/oscacheMemoryOnly.properties" tofile="${build.test.dir}/oscache.properties" overwrite="yes"/>
        <echo message="Running tests with memory cache only" level="info"/>
        <antcall target="test-base"/>
        <antcall target="test-web"/>

        <!-- Rerun tests using Disk Cache Only -->
        <copy file="${src.plugins}/diskpersistence/test/oscacheDiskOnly.properties" tofile="${build.test.dir}/oscache.properties" overwrite="yes"/>
        <echo message="Running tests with disk cache only" level="info"/>
        <antcall target="test-base"/>
        <antcall target="test-web"/>

        <!-- ReRun tests using Disk and Memory Cache -->
        <copy file="${src.plugins}/diskpersistence/test/oscacheDiskAndMemory.properties" tofile="${build.test.dir}/oscache.properties" overwrite="yes"/>
        <echo message="Running tests with disk and memory caches" level="info"/>
        <antcall target="test-base"/>
        <antcall target="test-web"/>
	
       	<!-- ReRun tests using Memory and Disk Overflow Cache -->	
		<copy file="${src.plugins}/diskpersistence/test/oscacheMemoryAndOverflowToDisk.properties" tofile="${build.test.dir}/oscache.properties" overwrite="yes"/>
	    <echo message="Running tests with memory and disk overflow caches" level="info"/>
	    <antcall target="test-base"/>
	    <antcall target="test-web"/>
        	
        <!-- Run clustering tests -->
        <echo message="Running tests with memory caches and clustering" level="info"/>
        <antcall target="test-cluster"/>

        <delete dir="${test.cache.path}"/>
    </target>


    <!-- Generate JavaDoc -->
    <target name="javadocs" depends="init">
        <mkdir dir="${dist.dir}/docs/api"/>
        <javadoc sourcepath="${src.core}/java" destdir="${dist.dir}/docs/api"
          packagenames="${packages}" classpathref="cp" author="true" version="true"
          windowTitle="${Name} ${version}${release} API" doctitle="${Name}"
          footer="See &lt;a href=&quot;http://www.opensymphony.com/&quot; target=&quot;_top&quot;&gt;www.opensymphony.com&lt;/a&gt; for more information."
          use="true" verbose="false" stylesheetfile="${doc.dir}/api.css" />
    </target>

    <target name="docs" depends="javadocs, clover.report, junit.report">
        <copy todir="${dist.dir}/docs">
            <fileset dir="${doc.dir}"/>
        </copy>
    </target>

    <!-- Create the distribution zip files -->
    <target name="dist" depends="clean, jar, docs, example-war, clover.report, junit.report">
        <mkdir dir="${tmp.dir}/docs"/>
        <mkdir dir="${tmp.dir}/src"/>
        <mkdir dir="${tmp.dir}/lib"/>
        <mkdir dir="${tmp.dir}/etc"/>

        <copy todir="${tmp.dir}/docs">
            <fileset dir="${dist.dir}/docs"/>
        </copy>
        <copy todir="${tmp.dir}/src">
            <fileset dir="${src.dir}" excludes="core/etc/**"/>
        </copy>
        <copy todir="${tmp.dir}/lib">
            <fileset dir="${lib.dir}" excludes="build/**" />
        </copy>

        <copy file="${dist.dir}/${name}-${version}${release}.jar" tofile="${tmp.dir}/${name}-${version}${release}.jar"/>
        <copy file="${src.core}/etc/oscache.properties" tofile="${tmp.dir}/etc/oscache.properties"/>
        <copy file="${src.core}/etc/oscache.tld" tofile="${tmp.dir}/etc/oscache.tld"/>
        <copy file="readme.txt" tofile="${tmp.dir}/readme.txt" failonerror="false"/>

        <zip zipfile="${dist.dir}/${name}-${version}${release}-full.zip" basedir="${tmp.dir}" includes="**"/>

        <!-- Remove everything that's not in the binary release -->
        <delete dir="${tmp.dir}/src"/>
        <delete dir="${tmp.dir}/lib/build"/>
        <delete dir="${tmp.dir}/lib/plugins"/>
        <move todir="${tmp.dir}/lib">
            <fileset dir="${tmp.dir}/lib/core"/>
        </move>
        <delete dir="${tmp.dir}/lib/core"/>
        <delete dir="${tmp.dir}/docs/junit"/>
        <delete dir="${tmp.dir}/docs/clover"/>

        <zip zipfile="${dist.dir}/${name}-${version}${release}-binary.zip" basedir="${tmp.dir}" includes="**"/>

        <delete dir="${tmp.dir}"/>
    </target>

    <target name="clover.report" depends="test">
        <clover-report>
            <current outfile="${dist.dir}/docs/clover">
                <fileset dir="${src.core}" excludes="**/Test*"/>
                <fileset dir="${src.plugins}" excludes="**/Test*"/>
                <format type="html"/>
            </current>
        </clover-report>
    </target>

    <target name="junit.report" depends="test">
        <junitreport todir="${dist.dir}/docs/junit">
            <fileset dir="${dist.dir}/docs/junit">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${dist.dir}/docs/junit"/>
        </junitreport>
    </target>

    <target name="reports" depends="junit.report,clover.report"/>

</project>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.