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 219 220 221 222 223 224 225
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project basedir="." default="run" name="performance/threaddemo"
xmlns="antlib:org.apache.tools.ant"
xmlns:nbj="antlib:org.netbeans.modules.debugger.jpda.ant"
xmlns:nbb="antlib:org.netbeans.modules.ant.browsetask">
<!-- Put any overrides here (check against build.properties): -->
<property file="user.build.properties"/>
<!-- Main definitions: -->
<property file="build.properties"/>
<target name="init">
<!-- For benefit of various modules: -->
<property name="build.compiler.debug" value="true"/>
<condition property="openide.available">
<available file="${util.jar}"/>
</condition>
<condition property="looks.and.registry.available">
<and>
<available file="${looks.jar}"/>
<available file="${registry.jar}"/>
</and>
</condition>
<condition property="should.build.openide">
<and>
<not>
<isset property="openide.available"/>
</not>
<!-- Building openide/looks will build openide automatically: -->
<isset property="looks.and.registry.available"/>
</and>
</condition>
</target>
<target name="build-openide" depends="init" if="should.build.openide">
<fail>XXX not yet impl; build platform first</fail>
</target>
<target name="build-looks" depends="init" unless="looks.and.registry.available">
<ant dir="${nbroot}/openide/registry" inheritall="false" inheritrefs="false"/>
<ant dir="${nbroot}/openide/convertor" inheritall="false" inheritrefs="false"/>
<ant dir="${nbroot}/o.n.core/registry" inheritall="false" inheritrefs="false"/>
<ant dir="${nbroot}/openide/looks" inheritall="false" inheritrefs="false"/>
</target>
<target name="compile" depends="build-openide,build-looks">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="src" destdir="${build.classes.dir}" debug="true" deprecation="true" source="1.6">
<classpath path="${build.cp}"/>
<compilerarg value="-Xlint:unchecked"/>
</javac>
<copy todir="${build.classes.dir}">
<fileset dir="src">
<exclude name="**/*.java"/>
<exclude name="**/package.html"/>
<exclude name="**/doc-files/"/>
</fileset>
</copy>
</target>
<target name="compile-selected-files-in-src">
<fail unless="files">Must set property 'files'</fail>
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="src" destdir="${build.classes.dir}" debug="true" deprecation="true" source="1.6" includes="${files}">
<classpath path="${build.cp}"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="build" depends="compile">
<jar jarfile="${threaddemo.jar}" manifest="manifest.mf" compress="false">
<fileset dir="${build.classes.dir}"/>
</jar>
</target>
<target name="build-complete" depends="compile">
<jar jarfile="${threaddemo-complete.jar}" manifest="manifest.mf" compress="true">
<fileset dir="src"/>
<fileset dir="${build.classes.dir}"/>
<zipfileset src="${util.jar}"/>
<zipfileset src="${nodes.jar}"/>
<zipfileset src="${actions.jar}"/>
<zipfileset src="${explorer.jar}"/>
<zipfileset src="${text.jar}"/>
<zipfileset src="${dialogs.jar}"/>
<zipfileset src="${windows.jar}"/>
<zipfileset src="${looks.jar}"/>
<zipfileset src="${Spin.jar}"/>
</jar>
</target>
<target name="run" depends="build">
<java classname="threaddemo.Main" fork="true" failonerror="true">
<classpath path="${run.cp}"/>
<arg file="${testdir}"/>
<jvmarg value="-Xmx256m"/>
<jvmarg value="-ea"/>
<sysproperty key="java.util.logging.config.file" file="${logging.properties}"/>
<sysproperty key="com.sun.management.jmxremote" value="1"/>
</java>
</target>
<target name="debug" depends="build,do-debug"/>
<target name="do-debug">
<java classname="threaddemo.Main" fork="true" failonerror="true">
<classpath path="${run.cp}"/>
<arg file="${testdir}"/>
<jvmarg value="-Xmx64m"/>
<jvmarg value="-ea"/>
<sysproperty key="java.util.logging.config.file" file="logging.properties"/>
<sysproperty key="com.sun.management.jmxremote" value="1"/>
<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address},suspend=n"/>
</java>
</target>
<target name="debug-nb" depends="build">
<nbj:nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="threaddemo">
<nbj:classpath path="${run.cp}"/>
</nbj:nbjpdastart>
<antcall target="do-debug"/>
</target>
<target name="debug-fix-nb">
<javac srcdir="src" destdir="${build.classes.dir}" debug="true" deprecation="true" source="1.6">
<classpath path="${build.cp}"/>
<include name="${fix.file}.java"/>
</javac>
<nbjpdareload>
<fileset dir="${build.classes.dir}">
<include name="${fix.file}.class"/>
</fileset>
</nbjpdareload>
</target>
<target name="profile" depends="build">
<nbprofiledirect>
<classpath path="${run.cp}"/>
</nbprofiledirect>
<property environment="env"/>
<java classname="threaddemo.Main" fork="true" failonerror="true" dir="${profiler.session.working.dir}" jvm="${profiler.info.jvm}">
<classpath path="${run.cp}"/>
<arg file="${testdir}"/>
<jvmarg value="-Xmx256m"/>
<jvmarg value="-ea"/>
<sysproperty key="java.util.logging.config.file" file="${logging.properties}"/>
<sysproperty key="com.sun.management.jmxremote" value="1"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="LD_LIBRARY_PATH" path="${profiler.info.agentpath}:${env.LD_LIBRARY_PATH}"/>
</java>
</target>
<target name="javadoc">
<property name="javadoc.docs.jdk" value="http://java.sun.com/javase/6/docs/api/"/>
<!--
<property name="javadoc.web.root" value="http://www.netbeans.org/download/dev/javadoc"/>
-->
<mkdir dir="${build.javadoc.dir}"/>
<javadoc destdir="${build.javadoc.dir}" source="1.6">
<classpath path="${build.cp}"/>
<sourcepath>
<pathelement location="src"/>
</sourcepath>
<fileset dir="src"/>
<link href="${javadoc.docs.jdk}" offline="true" packagelistloc="${nbroot}/nbbuild/javadoctools"/>
<!--
<link href="${javadoc.web.root}/org-netbeans-modules-looks" offline="true" packagelistloc="${nbroot}/nbbuild/build/javadoc/org-netbeans-modules-looks"/>
-->
</javadoc>
</target>
<target name="javadoc-nb" depends="javadoc">
<nbb:nbbrowse file="${build.javadoc.dir}/overview-summary.html"/>
</target>
<target name="test-build" depends="build">
<mkdir dir="${build.test.classes.dir}"/>
<javac srcdir="test" destdir="${build.test.classes.dir}" debug="true" deprecation="true" source="1.6">
<classpath path="${test.build.cp}"/>
</javac>
<!-- copy resources if it becomes necessary -->
</target>
<target name="test" depends="test-build">
<mkdir dir="${build.test.results.dir}"/>
<junit failureproperty="tests.failed" showoutput="true" fork="true">
<batchtest todir="${build.test.results.dir}">
<fileset dir="test">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<classpath path="${test.run.cp}"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
</junit>
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
</project>
|