File: build.xml

package info (click to toggle)
jython 2.7.2%2Brepack1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 62,676 kB
  • sloc: python: 640,908; java: 306,458; xml: 1,984; sh: 522; ansic: 126; makefile: 76
file content (105 lines) | stat: -rw-r--r-- 4,311 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<project name="modjy" default="test">

    <description>Modjy test build.xml</description>

    <!-- set global properties for this build -->

    <property name="test_src" location="java" />
    <property name="build" location="build" />

    <!-- Import the environment -->
    <property environment="env" />

    <!-- Jython properties    -->

    <property name="jython_home" location="${env.JYTHON_HOME}" />
    <property name="jython_jar" value="jython-dev.jar" />
    <property name="jython_jar_path" location="${jython_home}/${jython_jar}" />
    <property name="jython_cachedir" location="${jython_home}/cachedir" />
    <property name="mockrunner_home" location="${env.MOCKRUNNER_HOME}" />

    <target name="init" depends="clean_py_class_files">
        <available property="jython_home.exists" file="${jython_home}" />
        <fail unless="jython_home.exists" message="jython_home, ${jython_home}, doesn't exist" />
        <available property="mockrunner_home.exists" file="${mockrunner_home}" />
        <fail unless="mockrunner_home.exists" message="mockrunner_home, ${mockrunner_home}, doesn't exist" />
        <!-- Create the build directory structure used by compile -->
        <mkdir dir="${build}" />
    </target>

    <target name="clean_py_class_files">
        <!-- Clean out $py.class files in case the class file format has changed -->
        <delete>
            <fileset dir="." includes="**/*$py.class"/>
        </delete>
    </target>

    <target name="clean" depends="clean_py_class_files" description="clean up">
        <!-- Delete the ${build} and ${dist} directory trees -->
        <delete dir="${build}" />
    </target>

    <!-- Now testing related targets -->

    <target name="do_test" depends="init" description="Run unit tests against a single jdk/servlet combo">
        <echo message="Running tests against JDK ${jdk_version}, Servlet ${servlet_version}" />

        <property name="mockrunner_home" value="${env.MOCKRUNNER_HOME}" />
        <property name="mockrunner_jar" location="${mockrunner_home}/jar" />
        <property name="mockrunner_lib" location="${mockrunner_home}/lib/jdk${jdk_version}/${servlet_version}" />

        <path id="test.classpath">
            <pathelement path="${build}" />
            <pathelement path="${jython_jar_path}" />
            <fileset dir="${jython_home}/javalib" includes="**/*.jar" />
            <fileset dir="${mockrunner_jar}" includes="**/*.jar" />
            <fileset dir="${mockrunner_lib}" includes="**/*.jar" />
        </path>

        <javac srcdir="${test_src}" destdir="${build}" classpathref="test.classpath" debug="on" />
        <java classname="com.xhaus.modjy.ModjyTestBase" dir="." fork="yes" classpathref="test.classpath">
            <jvmarg value="-XX:MaxPermSize=128m"/>
            <sysproperty key="JYTHON_HOME" value="${jython_home}" />
            <sysproperty key="python.cachedir.skip" value="true" />
        </java>
    </target>

    <target name="test">
        <antcall target="do_test">
            <param name="jdk_version" value="1.5" />
            <param name="servlet_version" value="j2ee1.3" />
        </antcall>
    </target>

    <target name="test_java_15" depends="clean">
        <antcall target="do_test">
            <param name="jdk_version" value="1.5" />
            <param name="servlet_version" value="j2ee1.3" />
        </antcall>
        <antcall target="do_test">
            <param name="jdk_version" value="1.5" />
            <param name="servlet_version" value="j2ee1.4" />
        </antcall>
        <antcall target="do_test">
            <param name="jdk_version" value="1.5" />
            <param name="servlet_version" value="jee5" />
        </antcall>
    </target>

    <target name="test_java_16" depends="clean">
        <antcall target="do_test">
            <param name="jdk_version" value="1.6" />
            <param name="servlet_version" value="j2ee1.3" />
        </antcall>
        <antcall target="do_test">
            <param name="jdk_version" value="1.6" />
            <param name="servlet_version" value="j2ee1.4" />
        </antcall>
        <antcall target="do_test">
            <param name="jdk_version" value="1.6" />
            <param name="servlet_version" value="jee5" />
        </antcall>
    </target>

</project>