mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
04.13.2010 d692e4398b8e742b765dc332eefc3020ae2de191
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="Directory Server-IDE">
    <!-- Import build.xml properties and targets -->
    <import file="../build.xml"/>
    <path id="opends.path">
        <pathelement path="build/classes:build/build-tools/classes:lib/activation.jar:lib/aspectjrt.jar:lib/je.jar:lib/mail.jar:build/quicksetup/classes:build/build-tools/build-tools.jar:build/unit-tests/classes:ext/testng/lib/testng-5.7b-jdk15.jar:ext/ant/lib/ant.jar:ext/svnkit/svnkit.jar:ext/emma/lib/emma.jar:build/dsml/classes:resource/dsml/lib/jaxb-api.jar:resource/dsml/lib/jaxb-impl.jar:resource/dsml/lib/jsr173_1.0_api.jar:resource/dsml/lib/saaj-1.3.jar:resource/dsml/lib/saaj-impl-1.3.jar:resource/dsml/lib/j2ee.jar"/>
        <pathelement location="build/build-tools/classes"/>
        <pathelement location="build/classes"/>
        <pathelement location="build/quicksetup/classes"/>
        <pathelement location="build/unit-tests/classes"/>
        <pathelement location="build/dsml/classes"/>
        <fileset dir="${opendmk.lib.dir}">
            <include name="*.jar"/>
        </fileset>
    </path>
    <!-- Prepare testng unit tests environment -->
    <taskdef resource="testngtasks">
        <classpath>
            <fileset dir="${testng.lib.dir}">
                <include name="*.jar"/>
            </fileset>
        </classpath>
    </taskdef>
    <target name="prepare-test">
        <delete failonerror="false">
            <fileset dir="${unittest.report.dir}" includes="*"/>
        </delete>
        <mkdir dir="${unittest.report.dir}"/>
    </target>
    <!-- -->
    <!-- Run a selected testng file -->
    <!-- -->
    <target depends="prepare-test" name="run-selected-testng-file">
        <fail unless="run.class">Must set property 'run.class'</fail>
        <echo message="Running test (normal): ${run.class}"/>
        <testng dumpCommand="true" enableAssert="false" haltonfailure="false" listeners="org.opends.server.TestListener org.testng.reporters.FailedReporter" outputdir="${unittest.report.dir}" suiteRunnerClass="org.opends.server.SuiteRunner" useDefaultListeners="false" verbose="0">
            <classpath refid="opends.path"/>
            <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}"/>
            <jvmarg value="-Dorg.opends.server.RunningUnitTests=true"/>
            <jvmarg value="-Dorg.opends.test.suppressOutput=false"/>
            <jvmarg value="-Dorg.opends.test.pauseOnFailure=false"/>
            <jvmarg value="-Dorg.opends.test.debug.target=false"/>
            <jvmarg value="-Dorg.opends.server.snmp.opendmk=${opendmk.lib.dir}"/>
            <jvmarg value="-Dorg.opends.test.copyClassesToTestPackage=true"/>
            <jvmarg value="-Dtest.progress=all"/>
            <jvmarg value="-Xms192M"/>
            <jvmarg value="-Xmx192M"/>
            <classfileset file="${unittest.classes.dir}/${run.class}.class"/>
        </testng>
    </target>
    <!-- -->
    <!-- Debug a selected file in testng unit tests sources -->
    <!-- -->
    <target name="debug-selected-testng-file">
        <fail unless="debug.class">Must set property 'debug.class'</fail>
        <echo message="Debugging test (normal): ${debug.class}"/>
        <ant antfile="build.xml" inheritall="false" target="dynamicconstants"/>
        <nbjpdastart addressproperty="jpda.address" name="Directory Server" transport="dt_socket">
            <classpath refid="opends.path"/>
        </nbjpdastart>
        <testng enableAssert="false" haltonfailure="false" listeners="org.opends.server.TestListener org.testng.reporters.FailedReporter" outputdir="${unittest.report.dir}" suiteRunnerClass="org.opends.server.SuiteRunner" useDefaultListeners="false" verbose="5">
            <classpath refid="opends.path"/>
            <jvmarg value="-Dorg.opends.server.LdapPort=1389"/>
            <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}"/>
            <jvmarg value="-Dorg.opends.server.RunningUnitTests=true"/>
            <jvmarg value="-Dorg.opends.test.suppressOutput=false"/>
            <jvmarg value="-Dorg.opends.test.pauseOnFailure=false"/>
            <jvmarg value="-Dorg.opends.test.debug.target=false"/>
            <jvmarg value="-Dorg.opends.server.snmp.opendmk=${opendmk.lib.dir}"/>
            <jvmarg value="-Dorg.opends.test.copyClassesToTestPackage=true"/>
            <jvmarg value="-Dtest.progress=all"/>
            <jvmarg value="-Xms192M"/>
            <jvmarg value="-Xmx192M"/>
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
            <classfileset file="${unittest.classes.dir}/${debug.class}.class"/>
        </testng>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/server folder -->
    <!-- -->
    <target name="compile-selected-files-in-server">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <!-- TODO decide on and define some value for ${build.classes.dir} -->
        <mkdir dir="${classes.dir}"/>
        <javac destdir="${classes.dir}" includes="${files}" source="1.5" srcdir="src/server">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in testng unit tests source folder -->
    <!-- -->
    <target name="compile-selected-testng-file">
        <!-- Compile the test cases -->
        <echo message="Compiling test (normal): ${files}"/>
        <mkdir dir="${unittest.classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" deprecation="true" destdir="${unittest.classes.dir}" fork="true" includes="${files}" memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}" source="1.5" srcdir="${unittest.testng.src.dir}" target="1.5">
            <compilerarg value="-Xlint:all"/>
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Run a selected class in src/server folder -->
    <!-- -->
    <target depends="dynamicconstants" name="run-selected-file-in-server">
        <fail unless="run.class">Must set property 'run.class'</fail>
        <property location="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}" name="pdir"/>
        <ant antfile="build.xml" inheritall="false" target="dynamicconstants"/>
        <java classname="${run.class}" failonerror="true" fork="true">
            <classpath refid="opends.path"/>
            <jvmarg value="-Dorg.opends.server.BuildRoot=${pdir}"/>
            <jvmarg value="-Dorg.opends.server.scriptName=start-ds"/>
            <jvmarg value="-Dorg.opends.server.ServerRoot=${pdir}"/>
            <arg value="--configClass=org.opends.server.extensions.ConfigFileHandler"/>
            <arg value="--configFile=${pdir}/config/config.ldif"/>
            <arg value="--nodetach"/>
        </java>
    </target>
    <!-- -->
    <!-- Debug a selected file in src/server folder -->
    <!-- -->
    <target depends="dynamicconstants" name="debug-selected-file-in-server">
        <fail unless="debug.class">Must set property 'debug.class'</fail>
        <property location="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}" name="pdir"/>
        <ant antfile="build.xml" inheritall="false" target="dynamicconstants"/>
        <nbjpdastart addressproperty="jpda.address" name="Directory Server" transport="dt_socket">
            <classpath refid="opends.path"/>
        </nbjpdastart>
        <java classname="${debug.class}" fork="true">
            <classpath refid="cp"/>
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
            <jvmarg value="-Dorg.opends.server.BuildRoot=${pdir}"/>
            <jvmarg value="-Dorg.opends.server.scriptName=start-ds"/>
            <jvmarg value="-Dorg.opends.server.ServerRoot=${pdir}"/>
            <jvmarg value="-Dorg.opends.server.debug.enabled=true"/>
            <arg value="--configClass=org.opends.server.extensions.ConfigFileHandler"/>
            <arg value="--configFile=${pdir}/config/config.ldif"/>
            <arg value="--nodetach"/>
        </java>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/ads folder -->
    <!-- -->
    <target name="compile-selected-files-in-ads">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <mkdir dir="${classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${classes.dir}" includes="${files}" source="1.5" srcdir="src/ads">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/build-tools folder -->
    <!-- -->
    <target name="compile-selected-files-in-build-tools">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <mkdir dir="${buildtools.classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${buildtools.classes.dir}" includes="${files}" source="1.5" srcdir="src/build-tools">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/guitools folder -->
    <!-- -->
    <target name="compile-selected-files-in-guitools">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <mkdir dir="${classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${classes.dir}" includes="${files}" source="1.5" srcdir="src/guitools">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/messages/src folder -->
    <!-- -->
    <target name="compile-selected-files-in-messages-src">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <mkdir dir="${classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${classes.dir}" includes="${files}" source="1.5" srcdir="src/messages/src">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/quicksetup folder -->
    <!-- -->
    <target name="compile-selected-files-in-quicksetup">
        <fail unless="files">Must set property 'files'</fail>
        <mkdir dir="${quicksetup.classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${quicksetup.classes.dir}" includes="${files}" source="1.5" srcdir="src/quicksetup">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/dsml folder -->
    <!-- -->
    <target name="compile-selected-files-in-dsml">
        <fail unless="files">Must set property 'files'</fail>
        <echo message="Compiling source (normal): ${files}"/>
        <mkdir dir="${dsml.classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${dsml.classes.dir}" includes="${files}" source="1.5" srcdir="src/dsml">
            <classpath refid="opends.path"/>
        </javac>
    </target>
    <!-- -->
    <!-- Compile a selected file in src/snmp/src folder -->
    <!-- -->
    <target name="compile-selected-files-in-snmp">
        <fail unless="files">Must set property 'files'</fail>
        <mkdir dir="${classes.dir}"/>
        <javac debug="on" debuglevel="${build.debuglevel}" destdir="${classes.dir}" includes="${files}" source="1.5" srcdir="src/snmp/src">
            <classpath refid="opends.path"/>
        </javac>
    </target>
</project>